Search in sources :

Example 6 with SubProcessPropertyWriter

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

the class SubProcessConverterTest method testConvertEmbeddedSubprocess.

@Test
public void testConvertEmbeddedSubprocess() {
    final EmbeddedSubprocess definition = new EmbeddedSubprocess();
    setBaseSubprocessExecutionSetValues(definition.getExecutionSet());
    final View<EmbeddedSubprocess> view = new ViewImpl<>(definition, Bounds.create());
    final Node<View<EmbeddedSubprocess>, ?> node = new NodeImpl<>(UUID.randomUUID().toString());
    node.setContent(view);
    SubProcessPropertyWriter writer = tested.convertEmbeddedSubprocessNode(node);
    assertBaseSubprocessExecutionSet(writer);
}
Also used : NodeImpl(org.kie.workbench.common.stunner.core.graph.impl.NodeImpl) EmbeddedSubprocess(org.kie.workbench.common.stunner.bpmn.definition.EmbeddedSubprocess) ViewImpl(org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl) View(org.kie.workbench.common.stunner.core.graph.content.view.View) SubProcessPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.SubProcessPropertyWriter) AdHocSubProcessPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.AdHocSubProcessPropertyWriter) Test(org.junit.Test)

Example 7 with SubProcessPropertyWriter

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

the class SubProcessConverterTest method testConvertMultipleIntanceSubprocess.

@Test
public void testConvertMultipleIntanceSubprocess() {
    final MultipleInstanceSubprocess definition = new MultipleInstanceSubprocess();
    setBaseSubprocessExecutionSetValues(definition.getExecutionSet());
    final View<MultipleInstanceSubprocess> view = new ViewImpl<>(definition, Bounds.create());
    final Node<View<MultipleInstanceSubprocess>, ?> node = new NodeImpl<>(UUID.randomUUID().toString());
    node.setContent(view);
    SubProcessPropertyWriter writer = tested.convertMultipleInstanceSubprocessNode(node);
    assertBaseSubprocessExecutionSet(writer);
}
Also used : NodeImpl(org.kie.workbench.common.stunner.core.graph.impl.NodeImpl) ViewImpl(org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl) View(org.kie.workbench.common.stunner.core.graph.content.view.View) SubProcessPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.SubProcessPropertyWriter) AdHocSubProcessPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.AdHocSubProcessPropertyWriter) MultipleInstanceSubprocess(org.kie.workbench.common.stunner.bpmn.definition.MultipleInstanceSubprocess) Test(org.junit.Test)

Example 8 with SubProcessPropertyWriter

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

the class SubProcessConverterTest method testConvertEventSubprocess.

@Test
public void testConvertEventSubprocess() {
    final EventSubprocess definition = new EventSubprocess();
    setBaseSubprocessExecutionSetValues(definition.getExecutionSet());
    final View<EventSubprocess> view = new ViewImpl<>(definition, Bounds.create());
    final Node<View<EventSubprocess>, ?> node = new NodeImpl<>(UUID.randomUUID().toString());
    node.setContent(view);
    SubProcessPropertyWriter writer = tested.convertEventSubprocessNode(node);
    assertBaseSubprocessExecutionSet(writer);
}
Also used : NodeImpl(org.kie.workbench.common.stunner.core.graph.impl.NodeImpl) EventSubprocess(org.kie.workbench.common.stunner.bpmn.definition.EventSubprocess) ViewImpl(org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl) View(org.kie.workbench.common.stunner.core.graph.content.view.View) SubProcessPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.SubProcessPropertyWriter) AdHocSubProcessPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.AdHocSubProcessPropertyWriter) Test(org.junit.Test)

Example 9 with SubProcessPropertyWriter

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

the class SubProcessConverter method convertSubProcess.

