Search in sources :

Example 16 with BPMNDiagram

use of org.eclipse.bpmn2.di.BPMNDiagram in project kie-wb-common by kiegroup.

the class CallActivityPropertyReaderTest method setUp.

@Before
public void setUp() {
    Definitions definitions = bpmn2.createDefinitions();
    definitions.getRootElements().add(bpmn2.createProcess());
    BPMNDiagram bpmnDiagram = di.createBPMNDiagram();
    bpmnDiagram.setPlane(di.createBPMNPlane());
    definitions.getDiagrams().add(bpmnDiagram);
    definitionResolver = new DefinitionResolver(definitions, Collections.emptyList());
}
Also used : BPMNDiagram(org.eclipse.bpmn2.di.BPMNDiagram) DefinitionResolver(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.DefinitionResolver) Definitions(org.eclipse.bpmn2.Definitions) Before(org.junit.Before)

Example 17 with BPMNDiagram

use of org.eclipse.bpmn2.di.BPMNDiagram in project kie-wb-common by kiegroup.

the class ProcessPropertyReaderTest method setUp.

@Before
public void setUp() {
    definitions = bpmn2.createDefinitions();
    process = bpmn2.createProcess();
    definitions.getRootElements().add(process);
    BPMNDiagram bpmnDiagram = di.createBPMNDiagram();
    bpmnDiagram.setPlane(di.createBPMNPlane());
    definitions.getDiagrams().add(bpmnDiagram);
    definitionResolver = new DefinitionResolver(definitions, Collections.emptyList());
    tested = new ProcessPropertyReader(process, definitionResolver.getDiagram(), definitionResolver.getShape(process.getId()), definitionResolver.getResolutionFactor());
}
Also used : BPMNDiagram(org.eclipse.bpmn2.di.BPMNDiagram) DefinitionResolver(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.DefinitionResolver) Before(org.junit.Before)

Example 18 with BPMNDiagram

use of org.eclipse.bpmn2.di.BPMNDiagram in project kie-wb-common by kiegroup.

the class PropertyReaderFactoryTest method setUp.

@Before
public void setUp() {
    definitions = bpmn2.createDefinitions();
    process = bpmn2.createProcess();
    definitions.getRootElements().add(process);
    BPMNDiagram bpmnDiagram = di.createBPMNDiagram();
    bpmnDiagram.setPlane(di.createBPMNPlane());
    definitions.getDiagrams().add(bpmnDiagram);
    definitionResolver = new DefinitionResolver(definitions, Collections.emptyList());
    tested = new PropertyReaderFactory(definitionResolver);
}
Also used : BPMNDiagram(org.eclipse.bpmn2.di.BPMNDiagram) DefinitionResolver(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.DefinitionResolver) Before(org.junit.Before)

Example 19 with BPMNDiagram

use of org.eclipse.bpmn2.di.BPMNDiagram in project kie-wb-common by kiegroup.

the class RootProcessConverter method convertProcessNode.

private ProcessPropertyWriter convertProcessNode(Node<Definition<BPMNDiagram>, ?> node) {
    Process process = bpmn2.createProcess();
    BPMNDiagram definition = node.getContent().getDefinition();
    ProcessPropertyWriter p = propertyWriterFactory.of(process);
    BaseDiagramSet diagramSet = definition.getDiagramSet();
    p.setName(replaceIllegalCharsAttribute(diagramSet.getName().getValue()));
    p.setDocumentation(diagramSet.getDocumentation().getValue());
    p.setId(replaceIllegalCharsAttribute(diagramSet.getId().getValue()));
    p.setPackage(diagramSet.getPackageProperty().getValue());
    p.setType(diagramSet.getProcessType().getValue());
    p.setVersion(diagramSet.getVersion().getValue());
    p.setAdHoc(diagramSet.getAdHoc().getValue());
    p.setDescription(diagramSet.getProcessInstanceDescription().getValue());
    p.setDefaultImports(diagramSet.getImports().getValue().getDefaultImports());
    p.setExecutable(diagramSet.getExecutable().getValue());
    p.setSlaDueDate(diagramSet.getSlaDueDate());
    BaseProcessData processData = definition.getProcessData();
    p.setProcessVariables(processData.getProcessVariables());
    BaseRootProcessAdvancedData advancedData = definition.getAdvancedData();
    p.setGlobalVariables(advancedData.getGlobalVariables());
    p.setMetaData(advancedData.getMetaDataAttributes());
    // Case Management
    final CaseIdPrefix caseIdPrefix = definition.getCaseManagementSet().getCaseIdPrefix();
    p.setCaseIdPrefix(caseIdPrefix);
    final CaseRoles caseRoles = definition.getCaseManagementSet().getCaseRoles();
    p.setCaseRoles(caseRoles);
    final CaseFileVariables caseFileVariables = definition.getCaseManagementSet().getCaseFileVariables();
    p.setCaseFileVariables(caseFileVariables);
    return p;
}
Also used : BPMNDiagram(org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagram) CaseFileVariables(org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseFileVariables) BaseDiagramSet(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.BaseDiagramSet) CaseRoles(org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseRoles) BaseProcessData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.BaseProcessData) Process(org.eclipse.bpmn2.Process) ProcessPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ProcessPropertyWriter) BaseRootProcessAdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.BaseRootProcessAdvancedData) CaseIdPrefix(org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseIdPrefix)

Example 20 with BPMNDiagram

use of org.eclipse.bpmn2.di.BPMNDiagram 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

BPMNDiagram (org.eclipse.bpmn2.di.BPMNDiagram)16 Before (org.junit.Before)12 DefinitionResolver (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.DefinitionResolver)11 Definitions (org.eclipse.bpmn2.Definitions)8 RootElement (org.eclipse.bpmn2.RootElement)8 FlowElement (org.eclipse.bpmn2.FlowElement)6 BPMNDiagram (org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagram)6 Test (org.junit.Test)5 BPMNDiagramImpl (org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl)5 ArrayList (java.util.ArrayList)4 ItemAwareElement (org.eclipse.bpmn2.ItemAwareElement)4 TypedFactoryManager (org.kie.workbench.common.stunner.bpmn.backend.converters.TypedFactoryManager)4 Element (org.kie.workbench.common.stunner.core.graph.Element)4 View (org.kie.workbench.common.stunner.core.graph.content.view.View)4 Process (org.eclipse.bpmn2.Process)3 BPMNPlane (org.eclipse.bpmn2.di.BPMNPlane)3 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)3 Graph (org.kie.workbench.common.stunner.core.graph.Graph)3 AdHocSubProcess (org.eclipse.bpmn2.AdHocSubProcess)2 Artifact (org.eclipse.bpmn2.Artifact)2