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<BPMNDiagramImpl>, ?> node) {
Process process = bpmn2.createProcess();
ProcessPropertyWriter p = propertyWriterFactory.of(process);
BPMNDiagramImpl definition = node.getContent().getDefinition();
DiagramSet diagramSet = definition.getDiagramSet();
p.setName(diagramSet.getName().getValue());
p.setDocumentation(diagramSet.getDocumentation().getValue());
process.setId(diagramSet.getId().getValue());
p.setPackage(diagramSet.getPackageProperty().getValue());
p.setVersion(diagramSet.getVersion().getValue());
p.setAdHoc(diagramSet.getAdHoc().getValue());
p.setDescription(diagramSet.getProcessInstanceDescription().getValue());
p.setExecutable(diagramSet.getExecutable().getValue());
ProcessData processData = definition.getProcessData();
p.setProcessVariables(processData.getProcessVariables());
return p;
}
use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ProcessPropertyWriter in project kie-wb-common by kiegroup.
the class RootProcessConverterTest method convertProcessWithImports.
@Test
public void convertProcessWithImports() {
final ProcessPropertyWriter propertyWriter = converter.convertProcess();
verify(propertyWriter).setDefaultImports(anyListOf(DefaultImport.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 convertProcessWithSlaDueDate.
@Test
public void convertProcessWithSlaDueDate() {
final ProcessPropertyWriter propertyWriter = converter.convertProcess();
verify(propertyWriter).setSlaDueDate(any(SLADueDate.class));
}
use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ProcessPropertyWriter in project kie-wb-common by kiegroup.
the class ProcessPropertyReaderTest method getProcessType.
@Test
public void getProcessType() {
ProcessPropertyWriter writer = new ProcessPropertyWriter(bpmn2.createProcess(), null, null);
writer.setType(ProcessType.PRIVATE.getName());
tested = new ProcessPropertyReader(writer.getProcess(), definitionResolver.getDiagram(), definitionResolver.getShape(process.getId()), definitionResolver.getResolutionFactor());
assertEquals(tested.getProcessType(), ProcessType.PRIVATE.getName());
writer.setType(ProcessType.PUBLIC.getName());
tested = new ProcessPropertyReader(writer.getProcess(), definitionResolver.getDiagram(), definitionResolver.getShape(process.getId()), definitionResolver.getResolutionFactor());
assertEquals(tested.getProcessType(), ProcessType.PUBLIC.getName());
writer.setType(ProcessType.NONE.getName());
tested = new ProcessPropertyReader(writer.getProcess(), definitionResolver.getDiagram(), definitionResolver.getShape(process.getId()), definitionResolver.getResolutionFactor());
assertEquals(tested.getProcessType(), ProcessType.NONE.getName());
}
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