/** * Assign the TaskInstance with the id passed * in the request parameter named "taskId" to * the given actor id. * * @param actorId the jBPM actor id * @return a null outcome only if the task was not found */ @Transactional public String assign(String actorId) { TaskInstance taskInstance = getTaskInstance(); if (taskInstance!=null) { taskInstance.setActorId(actorId); return "taskAssigned"; } else { return null; } }
/** * Unassign the TaskInstance with the id passed * in the request parameter named "taskId" from * the actor to which it is assigned, and return * it to the pool it came from. * * @return a null outcome only if the task was not found */ @Transactional public String unassign() { TaskInstance taskInstance = getTaskInstance(); if (taskInstance!=null) { taskInstance.setActorId(null); return "taskUnassigned"; } else { return null; } }
/** * Assign the TaskInstance with the id passed * in the request parameter named "taskId" to * the current actor. * * @see Actor * @return a null outcome only if the task was not found */ @Transactional public String assignToCurrentActor() { Actor actor = Actor.instance(); if ( actor.getId()==null ) { throw new IllegalStateException("no current actor id defined"); } TaskInstance taskInstance = getTaskInstance(); if (taskInstance!=null) { taskInstance.setActorId( actor.getId() ); return "taskAssignedToActor"; } else { return null; } }