Search in sources :

Example 11 with ProcessPropertyWriter

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

the class RootProcessConverter method convertProcess.

public ProcessPropertyWriter convertProcess() {
    ProcessPropertyWriter processRoot = convertProcessNode(context.firstNode());
    delegate.convertChildNodes(processRoot, context);
    delegate.convertEdges(processRoot, context);
    delegate.postConvertChildNodes(processRoot, context);
    return processRoot;
}
Also used : ProcessPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ProcessPropertyWriter)

Example 12 with ProcessPropertyWriter

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

the class DefinitionsConverter method toDefinitions.

public Definitions toDefinitions() {
    Definitions definitions = bpmn2.createDefinitions();
    DefinitionsPropertyWriter p = propertyWriterFactory.of(definitions);
    ProcessPropertyWriter pp = processConverter.convertProcess();
    Node<Definition<BPMNDiagram>, ?> node = converterFactory.context.firstNode();
    BPMNDiagram definition = node.getContent().getDefinition();
    BaseDiagramSet diagramSet = definition.getDiagramSet();
    p.setExporter("jBPM Process Modeler");
    p.setExporterVersion("2.0");
    p.setProcess(pp.getProcess());
    p.setDiagram(pp.getBpmnDiagram());
    p.setRelationship(pp.getRelationship());
    p.setWSDLImports(diagramSet.getImports().getValue().getWSDLImports());
    p.addAllRootElements(pp.getItemDefinitions());
    p.addAllRootElements(pp.getRootElements());
    p.addAllRootElements(pp.getInterfaces());
    return definitions;
}
Also used : BPMNDiagram(org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagram) BaseDiagramSet(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.BaseDiagramSet) Definitions(org.eclipse.bpmn2.Definitions) DefinitionsPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.DefinitionsPropertyWriter) Definition(org.kie.workbench.common.stunner.core.graph.content.definition.Definition) ProcessPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ProcessPropertyWriter)

Aggregations

ProcessPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ProcessPropertyWriter)12 Test (org.junit.Test)8 BPMNDiagramImpl (org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl)3 Process (org.eclipse.bpmn2.Process)2 ConverterFactory (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.ConverterFactory)2 DefinitionsBuildingContext (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.DefinitionsBuildingContext)2 PropertyWriterFactory (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriterFactory)2 BPMNDiagram (org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagram)2 EmbeddedSubprocess (org.kie.workbench.common.stunner.bpmn.definition.EmbeddedSubprocess)2 IntermediateErrorEventCatching (org.kie.workbench.common.stunner.bpmn.definition.IntermediateErrorEventCatching)2 BaseDiagramSet (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.BaseDiagramSet)2 Dock (org.kie.workbench.common.stunner.core.graph.content.relationship.Dock)2 EdgeImpl (org.kie.workbench.common.stunner.core.graph.impl.EdgeImpl)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 ArgumentMatchers.anyObject (org.mockito.ArgumentMatchers.anyObject)2 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Optional (java.util.Optional)1