Search in sources :

Example 1 with CaseIdPrefix

use of org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseIdPrefix in project kie-wb-common by kiegroup.

the class BaseRootProcessConverter method convertProcessNode.

private BpmnNode convertProcessNode(String id, Process process) {
    Node<View<D>, Edge> diagramNode = createNode(id);
    D definition = diagramNode.getContent().getDefinition();
    DefinitionsPropertyReader d = delegate.propertyReaderFactory.of(delegate.definitionResolver.getDefinitions());
    ProcessPropertyReader p = delegate.propertyReaderFactory.of(process);
    definition.setDiagramSet(createDiagramSet(process, p, d));
    definition.setCaseManagementSet(new CaseManagementSet(new CaseIdPrefix(p.getCaseIdPrefix()), new CaseRoles(p.getCaseRoles()), new CaseFileVariables(p.getCaseFileVariables())));
    definition.setProcessData(createProcessData(p.getProcessVariables()));
    definition.setAdvancedData(createAdvancedData(p.getGlobalVariables(), p.getMetaDataAttributes()));
    diagramNode.getContent().setBounds(p.getBounds());
    definition.setFontSet(p.getFontSet());
    definition.setBackgroundSet(p.getBackgroundSet());
    return BpmnNode.of(diagramNode, p);
}
Also used : CaseFileVariables(org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseFileVariables) DefinitionsPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.DefinitionsPropertyReader) CaseRoles(org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseRoles) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Edge(org.kie.workbench.common.stunner.core.graph.Edge) ProcessPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.ProcessPropertyReader) CaseManagementSet(org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseManagementSet) CaseIdPrefix(org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseIdPrefix)

Example 2 with CaseIdPrefix

use of org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseIdPrefix in project kie-wb-common by kiegroup.

the class VariableProviderTest method mockRootNode.

private Element mockRootNode(String processVariables, String caseFileVariables) {
    BPMNDiagramImpl rootNode = new BPMNDiagramImpl();
    rootNode.setProcessData(new ProcessData(new ProcessVariables(processVariables)));
    rootNode.setCaseManagementSet((new CaseManagementSet(new CaseIdPrefix(""), new CaseRoles(""), new CaseFileVariables(caseFileVariables))));
    return mockNode(rootNode);
}
Also used : ProcessVariables(org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessVariables) CaseFileVariables(org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseFileVariables) CaseRoles(org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseRoles) BPMNDiagramImpl(org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl) ProcessData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessData) CaseManagementSet(org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseManagementSet) CaseIdPrefix(org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseIdPrefix)

Example 3 with CaseIdPrefix

use of org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseIdPrefix in project kie-wb-common by kiegroup.

the class ProcessPropertyWriterTest method caseIdPrefix.

@Test
public void caseIdPrefix() {
    CaseIdPrefix caseIdPrefix = new CaseIdPrefix("caseIdPrefix");
    p.setCaseIdPrefix(caseIdPrefix);
    String cdata = CustomElement.caseIdPrefix.of(p.getProcess()).get();
    assertThat("caseIdPrefix").isEqualTo(CustomElement.caseIdPrefix.stripCData(cdata));
}
Also used : CaseIdPrefix(org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseIdPrefix) Test(org.junit.Test)

Example 4 with CaseIdPrefix

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

Aggregations

CaseIdPrefix (org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseIdPrefix)4 CaseFileVariables (org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseFileVariables)3 CaseRoles (org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseRoles)3 CaseManagementSet (org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseManagementSet)2 Process (org.eclipse.bpmn2.Process)1 Test (org.junit.Test)1 ProcessPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ProcessPropertyWriter)1 DefinitionsPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.DefinitionsPropertyReader)1 ProcessPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.ProcessPropertyReader)1 BPMNDiagram (org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagram)1 BPMNDiagramImpl (org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl)1 BaseDiagramSet (org.kie.workbench.common.stunner.bpmn.definition.property.diagram.BaseDiagramSet)1 BaseProcessData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.BaseProcessData)1 BaseRootProcessAdvancedData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.BaseRootProcessAdvancedData)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 Edge (org.kie.workbench.common.stunner.core.graph.Edge)1 View (org.kie.workbench.common.stunner.core.graph.content.view.View)1