Search in sources :

Example 6 with CaseFileVariables

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

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

the class VariableSearchServiceTest method mockBPMNDiagram.

protected BPMNDiagramImpl mockBPMNDiagram(String variables, String caseVariables) {
    BPMNDiagramImpl bpmnDiagram = mock(BPMNDiagramImpl.class);
    ProcessData processData = mockProcessData(variables);
    when(bpmnDiagram.getProcessData()).thenReturn(processData);
    CaseManagementSet caseManagementSet = mock(CaseManagementSet.class);
    CaseFileVariables caseFileVariables = mock(CaseFileVariables.class);
    when(caseManagementSet.getCaseFileVariables()).thenReturn(caseFileVariables);
    when(caseFileVariables.getValue()).thenReturn(caseVariables);
    when(bpmnDiagram.getCaseManagementSet()).thenReturn(caseManagementSet);
    return bpmnDiagram;
}
Also used : CaseFileVariables(org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseFileVariables) 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)

Aggregations

CaseFileVariables (org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseFileVariables)7 CaseManagementSet (org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseManagementSet)4 BPMNDiagram (org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagram)3 CaseIdPrefix (org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseIdPrefix)3 CaseRoles (org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseRoles)3 View (org.kie.workbench.common.stunner.core.graph.content.view.View)3 BPMNDiagramImpl (org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl)2 BaseProcessVariables (org.kie.workbench.common.stunner.bpmn.definition.property.variables.BaseProcessVariables)2 ProcessData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessData)2 Edge (org.kie.workbench.common.stunner.core.graph.Edge)2 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 List (java.util.List)1 Function (java.util.function.Function)1 Predicate (java.util.function.Predicate)1 StreamSupport (java.util.stream.StreamSupport)1 Inject (javax.inject.Inject)1 Process (org.eclipse.bpmn2.Process)1 Test (org.junit.Test)1