public void execute() { // Reset any previous DI information bpmnModel.getLocationMap().clear(); bpmnModel.getFlowLocationMap().clear(); // Generate DI for each process for (Process process : bpmnModel.getProcesses()) { layout(process); // Operations that can only be done after all elements have received // DI translateNestedSubprocesses(process); } }
Map<String, GraphicInfo> labelLocations = new HashMap<String, GraphicInfo>(); locations.putAll(model.getLocationMap()); flowLocations.putAll(model.getFlowLocationMap()); labelLocations.putAll(model.getLabelLocationMap()); mainModel.getLocationMap().put(elementId, locations.get(elementId));
if (bpmnModel.getLocationMap() != null) { allGraphicInfos.addAll(bpmnModel.getLocationMap().values());
subModel.getLocationMap().put(elementId, locations.get(elementId));
xtw.writeAttribute(ATTRIBUTE_ID, "BPMNPlane_" + processId); for (String elementId : model.getLocationMap().keySet()) {
if (!tempModel.getFlowLocationMap().isEmpty() || !tempModel.getLocationMap().isEmpty()) { BPMNDIExport.writeBPMNDI(tempModel, xtw);
protected void translateNestedSubprocessElements(SubProcess subProcess) { GraphicInfo subProcessGraphicInfo = bpmnModel.getLocationMap().get(subProcess.getId()); double subProcessX = subProcessGraphicInfo.getX(); double subProcessY = subProcessGraphicInfo.getY(); List<SubProcess> nestedSubProcesses = new ArrayList<SubProcess>(); for (FlowElement flowElement : subProcess.getFlowElements()) { if (flowElement instanceof SequenceFlow) { List<GraphicInfo> graphicInfos = bpmnModel.getFlowLocationMap().get(flowElement.getId()); for (GraphicInfo graphicInfo : graphicInfos) { graphicInfo.setX(graphicInfo.getX() + subProcessX + subProcessMargin); graphicInfo.setY(graphicInfo.getY() + subProcessY + subProcessMargin); } } else if (flowElement instanceof DataObject == false) { // Regular element GraphicInfo graphicInfo = bpmnModel.getLocationMap().get(flowElement.getId()); graphicInfo.setX(graphicInfo.getX() + subProcessX + subProcessMargin); graphicInfo.setY(graphicInfo.getY() + subProcessY + subProcessMargin); } if (flowElement instanceof SubProcess) { nestedSubProcesses.add((SubProcess) flowElement); } } // Continue for next level of nested subprocesses for (SubProcess nestedSubProcess : nestedSubProcesses) { translateNestedSubprocessElements(nestedSubProcess); } }
if (!bpmnModel.getLocationMap().isEmpty()) { for (String bpmnReference : bpmnModel.getLocationMap().keySet()) { if (bpmnModel.getFlowElement(bpmnReference) == null) {
@Override public void validate(BpmnModel bpmnModel, List<ValidationError> errors) { if (!bpmnModel.getLocationMap().isEmpty()) { for (String bpmnReference : bpmnModel.getLocationMap().keySet()) { if (bpmnModel.getFlowElement(bpmnReference) == null) {
double maxX = 0.0; double maxY = 0.0; for (GraphicInfo flowInfo : model.getLocationMap().values()) { if ((flowInfo.getX() + flowInfo.getWidth()) > maxX) { maxX = flowInfo.getX() + flowInfo.getWidth();
public void execute() { // Reset any previous DI information bpmnModel.getLocationMap().clear(); bpmnModel.getFlowLocationMap().clear(); // Generate DI for each process for (Process process : bpmnModel.getProcesses()) { layout(process); } }
Map<String, GraphicInfo> labelLocations = new HashMap<String, GraphicInfo>(); locations.putAll(model.getLocationMap()); flowLocations.putAll(model.getFlowLocationMap()); labelLocations.putAll(model.getLabelLocationMap()); mainModel.getLocationMap().put(elementId, locations.get(elementId));
subModel.getLocationMap().put(elementId, locations.get(elementId));
public void processDI() { if (bpmnModel.getLocationMap().size() > 0) { for (String bpmnReference : bpmnModel.getLocationMap().keySet()) { if (bpmnModel.getFlowElement(bpmnReference) == null) { LOGGER.warn("Invalid reference in diagram interchange definition: could not find " + bpmnReference); if (processDefinition != null) { processDefinition.setGraphicalNotationDefined(true); for (String shapeId : bpmnModel.getLocationMap().keySet()) { if (processDefinition.findActivity(shapeId) != null) { createBPMNShape(shapeId, bpmnModel.getGraphicInfo(shapeId), processDefinition);
if (!bpmnModel.getLocationMap().isEmpty()) { for (String bpmnReference : bpmnModel.getLocationMap().keySet()) { if (bpmnModel.getFlowElement(bpmnReference) == null) {
} else { if (bpmnModel.getLocationMap().isEmpty()) { notificationManager.showErrorNotification(Messages.MODEL_IMPORT_INVALID_BPMNDI, i18nManager.getMessage(Messages.MODEL_IMPORT_INVALID_BPMNDI_EXPLANATION));
@Override public void validate(BpmnModel bpmnModel, List<ValidationError> errors) { if (!bpmnModel.getLocationMap().isEmpty()) { for (String bpmnReference : bpmnModel.getLocationMap().keySet()) { if (bpmnModel.getFlowElement(bpmnReference) == null) {
/** * {@inheritDoc} */ public InputStream getWorkflowImage(String workflowInstanceId) { String processInstanceId = createLocalId(workflowInstanceId); ExecutionEntity pi = (ExecutionEntity) runtimeService.createProcessInstanceQuery() .processInstanceId(processInstanceId).singleResult(); // If the process is finished, there is no diagram available if (pi != null) { // Fetch the bpmn model BpmnModel model = repoService.getBpmnModel(pi.getProcessDefinitionId()); if (model != null && model.getLocationMap().size() > 0) { ProcessDiagramGenerator generator = new DefaultProcessDiagramGenerator(); return generator.generateDiagram(model, ActivitiConstants.PROCESS_INSTANCE_IMAGE_FORMAT, runtimeService.getActiveActivityIds(processInstanceId)); } } return null; }
/** * {@inheritDoc} */ public InputStream getWorkflowImage(String workflowInstanceId) { String processInstanceId = createLocalId(workflowInstanceId); ExecutionEntity pi = (ExecutionEntity) runtimeService.createProcessInstanceQuery() .processInstanceId(processInstanceId).singleResult(); // If the process is finished, there is no diagram available if (pi != null) { // Fetch the bpmn model BpmnModel model = repoService.getBpmnModel(pi.getProcessDefinitionId()); if (model != null && model.getLocationMap().size() > 0) { ProcessDiagramGenerator generator = new DefaultProcessDiagramGenerator(); return generator.generateDiagram(model, ActivitiConstants.PROCESS_INSTANCE_IMAGE_FORMAT, runtimeService.getActiveActivityIds(processInstanceId)); } } return null; }
GraphicInfo graphicInfo = bpmnModel.getLocationMap().get(subProcessElement.getId()); graphicInfo.setX(graphicInfo.getX() + translationX); graphicInfo.setY(graphicInfo.getY() + translationY);