Commit 7e1e5cde authored by Aurelien Pupier's avatar Aurelien Pupier
Browse files

BS-14249: support generation of script for initial value of Business

Variable of types containing composition multiple (there was still
missing a part, don't know why some usecases were working)
parent fb16f192
......@@ -55,11 +55,15 @@ public class RootContractInputGenerator {
this.expressionBuilder = expressionBuilder;
}
public void buildForInstanciation(final BusinessObjectData data) throws OperationCreationException {
build(data, true);
}
public void build(final BusinessObjectData data) throws OperationCreationException {
build(data, false);
}
public void build(final BusinessObjectData data, final boolean isOnPool) throws OperationCreationException {
private void build(final BusinessObjectData data, final boolean isOnPool) throws OperationCreationException {
contractInput = ProcessFactory.eINSTANCE.createContractInput();
contractInput.setName(rootContractInputName);
contractInput.setType(ContractInputType.COMPLEX);
......
......@@ -131,7 +131,11 @@ public class ContractInputGenerationWizard extends Wizard {
final RootContractInputGenerator contractInputGenerator = new RootContractInputGenerator(contractInputFromBusinessObjectWizardPage.getRootName(),
contractInputFromBusinessObjectWizardPage.getMappings(), repositoryAccessor, operationBuilder, expressionBuilder);
try {
contractInputGenerator.build(data);
if (contractContainer instanceof Pool) {
contractInputGenerator.buildForInstanciation(data);
} else {
contractInputGenerator.build(data);
}
} catch (final OperationCreationException e) {
BonitaStudioLog.error("Failed to create Operations from contract", e);
new BonitaErrorDialog(getShell(), Messages.errorTitle, Messages.contractFromDataCreationErrorMessage, e).open();
......@@ -176,7 +180,7 @@ public class ContractInputGenerationWizard extends Wizard {
MessageDialog.openWarning(getShell(), Messages.notAllAttributesGeneratedTitle, Messages.notAllAttributesGeneratedMsg);
}
}
/**
* @return
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment