Search in sources :

Example 1 with AdHocSubProcessPropertyReader

use of org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.AdHocSubProcessPropertyReader in project kie-wb-common by kiegroup.

the class BaseSubProcessConverter method convertAdHocSubProcess.

private BpmnNode convertAdHocSubProcess(org.eclipse.bpmn2.AdHocSubProcess subProcess) {
    Node<View<A>, Edge> node = createNode(subProcess.getId());
    A definition = node.getContent().getDefinition();
    AdHocSubProcessPropertyReader p = delegate.propertyReaderFactory.of(subProcess);
    definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    definition.setProcessData(createProcessData(p.getProcessVariables()));
    definition.setExecutionSet(createAdHocSubprocessTaskExecutionSet(p));
    definition.setSimulationSet(p.getSimulationSet());
    definition.setAdvancedData(new AdvancedData(p.getMetaDataAttributes()));
    node.getContent().setBounds(p.getBounds());
    definition.setDimensionsSet(p.getRectangleDimensionsSet());
    definition.setFontSet(p.getFontSet());
    definition.setBackgroundSet(p.getBackgroundSet());
    return BpmnNode.of(node, p);
}
Also used : AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) AdHocSubProcessPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.AdHocSubProcessPropertyReader) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Edge(org.kie.workbench.common.stunner.core.graph.Edge) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)

Example 2 with AdHocSubProcessPropertyReader

use of org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.AdHocSubProcessPropertyReader in project kie-wb-common by kiegroup.

the class SubProcessConverter method convertAdHocSubProcess.

private BpmnNode convertAdHocSubProcess(org.eclipse.bpmn2.AdHocSubProcess subProcess) {
    Node<View<AdHocSubprocess>, Edge> node = factoryManager.newNode(subProcess.getId(), AdHocSubprocess.class);
    AdHocSubprocess definition = node.getContent().getDefinition();
    AdHocSubProcessPropertyReader p = propertyReaderFactory.of(subProcess);
    definition.setGeneral(new BPMNGeneralSet(new Name(subProcess.getName()), new Documentation(p.getDocumentation())));
    definition.setProcessData(new ProcessData(new ProcessVariables(p.getProcessVariables())));
    definition.setExecutionSet(new AdHocSubprocessTaskExecutionSet(new AdHocCompletionCondition(p.getAdHocCompletionCondition()), new AdHocOrdering(p.getAdHocOrdering()), new OnEntryAction(p.getOnEntryAction()), new OnExitAction(p.getOnExitAction())));
    definition.setSimulationSet(p.getSimulationSet());
    node.getContent().setBounds(p.getBounds());
    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) AdHocSubprocessTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocSubprocessTaskExecutionSet) AdHocSubprocess(org.kie.workbench.common.stunner.bpmn.definition.AdHocSubprocess) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) OnExitAction(org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction) OnEntryAction(org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction) View(org.kie.workbench.common.stunner.core.graph.content.view.View) ProcessData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessData) AdHocCompletionCondition(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocCompletionCondition) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) ProcessVariables(org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessVariables) AdHocOrdering(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering) AdHocSubProcessPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.AdHocSubProcessPropertyReader) Edge(org.kie.workbench.common.stunner.core.graph.Edge)

Example 3 with AdHocSubProcessPropertyReader

use of org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.AdHocSubProcessPropertyReader in project kie-wb-common by kiegroup.

the class SubProcessConverterTest method testCreateAdHocSubprocessTaskExecutionSet.

@Test
public void testCreateAdHocSubprocessTaskExecutionSet() {
    AdHocSubProcess adHocSubProcess = mock(AdHocSubProcess.class);
    when(adHocSubProcess.getCompletionCondition()).thenReturn(mock(FormalExpression.class));
    when(adHocSubProcess.getOrdering()).thenReturn(AdHocOrdering.SEQUENTIAL);
    assertTrue(AdHocSubprocessTaskExecutionSet.class.isInstance(tested.createAdHocSubprocessTaskExecutionSet(new AdHocSubProcessPropertyReader(adHocSubProcess, definitionResolver.getDiagram(), definitionResolver))));
}
Also used : AdHocSubProcess(org.eclipse.bpmn2.AdHocSubProcess) AdHocSubprocessTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocSubprocessTaskExecutionSet) FormalExpression(org.eclipse.bpmn2.FormalExpression) AdHocSubProcessPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.AdHocSubProcessPropertyReader) Test(org.junit.Test)

Aggregations

AdHocSubProcessPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.AdHocSubProcessPropertyReader)3 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)2 Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)2 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)2 AdHocSubprocessTaskExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocSubprocessTaskExecutionSet)2 Edge (org.kie.workbench.common.stunner.core.graph.Edge)2 View (org.kie.workbench.common.stunner.core.graph.content.view.View)2 AdHocSubProcess (org.eclipse.bpmn2.AdHocSubProcess)1 FormalExpression (org.eclipse.bpmn2.FormalExpression)1 Test (org.junit.Test)1 AdHocSubprocess (org.kie.workbench.common.stunner.bpmn.definition.AdHocSubprocess)1 AdHocCompletionCondition (org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocCompletionCondition)1 AdHocOrdering (org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocOrdering)1 OnEntryAction (org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction)1 OnExitAction (org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction)1 AdvancedData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData)1 ProcessData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessData)1 ProcessVariables (org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessVariables)1