Here is the code:
If I uncomment the last line, I get the exception. But I found in jira that it's not necessary to save the process instance since it's already been created.
public void saveProcessInstance(long processInstanceId, Map variables, String transitionName) { ProcessInstance pi = graphSession.loadProcessInstance(processInstanceId); Token token = pi.getRootToken(); pi.getContextInstance().addVariables(variables); TaskInstance taskInstance = (TaskInstance) taskMgmtSession.findTaskInstancesByToken(token.getId()).get(0); if (transitionName != null) taskInstance.end(transitionName); else taskInstance.end(); // generates an exception // graphSession.saveProcessInstance(pi); }
By the way, the described bug is solved in jbpm 3.0.2 :-)
http://jira.jboss.com/jira/browse/JBPM-432