use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.BaseDiagramSet 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;
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.BaseDiagramSet in project kie-wb-common by kiegroup.
the class DefinitionsConverter method toDefinitions.
public Definitions toDefinitions() {
Definitions definitions = bpmn2.createDefinitions();
DefinitionsPropertyWriter p = propertyWriterFactory.of(definitions);
ProcessPropertyWriter pp = processConverter.convertProcess();
Node<Definition<BPMNDiagram>, ?> node = converterFactory.context.firstNode();
BPMNDiagram definition = node.getContent().getDefinition();
BaseDiagramSet diagramSet = definition.getDiagramSet();
p.setExporter("jBPM Process Modeler");
p.setExporterVersion("2.0");
p.setProcess(pp.getProcess());
p.setDiagram(pp.getBpmnDiagram());
p.setRelationship(pp.getRelationship());
p.setWSDLImports(diagramSet.getImports().getValue().getWSDLImports());
p.addAllRootElements(pp.getItemDefinitions());
p.addAllRootElements(pp.getRootElements());
p.addAllRootElements(pp.getInterfaces());
return definitions;
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.BaseDiagramSet in project kie-wb-common by kiegroup.
the class BPMNProjectDiagramFactoryImpl method updateDiagramProperties.
@Override
protected void updateDiagramProperties(final String name, final Node<Definition<BPMNDiagram>, ?> diagramNode, final ProjectMetadata metadata) {
// Set kie related properties for the current project.
final BPMNDiagram diagram = diagramNode.getContent().getDefinition();
final BaseDiagramSet diagramSet = diagram.getDiagramSet();
final String id = diagramSet.getId().getValue();
if (id == null || id.isEmpty()) {
final String projectName = null != metadata.getModuleName() ? metadata.getModuleName() + "." : "";
diagramSet.getId().setValue(createValidId(projectName) + createValidId(name));
}
final String p = diagramSet.getPackageProperty().getValue();
if (p == null || p.isEmpty()) {
final Package metadataPackage = metadata.getProjectPackage();
final String value = metadataPackage == null ? org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Package.DEFAULT_PACKAGE : metadata.getProjectPackage().getPackageName();
diagramSet.getPackageProperty().setValue(value);
}
final String diagramName = diagramSet.getName().getValue();
if (null == diagramName || diagramName.isEmpty()) {
diagramSet.getName().setValue(name);
}
super.updateDiagramProperties(name, diagramNode, metadata);
}
Aggregations