String transitionName;
transitionName = JsfHelper.getParameter("transitionName");
ProcessInstance processInstance = null;
JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
if (this.taskInstanceId > 0) {
TaskMgmtSession taskMgmtSession = jbpmContext.getTaskMgmtSession();
TaskInstance taskInstance = taskMgmtSession.loadTaskInstance(this.taskInstanceId);
if (transitionName.equals("")) {
taskInstance.end();
} else {
taskInstance.end(transitionName);
}
processInstance = taskInstance.getToken().getProcessInstance();
} else if (this.tokenInstanceId > 0) {
GraphSession graphSession = jbpmContext.getGraphSession();
Token token = graphSession.loadToken(this.tokenInstanceId);
if (transitionName.equals("")) {
token.signal();
} else {
token.signal(transitionName);
}
processInstance = token.getProcessInstance();
}
jbpmContext.save(processInstance);
this.initializeTasksList(processInstance);
this.initializeTokensList(processInstance);
return "inspectInstance";