-
1. Re: Problem persisting tasks
tangomannn Jan 6, 2009 3:11 PM (in response to tangomannn)Does the TaskNode.addTask(task) method works well?
I'm printing my process definition to check if is well builded and everything appears well excepts the tasks that don't appear!
Any idea why they don't appear? Probably this is why is not working programmatically and yes with the xml defintion
I'm using JpdlXmlWriter.toString(pd); . I know is deprecated, but is just to check if the process definition defined programmatically was well builded
thanks -
2. Re: Problem persisting tasks
kukeltje Jan 6, 2009 4:18 PM (in response to tangomannn)why do you create a new context in the actionhandler?
and with TaskNode.addTask you change the processdefinition, not adding additional tasks to the running instance -
3. Re: Problem persisting tasks
tangomannn Jan 6, 2009 4:46 PM (in response to tangomannn)why do you create a new context in the actionhandler?
Because I'm a newby and believe me that documentation does not help.
How is should I do in my example?and with TaskNode.addTask you change the processdefinition, not adding additional tasks to the running instance
I 'm doing TaskNode.addTask Before create the process instance, when I building the process definition.
Thanks for your help kukeltje!, any help or clue is welcome -
4. Re: Problem persisting tasks
kukeltje Jan 6, 2009 4:51 PM (in response to tangomannn)Nowhere in the docs, examples etc.. it is mentioned that you should create a context... None of the examples you can find in the source do this.... I've not heard anybody do it... so I *don't* think the docs are the problem here..
andI had to use
will probably disappear if you remove the additional context
jbpmContext.getSession().save(newTaskInstance);
and not jbpmContext.save( ..); because if I use this one on the close it gives me "object references an unsaved transient instance" exceptionI'm doing TaskNode.addTask Before create the process instance, when I building the process definition.
But that is something totally different from what you do on your initial post -
5. Re: Problem persisting tasks
kukeltje Jan 6, 2009 4:52 PM (in response to tangomannn)In addition to my first statement... that is about creating contexts IN an actionhandler
-
6. Re: Problem persisting tasks
tangomannn Jan 7, 2009 1:24 PM (in response to tangomannn)I tried what you suggested me, but it did not work.
I finally could solve my problems with transient object exception, saving explicitly through Hibernate Session:
jbpmContext.getSession().save(executionContext.getTaskMgmtInstance());
or
jbpmContext.getSession().save(contextInstance);
depending on the case.
I don't know if this is right, but at least worked. I saw one post from a guy who had the same problem when deployed the process programmatically, so that's why I post my solution
Thanks!
Fernando. -
7. Re: Problem persisting tasks
kukeltje Jan 7, 2009 10:33 PM (in response to tangomannn)thanks for reporting back...