Hi all,
is it compulsoty to call SchedulerSession.cancelTimersForProcessInstance() .
I am stuck with one problem on this cancelTimerForProcessInstance.
the problem is like
i have a process like this :
startstate->approvalstate1->approvalstate2-end but here i am able to go up to approvalstate1 and also i am able to end the approvalstate2 but when i call
jbpmSession.getGraphSession().saveProcessInstance(processInstance);
it gives the problem.
Please guide me i am making mistake . i am stuck on this problem
the code i am pasting here.
****************************************************
public void completeWorkItem(long taskInstanceId, Map map)throws WFSrvException
{
log.info("in completeWorkItem ");
long strprocesInstId = 0;
LoggingInstance loggingInstance = null;
String strNxtActr ="";
JbpmSession jbpmSession = jbpmSessionFactory.openJbpmSession();
jbpmSession.beginTransaction();
TaskInstance taskInstance = jbpmSession.getTaskMgmtSession().loadTaskInstance(taskInstanceId);
ProcessInstance processInstance = taskInstance.getTaskMgmtInstance().getProcessInstance();
strprocesInstId = processInstance.getId();
if(map!=null){
processInstance.getContextInstance().setVariable("variable",map); taskInstance.end(); }if (processInstance.hasEnded()) {
log.info("in completeWorkItem()....step3.1 else....");
log.info("The process has finished.");
} else{
log.info("till now the process has not finished");
}
loggingInstance = processInstance.getLoggingInstance();
List assignmentLogs = loggingInstance.getLogs(TaskAssignLog.class);
log.info("hi ...process instance : -->"+processInstance.getId());
jbpmSession.getGraphSession().saveProcessInstance(processInstance);
jbpmSession.commitTransaction();
jbpmSession.close();
log.info("after commit in wfeng");
}
****************************************************
waiting for reply.
Thanks in Advance,
Susant