*
* @param transitionName the jBPM transition name, or null
*/
public void endTask(String transitionName)
{
TaskInstance task = org.jboss.seam.bpm.TaskInstance.instance();
if (task==null)
{
throw new IllegalStateException( "no task instance associated with context" );
}
if ( transitionName==null || "".equals(transitionName) )
{
transitionName = Transition.instance().getName();
}
if (transitionName==null)
{
task.end();
}
else
{
task.end(transitionName);
}
setTaskId(null); //TODO: do I really need this???!
Events.instance().raiseEvent("org.jboss.seam.endTask." + task.getTask().getName());
ProcessInstance process = org.jboss.seam.bpm.ProcessInstance.instance();
if ( process.hasEnded() )
{
Events.instance().raiseEvent("org.jboss.seam.endProcess." + process.getProcessDefinition().getName());
}