use of org.kie.workbench.common.stunner.bpmn.definition.property.task.BaseReusableSubprocessTaskExecutionSet in project kie-wb-common by kiegroup.
the class ReusableSubprocessConverter method toFlowElement.
public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) {
CallActivity activity = bpmn2.createCallActivity();
activity.setId(n.getUUID());
CallActivityPropertyWriter p = propertyWriterFactory.of(activity);
BaseReusableSubprocess definition = n.getContent().getDefinition();
BPMNGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet();
p.setOnEntryAction(executionSet.getOnEntryAction());
p.setOnExitAction(executionSet.getOnExitAction());
p.setCalledElement(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue()));
p.setAsync(executionSet.getIsAsync().getValue());
p.setIndependent(executionSet.getIndependent().getValue());
if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) {
p.setAbortParent(executionSet.getAbortParent().getValue());
}
p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue());
p.setSlaDueDate(executionSet.getSlaDueDate());
p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) {
p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential());
p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue());
p.setInput(executionSet.getMultipleInstanceDataInput().getValue());
p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue());
p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue());
p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue());
}
p.setSimulationSet(definition.getSimulationSet());
p.setAbsoluteBounds(n);
p.setCase(executionSet.getIsCase().getValue());
p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue());
p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
return p;
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.task.BaseReusableSubprocessTaskExecutionSet in project kie-wb-common by kiegroup.
the class BaseReusableSubProcessFilterProvider method provideFilters.
@Override
@SuppressWarnings("unchecked")
public Collection<FormElementFilter> provideFilters(String elementUUID, Object definition) {
Collection<FormElementFilter> filters = super.provideFilters(elementUUID, definition);
BaseReusableSubprocessTaskExecutionSet executionSet = ((T) definition).getExecutionSet();
filters.add(new FormElementFilter(ABORT_PARENT, p -> Boolean.FALSE.equals(executionSet.getIndependent().getValue())));
return filters;
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.task.BaseReusableSubprocessTaskExecutionSet in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method testUnmarshallReusableSubprocess.
@Test
public void testUnmarshallReusableSubprocess() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_REUSABLE_SUBPROCESS);
ReusableSubprocess reusableSubprocess = null;
Iterator<Element> it = nodesIterator(diagram);
while (it.hasNext()) {
Element element = it.next();
if (element.getContent() instanceof View) {
Object oDefinition = ((View) element.getContent()).getDefinition();
if (oDefinition instanceof ReusableSubprocess) {
reusableSubprocess = (ReusableSubprocess) oDefinition;
break;
}
}
}
assertNotNull(reusableSubprocess);
assertNotNull(reusableSubprocess.getExecutionSet());
assertNotNull(reusableSubprocess.getExecutionSet().getCalledElement());
assertNotNull(reusableSubprocess.getGeneral());
BPMNGeneralSet generalSet = reusableSubprocess.getGeneral();
BaseReusableSubprocessTaskExecutionSet executionSet = reusableSubprocess.getExecutionSet();
assertNotNull(generalSet);
assertNotNull(executionSet);
assertEquals("my subprocess", generalSet.getName().getValue());
assertEquals("my-called-element\" <&> \"", executionSet.getCalledElement().getValue());
assertEquals(false, executionSet.getIndependent().getValue());
assertEquals(true, executionSet.getWaitForCompletion().getValue());
String assignmentsInfo = reusableSubprocess.getDataIOSet().getAssignmentsinfo().getValue();
assertEquals("|input1:String,input2:Float||output1:String,output2:Float|[din]pv1->input1,[din]pv2->input2,[dout]output1->pv1,[dout]output2->pv2", assignmentsInfo);
assertEquals("true", reusableSubprocess.getExecutionSet().getIsAsync().getValue().toString());
final String SLA_DUE_DATE = "12/25/1983";
assertEquals(SLA_DUE_DATE, executionSet.getSlaDueDate().getValue());
}
Aggregations