public static org.jbpm.taskmgmt.exe.TaskInstance instance() { if ( !Contexts.isConversationContextActive() || !BusinessProcess.instance().hasCurrentTask() ) return null; //so we don't start a txn return (org.jbpm.taskmgmt.exe.TaskInstance) Component.getInstance(TaskInstance.class, ScopeType.STATELESS); }
/** * Check that the task currently associated with the conversation * exists and has not ended. * * @return true if the task exists and was not ended */ public boolean validateTask() { if ( !hasCurrentTask() ) { taskNotFound(taskId); return false; } else if ( org.jboss.seam.bpm.TaskInstance.instance().hasEnded() ) { taskEnded(taskId); return false; } else { return true; } }