-
1. Re: ProcessInstance in Token is null?
aguizar Aug 9, 2005 4:02 AM (in response to camunda)I'm having trouble reproducing your problem. Can you provide a code snippet which shows what you are trying to do?
The only reason I can imagine right now for the null process instance is that you had originally created the token with the default constructor, which does not set any field. -
2. Re: ProcessInstance in Token is null?
camunda Aug 10, 2005 3:24 PM (in response to camunda)OK, I have found the problem and my mistake:
1.) I start a new process with a transition
2.) In this first transition a decision occurs
3.) The decision want to get a variable from the process, but doe not use the executionContext but a own class, which retrieves the token from the database (but the new process instance is not comitted yet).
That causes the problem!
No we work with the executionContext in the Decision and everything works fine!
Thanks for your effort! -
3. Re: ProcessInstance in Token is null?
camunda Aug 11, 2005 3:30 AM (in response to camunda)OK, we still have a problem:
With session.getGraphSession().loadToken(tokenId) the processInstance in the token is always null! This is the root token of a process instance.
Even with session.getGraphSession().loadProcessInstance(tokenId).getRootToken()
the processInstance in this token is null!
Our process is started with:
ProcessInstance pi = session.getGraphSession().findLatestProcessDefinition(processName).createProcessInstance();
pi.getContextInstance().addVariables(params);
pi.getRootToken().signal(transitionName);
return pi.getRootToken().getId();
Any hints to that? -
4. Re: ProcessInstance in Token is null?
camunda Aug 11, 2005 3:38 AM (in response to camunda)OK, solved!
We also have to close the jBpmSession after every commit to work properly...
Strange, but I don't know hibernate so good (we use JDO ;-)), I think it makes sense in some way... -
5. Re: ProcessInstance in Token is null?
aguizar Aug 12, 2005 2:52 AM (in response to camunda)I see a connection between your problems and Daniel's problem with stale data in variable instances.
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3889539#3889539
So, the only way things work properly for you is using the session for a single transaction? If you start a new transaction and load a token, its process instace is null? -
6. Re: ProcessInstance in Token is null?
camunda Aug 12, 2005 2:58 AM (in response to camunda)Yepp, right.