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"); } }
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); }
setName(otherElement.getName()); setExecutable(otherElement.isExecutable()); setDocumentation(otherElement.getDocumentation());
setName(otherElement.getName()); setExecutable(otherElement.isExecutable()); setDocumentation(otherElement.getDocumentation());
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.setName(process.getName()); currentProcessDefinition.setCategory(bpmnParse.getBpmnModel().getTargetNamespace()); currentProcessDefinition.setDescription(process.getDocumentation());