@Override public void end(Transition transition) { // Force assignment of task if transition is taken, but no owner has yet // been assigned if (actorId == null) { actorId = AuthenticationUtil.getFullyAuthenticatedUser(); } // Set task properties on completion of task // NOTE: Set properties first, so they're available during the // submission of // task variables to the process context Map<QName, Serializable> taskProperties = new HashMap<QName, Serializable>(); Transition outcome = (transition == null) ? token.getNode().getDefaultLeavingTransition() : transition; if (outcome != null) { taskProperties.put(WorkflowModel.PROP_OUTCOME, outcome.getName()); } taskProperties.put(WorkflowModel.PROP_STATUS, "Completed"); getJBPMEngine().setTaskProperties(this, taskProperties); // perform transition super.end(transition); if (getTask().getStartState() != null) { // if ending a start task, push start task properties to process // context, if not // already done getJBPMEngine().setDefaultWorkflowProperties(this); // set task description getJBPMEngine().setDefaultStartTaskDescription(this); } }
protected void removeImplicitTransitions(Activity activity) { Transition leaving = activity.getDefaultLeavingTransition(); Transition arriving = activity.getDefaultArrivingTransition(); activity.removeArrivingTransition(arriving); activity.removeLeavingTransition(leaving); Activity successor = (Activity) leaving.getTo(); successor.removeArrivingTransition(leaving); successor.addArrivingTransition(arriving); }