Search in sources :

Example 11 with BPMNViewDefinition

use of org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition 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)

Aggregations

BPMNViewDefinition (org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition)11 Test (org.junit.Test)5 StartNoneEvent (org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent)4 View (org.kie.workbench.common.stunner.core.graph.content.view.View)4 DefinitionsBuildingContext (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.DefinitionsBuildingContext)3 AdHocSubprocess (org.kie.workbench.common.stunner.bpmn.definition.AdHocSubprocess)3 ShapeView (org.kie.workbench.common.stunner.core.client.shape.view.ShapeView)3 ConverterFactory (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.ConverterFactory)2 Factories.bpmn2 (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.Factories.bpmn2)2 AdHocSubProcessPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.AdHocSubProcessPropertyWriter)2 PropertyWriterFactory (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriterFactory)2 SubProcessPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.SubProcessPropertyWriter)2 BPMNDiagramImpl (org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl)2 BaseAdHocSubprocess (org.kie.workbench.common.stunner.bpmn.definition.BaseAdHocSubprocess)2 BusinessRuleTask (org.kie.workbench.common.stunner.bpmn.definition.BusinessRuleTask)2 EmbeddedSubprocess (org.kie.workbench.common.stunner.bpmn.definition.EmbeddedSubprocess)2 Node (org.kie.workbench.common.stunner.core.graph.Node)2 GraphImpl (org.kie.workbench.common.stunner.core.graph.impl.GraphImpl)2 NodeImpl (org.kie.workbench.common.stunner.core.graph.impl.NodeImpl)2 GraphNodeStoreImpl (org.kie.workbench.common.stunner.core.graph.store.GraphNodeStoreImpl)2