Java Code Examples for org.activiti.engine.impl.bpmn.parser.BpmnParse#processFlowElements()
The following examples show how to use
org.activiti.engine.impl.bpmn.parser.BpmnParse#processFlowElements() .
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: SubProcessParseHandler.java From activiti6-boot2 with Apache License 2.0 | 6 votes |
protected void executeParse(BpmnParse bpmnParse, SubProcess subProcess) { subProcess.setBehavior(bpmnParse.getActivityBehaviorFactory().createSubprocessActivityBehavior(subProcess)); bpmnParse.processFlowElements(subProcess.getFlowElements()); processArtifacts(bpmnParse, subProcess.getArtifacts()); // no data objects for event subprocesses /* * if (!(subProcess instanceof EventSubProcess)) { // parse out any data objects from the template in order to set up the necessary process variables Map<String, Object> variables = * processDataObjects(bpmnParse, subProcess.getDataObjects(), activity); activity.setVariables(variables); } * * bpmnParse.removeCurrentScope(); bpmnParse.removeCurrentSubProcess(); * * if (subProcess.getIoSpecification() != null) { IOSpecification ioSpecification = createIOSpecification(bpmnParse, subProcess.getIoSpecification()); activity.setIoSpecification(ioSpecification); * } */ }
Example 2
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 3
Source File: SubProcessParseHandler.java From flowable-engine with Apache License 2.0 | 5 votes |
@Override protected void executeParse(BpmnParse bpmnParse, SubProcess subProcess) { ActivityImpl activity = createActivityOnScope(bpmnParse, subProcess, BpmnXMLConstants.ELEMENT_SUBPROCESS, bpmnParse.getCurrentScope()); activity.setAsync(subProcess.isAsynchronous()); activity.setExclusive(!subProcess.isNotExclusive()); boolean triggeredByEvent = false; if (subProcess instanceof EventSubProcess) { triggeredByEvent = true; } activity.setProperty("triggeredByEvent", triggeredByEvent); // event subprocesses are not scopes activity.setScope(!triggeredByEvent); activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createSubprocActivityBehavior(subProcess)); bpmnParse.setCurrentScope(activity); bpmnParse.setCurrentSubProcess(subProcess); bpmnParse.processFlowElements(subProcess.getFlowElements()); processArtifacts(bpmnParse, subProcess.getArtifacts(), activity); // no data objects for event subprocesses if (!(subProcess instanceof EventSubProcess)) { // parse out any data objects from the template in order to set up the necessary process variables Map<String, Object> variables = processDataObjects(bpmnParse, subProcess.getDataObjects(), activity); activity.setVariables(variables); } bpmnParse.removeCurrentScope(); bpmnParse.removeCurrentSubProcess(); }
Example 4
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; }
Example 5
Source File: TransactionParseHandler.java From flowable-engine with Apache License 2.0 | 4 votes |
@Override protected void executeParse(BpmnParse bpmnParse, Transaction transaction) { ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, transaction, BpmnXMLConstants.ELEMENT_TRANSACTION); activity.setAsync(transaction.isAsynchronous()); activity.setExclusive(!transaction.isNotExclusive()); activity.setScope(true); activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createTransactionActivityBehavior(transaction)); bpmnParse.setCurrentScope(activity); bpmnParse.processFlowElements(transaction.getFlowElements()); processArtifacts(bpmnParse, transaction.getArtifacts(), activity); bpmnParse.removeCurrentScope(); }
Example 6
Source File: AdhocSubProcessParseHandler.java From activiti6-boot2 with Apache License 2.0 | 3 votes |
protected void executeParse(BpmnParse bpmnParse, SubProcess subProcess) { subProcess.setBehavior(bpmnParse.getActivityBehaviorFactory().createAdhocSubprocessActivityBehavior(subProcess)); bpmnParse.processFlowElements(subProcess.getFlowElements()); processArtifacts(bpmnParse, subProcess.getArtifacts()); }
Example 7
Source File: TransactionParseHandler.java From activiti6-boot2 with Apache License 2.0 | 3 votes |
protected void executeParse(BpmnParse bpmnParse, Transaction transaction) { transaction.setBehavior(bpmnParse.getActivityBehaviorFactory().createTransactionActivityBehavior(transaction)); bpmnParse.processFlowElements(transaction.getFlowElements()); processArtifacts(bpmnParse, transaction.getArtifacts()); }