use of org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseRoles 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);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseRoles 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);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseRoles in project kie-wb-common by kiegroup.
the class ProcessPropertyWriterTest method caseRoles.
@Test
public void caseRoles() {
CaseRoles caseRole = new CaseRoles("role");
p.setCaseRoles(caseRole);
String cdata = CustomElement.caseRole.of(p.getProcess()).get();
assertThat("role").isEqualTo(CustomElement.caseRole.stripCData(cdata));
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.cm.CaseRoles 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;
}
Aggregations