Java Code Examples for org.activiti.engine.impl.bpmn.parser.BpmnParse#setCurrentProcessDefinition()
The following examples show how to use
org.activiti.engine.impl.bpmn.parser.BpmnParse#setCurrentProcessDefinition() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProcessParseHandler.java From activiti6-boot2 with Apache License 2.0 | 5 votes |
protected ProcessDefinitionEntity transformProcess(BpmnParse bpmnParse, Process process) { ProcessDefinitionEntity currentProcessDefinition = Context.getCommandContext().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; }
Example 2
Source File: ProcessParseHandler.java From flowable-engine with Apache License 2.0 | 4 votes |
protected ProcessDefinitionEntity transformProcess(BpmnParse bpmnParse, Process process) { ProcessDefinitionEntity currentProcessDefinition = new ProcessDefinitionEntity(); 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.setProperty(PROPERTYNAME_DOCUMENTATION, process.getDocumentation()); // Kept for backwards compatibility. See ACT-1020 currentProcessDefinition.setTaskDefinitions(new HashMap<>()); currentProcessDefinition.setDeploymentId(bpmnParse.getDeployment().getId()); createEventListeners(bpmnParse, process.getEventListeners()); createExecutionListenersOnScope(bpmnParse, process.getExecutionListeners(), currentProcessDefinition); ExpressionManager expressionManager = bpmnParse.getExpressionManager(); for (String candidateUser : process.getCandidateStarterUsers()) { currentProcessDefinition.addCandidateStarterUserIdExpression(expressionManager.createExpression(candidateUser)); } for (String candidateGroup : process.getCandidateStarterGroups()) { currentProcessDefinition.addCandidateStarterGroupIdExpression(expressionManager.createExpression(candidateGroup)); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("Parsing process {}", currentProcessDefinition.getKey()); } bpmnParse.setCurrentScope(currentProcessDefinition); bpmnParse.processFlowElements(process.getFlowElements()); processArtifacts(bpmnParse, process.getArtifacts(), currentProcessDefinition); // parse out any data objects from the template in order to set up the necessary process variables Map<String, Object> variables = processDataObjects(bpmnParse, process.getDataObjects(), currentProcessDefinition); if (null != currentProcessDefinition.getVariables()) { currentProcessDefinition.getVariables().putAll(variables); } else { currentProcessDefinition.setVariables(variables); } bpmnParse.removeCurrentScope(); return currentProcessDefinition; }