Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bonita
bonita-studio
Commits
be2ece6e
Commit
be2ece6e
authored
Feb 28, 2017
by
Romain Bioteau
Browse files
fix(contract) fix contract preview
closes BS-16238
parent
6a624f36
Changes
1
Hide whitespace changes
Inline
Side-by-side
bundles/plugins/org.bonitasoft.studio.contract/src/org/bonitasoft/studio/contract/ui/wizard/GeneratedScriptPreviewPage.java
View file @
be2ece6e
...
...
@@ -172,36 +172,38 @@ public class GeneratedScriptPreviewPage extends WizardPage {
@Override
public
void
setVisible
(
final
boolean
visible
)
{
super
.
setVisible
(
visible
);
try
{
getContainer
().
run
(
true
,
false
,
new
IRunnableWithProgress
()
{
@Override
public
void
run
(
IProgressMonitor
monitor
)
throws
InvocationTargetException
,
InterruptedException
{
generateExpressionScript
(
monitor
);
final
BusinessObjectData
data
=
(
BusinessObjectData
)
selectedDataObservable
.
getValue
();
if
(
data
!=
null
)
{
try
{
getContainer
().
run
(
false
,
false
,
new
IRunnableWithProgress
()
{
@Override
public
void
run
(
IProgressMonitor
monitor
)
throws
InvocationTargetException
,
InterruptedException
{
generateExpressionScript
(
data
,
monitor
);
}
});
document
.
set
(
generatedExpression
.
getContent
());
if
(
generatedExpression
.
getName
()
!=
null
)
{
scriptNameText
.
setText
(
generatedExpression
.
getName
());
}
}
);
document
.
set
(
generatedExpression
.
getContent
()
);
if
(
generatedExpression
.
getName
()
!=
null
)
{
scriptNameText
.
setText
(
generatedExpression
.
getName
()
);
}
catch
(
InvocationTargetException
|
InterruptedException
e
)
{
BonitaStudioLog
.
error
(
"Failed to create Operations from contract"
,
e
);
new
BonitaErrorDialog
(
getShell
(),
Messages
.
errorTitle
,
Messages
.
contractFromDataCreationErrorMessage
,
e
)
.
open
(
);
}
}
catch
(
InvocationTargetException
|
InterruptedException
e
)
{
BonitaStudioLog
.
error
(
"Failed to create Operations from contract"
,
e
);
new
BonitaErrorDialog
(
getShell
(),
Messages
.
errorTitle
,
Messages
.
contractFromDataCreationErrorMessage
,
e
)
.
open
();
}
}
protected
void
generateExpressionScript
(
IProgressMonitor
monitor
)
throws
InvocationTargetException
{
if
(
selectedDataObservable
.
getValue
()
!=
null
)
{
rootContractInputGenerator
=
createRootContractInputGenerator
();
if
(!
fieldToContractInputMappingsObservable
.
isEmpty
())
{
try
{
rootContractInputGenerator
.
buildForInstanciation
((
BusinessObjectData
)
selectedDataObservable
.
getValue
(),
monitor
);
generatedExpression
=
rootContractInputGenerator
.
getInitialValueExpression
();
}
catch
(
final
OperationCreationException
e
)
{
throw
new
InvocationTargetException
(
e
);
}
protected
void
generateExpressionScript
(
BusinessObjectData
data
,
IProgressMonitor
monitor
)
throws
InvocationTargetException
{
rootContractInputGenerator
=
createRootContractInputGenerator
();
if
(!
fieldToContractInputMappingsObservable
.
isEmpty
())
{
try
{
rootContractInputGenerator
.
buildForInstanciation
(
data
,
monitor
);
generatedExpression
=
rootContractInputGenerator
.
getInitialValueExpression
();
}
catch
(
final
OperationCreationException
e
)
{
throw
new
InvocationTargetException
(
e
);
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment