Search in sources :

Example 1 with WaitForCompletion

use of org.kie.workbench.common.stunner.bpmn.definition.property.task.WaitForCompletion in project kie-wb-common by kiegroup.

the class CallActivityConverter method convert.

public BpmnNode convert(CallActivity activity) {
    Node<View<ReusableSubprocess>, Edge> node = factoryManager.newNode(activity.getId(), ReusableSubprocess.class);
    ReusableSubprocess definition = node.getContent().getDefinition();
    ActivityPropertyReader p = propertyReaderFactory.of(activity);
    definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    definition.setExecutionSet(new ReusableSubprocessTaskExecutionSet(new CalledElement(activity.getCalledElement()), new Independent(p.isIndependent()), new WaitForCompletion(p.isWaitForCompletion()), new IsAsync(p.isAsync())));
    definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo()));
    node.getContent().setBounds(p.getBounds());
    definition.setSimulationSet(p.getSimulationSet());
    definition.setDimensionsSet(p.getRectangleDimensionsSet());
    definition.setFontSet(p.getFontSet());
    definition.setBackgroundSet(p.getBackgroundSet());
    return BpmnNode.of(node);
}
Also used : Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) WaitForCompletion(org.kie.workbench.common.stunner.bpmn.definition.property.task.WaitForCompletion) DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) Independent(org.kie.workbench.common.stunner.bpmn.definition.property.task.Independent) ReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.ReusableSubprocess) ActivityPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.ActivityPropertyReader) IsAsync(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync) Edge(org.kie.workbench.common.stunner.core.graph.Edge) ReusableSubprocessTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.task.ReusableSubprocessTaskExecutionSet) CalledElement(org.kie.workbench.common.stunner.bpmn.definition.property.task.CalledElement)

Example 2 with WaitForCompletion

use of org.kie.workbench.common.stunner.bpmn.definition.property.task.WaitForCompletion in project kie-wb-common by kiegroup.

the class ReusableSubprocessConverterTest method setUp.

@Before
public void setUp() {
    when(propertyWriterFactory.of(any(CallActivity.class))).thenReturn(propertyWriter);
    DataIOSet ioSet = mock(DataIOSet.class);
    when(ioSet.getAssignmentsinfo()).thenReturn(ASSIGNMENTS_INFO);
    final ReusableSubprocess definition = new ReusableSubprocess(new BPMNGeneralSet(NAME, DOCUMENTATION), new ReusableSubprocessTaskExecutionSet(new CalledElement(CALLED_ELEMENT), new IsCase(IS_CASE), new Independent(INDEPENDENT), new AbortParent(ABORT_PARENT), new WaitForCompletion(WAIT_FOR_COMPLETION), new IsAsync(IS_ASYNC), new AdHocAutostart(IS_ADHOC_AUTOSTART), new IsMultipleInstance(IS_MULTIPLE_INSTANCE), new MultipleInstanceExecutionMode(SEQUENTIAL), new MultipleInstanceCollectionInput(COLLECTION_INPUT), new MultipleInstanceDataInput(DATA_INPUT), new MultipleInstanceCollectionOutput(COLLECTION_OUTPUT), new MultipleInstanceDataOutput(DATA_OUTPUT), new MultipleInstanceCompletionCondition(COMPLETION_CONDITION), ON_ENTRY_ACTION, ON_EXIT_ACTION, new SLADueDate(SLA_DUE_DATE)), ioSet, new BackgroundSet(), new FontSet(), new RectangleDimensionsSet(), SIMULATION_SET, new AdvancedData());
    final View<BaseReusableSubprocess> view = new ViewImpl<>(definition, BOUNDS);
    node = new NodeImpl<>(UUID);
    node.setContent(view);
    converter = new ReusableSubprocessConverter(propertyWriterFactory);
}
Also used : BaseReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess) MultipleInstanceCollectionOutput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionOutput) CallActivity(org.eclipse.bpmn2.CallActivity) AdHocAutostart(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart) WaitForCompletion(org.kie.workbench.common.stunner.bpmn.definition.property.task.WaitForCompletion) DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) FontSet(org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet) AbortParent(org.kie.workbench.common.stunner.bpmn.definition.property.task.AbortParent) ViewImpl(org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl) MultipleInstanceExecutionMode(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceExecutionMode) IsCase(org.kie.workbench.common.stunner.bpmn.definition.property.subProcess.IsCase) ReusableSubprocessTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.task.ReusableSubprocessTaskExecutionSet) MultipleInstanceDataOutput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataOutput) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) RectangleDimensionsSet(org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet) Independent(org.kie.workbench.common.stunner.bpmn.definition.property.task.Independent) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) MultipleInstanceCompletionCondition(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCompletionCondition) BackgroundSet(org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet) ReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.ReusableSubprocess) BaseReusableSubprocess(org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess) IsMultipleInstance(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance) MultipleInstanceCollectionInput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionInput) MultipleInstanceDataInput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataInput) IsAsync(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync) CalledElement(org.kie.workbench.common.stunner.bpmn.definition.property.task.CalledElement) Before(org.junit.Before)

Aggregations

ReusableSubprocess (org.kie.workbench.common.stunner.bpmn.definition.ReusableSubprocess)2 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)2 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)2 CalledElement (org.kie.workbench.common.stunner.bpmn.definition.property.task.CalledElement)2 Independent (org.kie.workbench.common.stunner.bpmn.definition.property.task.Independent)2 IsAsync (org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync)2 ReusableSubprocessTaskExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.task.ReusableSubprocessTaskExecutionSet)2 WaitForCompletion (org.kie.workbench.common.stunner.bpmn.definition.property.task.WaitForCompletion)2 CallActivity (org.eclipse.bpmn2.CallActivity)1 Before (org.junit.Before)1 ActivityPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.ActivityPropertyReader)1 BaseReusableSubprocess (org.kie.workbench.common.stunner.bpmn.definition.BaseReusableSubprocess)1 BackgroundSet (org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet)1 RectangleDimensionsSet (org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet)1 FontSet (org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet)1 Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)1 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)1 SLADueDate (org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate)1 IsCase (org.kie.workbench.common.stunner.bpmn.definition.property.subProcess.IsCase)1 AbortParent (org.kie.workbench.common.stunner.bpmn.definition.property.task.AbortParent)1