/** @see Execution#createProcessInstance() */ public ExecutionImpl createExecution() { return createExecution((String)null); }
public Execution createExecution(Execution parent) { return ((ExecutionImpl)parent).createExecution(); }
public Execution createExecution(String name, Execution parent) { return ((ExecutionImpl)parent).createExecution(name); }
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()); } }
ExecutionImpl concurrentExecution = concurrentRoot.createExecution(transition.getName()); concurrentExecution.setActivity(activity); concurrentExecution.setState(Execution.STATE_ACTIVE_CONCURRENT);
/** * Joins all the incoming executions currently waiting at the gateway. * * @return An execution that can be used to leave the gateway (one outgoing sequence flow) * or to create child executions on (fork behaviour when multiple outgoing sequence flow). */ protected ExecutionImpl join(ExecutionImpl execution) { Activity activity = execution.getActivity(); ExecutionImpl concurrentRoot = execution.getParent(); if (concurrentRoot == null) { return execution; } List<ExecutionImpl> joinedExecutions = getJoinedExecutions(concurrentRoot, activity); endJoinedExecutions(joinedExecutions); ExecutionImpl outgoingExecution = null; if (concurrentRoot.getExecutions().size() == 0) { outgoingExecution = concurrentRoot; outgoingExecution.setState(Execution.STATE_ACTIVE_ROOT); } else { outgoingExecution = concurrentRoot.createExecution(); outgoingExecution.setState(Execution.STATE_ACTIVE_CONCURRENT); } outgoingExecution.setActivity(activity); return outgoingExecution; }
public ExecutionImpl createScope(CompositeElementImpl scope) { ExecutionImpl child = createExecution(scope.getName()); // copy the current state from the child execution to the parent execution child.setNode(getNode()); child.setTransition(getTransition()); child.setPropagation(getPropagation()); child.setTransitionOrigin(getTransitionOrigin()); child.setPreviousTransition(getPreviousTransition()); child.setPreviousNode(getPreviousNode()); child.initializeVariables(scope, this); child.initializeTimers(scope); return child; }