use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ProcessPropertyWriter in project kie-wb-common by kiegroup.
the class ProcessConverterDelegateTest method convertDockedEdges.
@Test
public void convertDockedEdges() {
GraphNodeStoreImpl nodes = new GraphNodeStoreImpl();
GraphImpl g = new GraphImpl("g", nodes);
NodeImpl<Object> root = new NodeImpl<>("root");
BPMNDiagramImpl bpmnDiagram = new BPMNDiagramImpl();
root.setContent(new ViewImpl<>(bpmnDiagram, Bounds.create()));
g.addNode(root);
NodeImpl<Object> n = new NodeImpl<>("n");
EmbeddedSubprocess subProcessNode = new EmbeddedSubprocess();
n.setContent(new ViewImpl<>(subProcessNode, Bounds.create()));
g.addNode(n);
NodeImpl<Object> e = new NodeImpl<>("e");
IntermediateErrorEventCatching intermediateErrorEventCatching = new IntermediateErrorEventCatching();
e.setContent(new ViewImpl<>(intermediateErrorEventCatching, Bounds.create()));
g.addNode(e);
EdgeImpl<Object> edge = new EdgeImpl<>("edge");
Dock dock = new Dock();
edge.setContent(dock);
n.getOutEdges().add(edge);
edge.setSourceNode(n);
e.getInEdges().add(edge);
edge.setTargetNode(e);
DefinitionsBuildingContext ctx = new DefinitionsBuildingContext(g);
PropertyWriterFactory pwFactory = new PropertyWriterFactory();
ConverterFactory factory = new ConverterFactory(ctx, pwFactory);
MyProcessConverter abstractProcessConverter = new MyProcessConverter(factory);
ProcessPropertyWriter p = pwFactory.of(bpmn2.createProcess());
assertThatCode(() -> {
abstractProcessConverter.convertChildNodes(p, ctx);
abstractProcessConverter.convertEdges(p, ctx);
}).doesNotThrowAnyException();
}
use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ProcessPropertyWriter in project kie-wb-common by kiegroup.
the class RootProcessConverterTest method convertProcessWithGlobalVariables.
@Test
public void convertProcessWithGlobalVariables() {
final ProcessPropertyWriter propertyWriter = converter.convertProcess();
verify(propertyWriter).setGlobalVariables(any(GlobalVariables.class));
}
use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ProcessPropertyWriter in project kie-wb-common by kiegroup.
the class RootProcessConverterTest method convertProcessWithCaseProperties.
@Test
public void convertProcessWithCaseProperties() {
final ProcessPropertyWriter propertyWriter = converter.convertProcess();
verify(propertyWriter).setCaseIdPrefix(caseIdPrefix);
verify(propertyWriter).setCaseRoles(caseRoles);
verify(propertyWriter).setCaseFileVariables(caseFileVariables);
}
use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ProcessPropertyWriter in project kie-wb-common by kiegroup.
the class RootProcessConverterTest method convertProcessWithExecutable.
@Test
public void convertProcessWithExecutable() {
final ProcessPropertyWriter propertyWriter = converter.convertProcess();
verify(propertyWriter).setExecutable(anyBoolean());
}
use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ProcessPropertyWriter 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