public Process getProcessById(String id) { for (Process process : processes) { if (process.getId().equals(id)) { return process; } } return null; }
public Process getProcessById(String id) { for (Process process : processes) { if (process.getId().equals(id)) { return process; } } return null; }
@Override protected void executeParse(BpmnParse bpmnParse, Process process) { if (!process.isExecutable()) { LOGGER.info("Ignoring non-executable process with id='{}'. Set the attribute isExecutable=\"true\" to deploy this process.", process.getId()); } else { bpmnParse.getProcessDefinitions().add(transformProcess(bpmnParse, process)); } }
@Override protected void executeParse(BpmnParse bpmnParse, Process process) { if (!process.isExecutable()) { LOGGER.info("Ignoring non-executable process with id='{}'. Set the attribute isExecutable=\"true\" to deploy this process.", process.getId()); } else { bpmnParse.getProcessDefinitions().add(transformProcess(bpmnParse, process)); } }
protected String getProcessDefinitionKey(DelegateExecution execution) { Process process = ProcessDefinitionUtil.getProcess(execution.getProcessDefinitionId()); return process.getId(); }
public Process getProcess(String poolRef) { for (Process process : processes) { boolean foundPool = false; for (Pool pool : pools) { if (StringUtils.isNotEmpty(pool.getProcessRef()) && pool.getProcessRef().equalsIgnoreCase(process.getId())) { if (poolRef != null) { if (pool.getId().equalsIgnoreCase(poolRef)) { foundPool = true; } } else { foundPool = true; } } } if (poolRef == null && !foundPool) { return process; } else if (poolRef != null && foundPool) { return process; } } return null; }
public Process getProcess(String poolRef) { for (Process process : processes) { boolean foundPool = false; for (Pool pool : pools) { if (StringUtils.isNotEmpty(pool.getProcessRef()) && pool.getProcessRef().equalsIgnoreCase(process.getId())) { if (poolRef != null) { if (pool.getId().equalsIgnoreCase(poolRef)) { foundPool = true; } } else { foundPool = true; } } } if (poolRef == null && !foundPool) { return process; } else if (poolRef != null && foundPool) { return process; } } return null; }
protected void handleProcessConstraints(BpmnModel bpmnModel, Process process, List<ValidationError> errors) { if (process.getId() != null && process.getId().length() > Constraints.PROCESS_DEFINITION_ID_MAX_LENGTH) { addError(errors, Problems.PROCESS_DEFINITION_ID_TOO_LONG, process, "The id of the process definition must not contain more than " + Constraints.PROCESS_DEFINITION_ID_MAX_LENGTH + " characters"); } if (process.getName() != null && process.getName().length() > Constraints.PROCESS_DEFINITION_NAME_MAX_LENGTH) { addError(errors, Problems.PROCESS_DEFINITION_NAME_TOO_LONG, process, "The name of the process definition must not contain more than " + Constraints.PROCESS_DEFINITION_NAME_MAX_LENGTH + " characters"); } if (process.getDocumentation() != null && process.getDocumentation().length() > Constraints.PROCESS_DEFINITION_DOCUMENTATION_MAX_LENGTH) { addError(errors, Problems.PROCESS_DEFINITION_DOCUMENTATION_TOO_LONG, process, "The documentation of the process definition must not contain more than " + Constraints.PROCESS_DEFINITION_DOCUMENTATION_MAX_LENGTH + " characters"); } }
public static void writeLanes(Process process, XMLStreamWriter xtw) throws Exception { if (!process.getLanes().isEmpty()) { xtw.writeStartElement(ELEMENT_LANESET); xtw.writeAttribute(ATTRIBUTE_ID, "laneSet_" + process.getId()); for (Lane lane : process.getLanes()) { xtw.writeStartElement(ELEMENT_LANE); xtw.writeAttribute(ATTRIBUTE_ID, lane.getId()); if (StringUtils.isNotEmpty(lane.getName())) { xtw.writeAttribute(ATTRIBUTE_NAME, lane.getName()); } boolean didWriteExtensionStartElement = BpmnXMLUtil.writeExtensionElements(lane, false, xtw); if (didWriteExtensionStartElement) { xtw.writeEndElement(); } for (String flowNodeRef : lane.getFlowReferences()) { xtw.writeStartElement(ELEMENT_FLOWNODE_REF); xtw.writeCharacters(flowNodeRef); xtw.writeEndElement(); } xtw.writeEndElement(); } xtw.writeEndElement(); } } }
protected FlowElement resolveFlowElementFromBpmnModel(BpmnModel bpmnModel, String activityId) { FlowElement flowElement = bpmnModel.getFlowElement(activityId); if (flowElement == null) { throw new FlowableException("Cannot find activity '" + activityId + "' in process definition with id '" + bpmnModel.getMainProcess().getId() + "'"); } return flowElement; } //-- Move container preparation section end
xtw.writeAttribute(ATTRIBUTE_ID, process.getId());
protected void addError(List<ValidationError> validationErrors, String problem, Process process, String id, String description) { ValidationError error = new ValidationError(); if (process != null) { error.setProcessDefinitionId(process.getId()); error.setProcessDefinitionName(process.getName()); } error.setProblem(problem); error.setDefaultDescription(description); error.setActivityId(id); addError(validationErrors, error); }
ProcessDefinitionEntity processDefinition = getProcessDefinition(process.getId()); if (processDefinition != null) { processDefinition.setGraphicalNotationDefined(true);
ProcessDefinitionEntity processDefinition = getProcessDefinition(process.getId()); if (processDefinition != null) { processDefinition.setGraphicalNotationDefined(true);
protected void sendProcessInstanceCompletedEvent(ExecutionEntity execution, FlowElement terminateEndEvent) { Process process = ProcessDefinitionUtil.getProcess(execution.getProcessDefinitionId()); CommandContextUtil.getProcessEngineConfiguration().getListenerNotificationHelper() .executeExecutionListeners(process, execution, ExecutionListener.EVENTNAME_END); if (CommandContextUtil.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) { if ((execution.isProcessInstanceType() && execution.getSuperExecutionId() == null) || (execution.getParentId() == null && execution.getSuperExecutionId() != null)) { // This event should only be fired if terminate end event is part of the process definition for the process instance execution, // otherwise a regular cancel event of the process instance will be fired (see above). boolean fireEvent = true; if (!terminateAll) { Process processForExecution = ProcessDefinitionUtil.getProcess(execution.getProcessDefinitionId()); Process processForTerminateEndEvent = getProcessForTerminateEndEvent(terminateEndEvent); fireEvent = processForExecution.getId().equals(processForTerminateEndEvent.getId()); } if (fireEvent) { CommandContextUtil.getProcessEngineConfiguration().getEventDispatcher() .dispatchEvent(FlowableEventBuilder.createTerminateEvent(execution, terminateEndEvent)); } } } }
String processId = process.getId(); if (!isEqualToCurrentLocalizationValue(locale, processId, "name", name, infoNode)) { dynamicBpmnService.changeLocalizationName(locale, processId, name, infoNode);
String processId = process.getId(); if (!isEqualToCurrentLocalizationValue(locale, processId, "name", name, infoNode)) { dynamicBpmnService.changeLocalizationName(locale, processId, name, infoNode);
protected ProcessDefinitionEntity transformProcess(BpmnParse bpmnParse, Process process) { ProcessDefinitionEntity currentProcessDefinition = CommandContextUtil.getProcessDefinitionEntityManager().create(); bpmnParse.setCurrentProcessDefinition(currentProcessDefinition); /* * Mapping object model - bpmn xml: processDefinition.id -> generated by activiti engine processDefinition.key -> bpmn id (required) processDefinition.name -> bpmn name (optional) */ currentProcessDefinition.setKey(process.getId()); currentProcessDefinition.setName(process.getName()); currentProcessDefinition.setCategory(bpmnParse.getBpmnModel().getTargetNamespace()); currentProcessDefinition.setDescription(process.getDocumentation()); currentProcessDefinition.setDeploymentId(bpmnParse.getDeployment().getId()); if (bpmnParse.getDeployment().getEngineVersion() != null) { currentProcessDefinition.setEngineVersion(bpmnParse.getDeployment().getEngineVersion()); } createEventListeners(bpmnParse, process.getEventListeners()); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Parsing process {}", currentProcessDefinition.getKey()); } bpmnParse.processFlowElements(process.getFlowElements()); processArtifacts(bpmnParse, process.getArtifacts()); return currentProcessDefinition; }
protected void addError(List<ValidationError> validationErrors, String problem, Process process, BaseElement baseElement, String description, boolean isWarning) { ValidationError error = new ValidationError(); error.setWarning(isWarning); if (process != null) { error.setProcessDefinitionId(process.getId()); error.setProcessDefinitionName(process.getName()); } if (baseElement != null) { error.setXmlLineNumber(baseElement.getXmlRowNumber()); error.setXmlColumnNumber(baseElement.getXmlColumnNumber()); } error.setProblem(problem); error.setDefaultDescription(description); if (baseElement instanceof FlowElement) { FlowElement flowElement = (FlowElement) baseElement; error.setActivityId(flowElement.getId()); error.setActivityName(flowElement.getName()); } addError(validationErrors, error); }
currentProcessDefinition.setKey(process.getId()); currentProcessDefinition.setName(process.getName()); currentProcessDefinition.setCategory(bpmnParse.getBpmnModel().getTargetNamespace());