/** * Section 14.3.2 of the BPMN 2.0 specification. * * The Inclusive Gateway is activated if * - At least one incoming sequence flow has at least one Token and * - for each empty incoming sequence flow, there is no Token in the graph anywhere * upstream of this sequence flow, i.e., there is no directed path (formed by Sequence Flow) * from a Token to this sequence flow unless * - the path visits the inclusive gateway or * - the path visits a node that has a directed path to a non-empty incoming sequence * flow of the inclusive gateway. */ protected boolean isComplete(ExecutionImpl incomingExecution) { String currentActivityId = incomingExecution.getActivityName(); // id is stored in the name attribute Collection<ExecutionImpl> allExecutions = incomingExecution.getProcessInstance().getExecutions(); BpmnProcessDefinition processDefinition = (BpmnProcessDefinition) incomingExecution.getProcessDefinition(); for (ExecutionImpl execution : allExecutions) { if (incomingExecution.getParent().equals(execution.getParent())) { String activityId = execution.getActivityName(); // id is stored in the name attribute if (activityId != null && !currentActivityId.equals(activityId)) { if (processDefinition.isReachable(activityId, currentActivityId)) { return false; } } } } return true; }
forkingTransitions.add(defaultSeqFlow); if (LOG.isDebugEnabled()) { LOG.debug("Selected default sequence flow for " + execution.getActivityName()); execution.getActivityName() + " and no default sequenceFlow was speficied"); throw new JbpmException("No outgoing sequence flow found for " + execution.getActivityName());
public void execute(ExecutionImpl execution) { List<Activity> startActivities = findStartActivities(execution); if (!startActivities.isEmpty()) { ExecutionImpl parent = execution.createScope(execution.getActivity()); for (Activity startActivity: startActivities) { parent.setState(Execution.STATE_INACTIVE_CONCURRENT_ROOT); ExecutionImpl concurrentExecution = parent.createExecution(); concurrentExecution.setState(Execution.STATE_ACTIVE_CONCURRENT); concurrentExecution.execute(startActivity); } } else { throw new JbpmException("Could not find start activity for the sub-process " + execution.getActivityName()); } }
LOG.debug("Proceeding from execution in " + execution.getActivityName());
task.setName(taskDefinition.getName()); } else { task.setName(execution.getActivityName());