-
1. Re: How to get Node name for a TaskInstance?
kukeltje May 16, 2007 3:22 PM (in response to lachelt)I would have tried doing it the same way. Can you check in the database if it is correctly stored? In the meantime I'll look at the testcases if there is one for this situation with and without db.
-
2. Re: How to get Node name for a TaskInstance?
lachelt May 16, 2007 3:24 PM (in response to lachelt)
Oh... could this be because this task is in my start-state?
If that is the case, then how can I tell that, and find out which "node" in the process the task is for? I see that the Task has a member "startState" which is also null at this time... so that doesn't really help me.
To answer the question from Ronald, i'm using hypersonic DB. So I don't know how to check that. Is there a JDBC driver I can use to talk to that DB (say from eclipse)?
Thanks,
-Jon -
3. Re: How to get Node name for a TaskInstance?
kukeltje May 16, 2007 3:29 PM (in response to lachelt)AFAIK, This could happen if the context has not been saved yet, but I'm not sure.
Regarding the HSQLDB, if it is running in jboss, see the end of http://wiki.jboss.org/wiki/Wiki.jsp?page=JbpmGettingStarted -
4. Re: How to get Node name for a TaskInstance?
lachelt May 16, 2007 3:30 PM (in response to lachelt)sorry about my stupid question about the jdbc driver. i just found it.
-
5. Re: How to get Node name for a TaskInstance?
kukeltje May 16, 2007 3:35 PM (in response to lachelt):-)
Still then... if it runs in jbpm and has no tcp configured, you will not be able to access it from eclipse, dbvisualizer or whatever if the appserver is running. -
6. Re: How to get Node name for a TaskInstance?
lachelt May 16, 2007 3:48 PM (in response to lachelt)Here is the code I used to start the process instance:
ProcessInstance instanceForUpdate = jbpmContext.newProcessInstanceForUpdate(processDefinition.getName()); instanceForUpdate.getTaskMgmtInstance().createStartTaskInstance(); jbpmContext.save(instanceForUpdate); jbpmContext.close();
(I just added the save(), which I didn't think I needed in this case... and it didn't help).
Then at some later time (with a new jbpmContext), I've gotten the task instance as I noted in the initial post.
Does that help? The way I'm starting the workflow seemed a little odd, but seems to work. Was there some other way I'm supposed to do it?
Thanks,
-Jon -
7. Re: How to get Node name for a TaskInstance?
lachelt May 17, 2007 5:48 PM (in response to lachelt)OK. I've confirmed that the TaskInstance is getting persisted. In the DB I can see the Task Instance and it has the proper key in the TASK_ column. The JBPM_TASK table has an entry with a matching ID_.
So I do this in my code:TaskInstance taskInstance = jbpmContext.loadTaskInstance(instanceId); Task task = taskInstance.getTask(); TaskNode node = task.getTaskNode();
The Task object gets loaded properly, but the TaskNode always comes back null.
Any ideas?