public Result<SubProcessPropertyWriter> convertSubProcess(Node<View<? extends BPMNViewDefinition>, ?> node) {
    Result<SubProcessPropertyWriter> processRootResult = NodeMatch.fromNode(BaseSubprocess.class, SubProcessPropertyWriter.class).when(EmbeddedSubprocess.class, this::convertEmbeddedSubprocessNode).when(EventSubprocess.class, this::convertEventSubprocessNode).when(BaseAdHocSubprocess.class, this::convertAdHocSubprocessNode).when(MultipleInstanceSubprocess.class, this::convertMultipleInstanceSubprocessNode).ignore(BPMNViewDefinition.class).apply(node);
    if (processRootResult.isIgnored()) {
        return processRootResult;
    }
    DefinitionsBuildingContext subContext = context.withRootNode(node);
    SubProcessPropertyWriter processRoot = processRootResult.value();
    super.convertChildNodes(processRoot, subContext);
    super.convertEdges(processRoot, subContext);
    return processRootResult;
}
Also used : BaseAdHocSubprocess(org.kie.workbench.common.stunner.bpmn.definition.BaseAdHocSubprocess) EmbeddedSubprocess(org.kie.workbench.common.stunner.bpmn.definition.EmbeddedSubprocess) DefinitionsBuildingContext(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.DefinitionsBuildingContext) BPMNViewDefinition(org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition) SubProcessPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.SubProcessPropertyWriter) AdHocSubProcessPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.AdHocSubProcessPropertyWriter) MultipleInstanceSubProcessPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.MultipleInstanceSubProcessPropertyWriter)

Example 10 with SubProcessPropertyWriter

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

the class SubProcessConverter method convertEmbeddedSubprocessNode.

protected SubProcessPropertyWriter convertEmbeddedSubprocessNode(Node<View<EmbeddedSubprocess>, ?> n) {
    SubProcess process = bpmn2.createSubProcess();
    process.setId(n.getUUID());
    SubProcessPropertyWriter p = propertyWriterFactory.of(process);
    EmbeddedSubprocess definition = n.getContent().getDefinition();
    BPMNGeneralSet general = definition.getGeneral();
    p.setName(general.getName().getValue());
    p.setDocumentation(general.getDocumentation().getValue());
    EmbeddedSubprocessExecutionSet executionSet = definition.getExecutionSet();
    p.setOnEntryAction(executionSet.getOnEntryAction());
    p.setOnExitAction(executionSet.getOnExitAction());
    p.setAsync(executionSet.getIsAsync().getValue());
    p.setSlaDueDate(executionSet.getSlaDueDate());
    ProcessData processData = definition.getProcessData();
    p.setProcessVariables(processData.getProcessVariables());
    p.setSimulationSet(definition.getSimulationSet());
    p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
    p.setAbsoluteBounds(n);
    return p;
}
Also used : SubProcess(org.eclipse.bpmn2.SubProcess) EmbeddedSubprocessExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.subProcess.execution.EmbeddedSubprocessExecutionSet) EmbeddedSubprocess(org.kie.workbench.common.stunner.bpmn.definition.EmbeddedSubprocess) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) SubProcessPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.SubProcessPropertyWriter) AdHocSubProcessPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.AdHocSubProcessPropertyWriter) MultipleInstanceSubProcessPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.MultipleInstanceSubProcessPropertyWriter) BaseProcessData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.BaseProcessData) ProcessData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessData)

Aggregations

AdHocSubProcessPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.AdHocSubProcessPropertyWriter)10 SubProcessPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.SubProcessPropertyWriter)10 Test (org.junit.Test)6 View (org.kie.workbench.common.stunner.core.graph.content.view.View)6 ViewImpl (org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl)6 NodeImpl (org.kie.workbench.common.stunner.core.graph.impl.NodeImpl)6 BaseAdHocSubprocess (org.kie.workbench.common.stunner.bpmn.definition.BaseAdHocSubprocess)4 MultipleInstanceSubProcessPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.MultipleInstanceSubProcessPropertyWriter)3 AdHocSubprocess (org.kie.workbench.common.stunner.bpmn.definition.AdHocSubprocess)3 EmbeddedSubprocess (org.kie.workbench.common.stunner.bpmn.definition.EmbeddedSubprocess)3 EventSubprocess (org.kie.workbench.common.stunner.bpmn.definition.EventSubprocess)3 SubProcess (org.eclipse.bpmn2.SubProcess)2 DefinitionsBuildingContext (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.DefinitionsBuildingContext)2 BPMNViewDefinition (org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition)2 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)2 AdHocAutostart (org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart)2 BaseProcessData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.BaseProcessData)2 ProcessData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessData)2 AdHocSubProcess (org.eclipse.bpmn2.AdHocSubProcess)1 BPMNShape (org.eclipse.bpmn2.di.BPMNShape)1