Discussion:
[jboss-user] [jBPM] - Need help with persistence and initialisation
Thomas Colditz
2013-07-23 07:51:59 UTC
Permalink
Thomas Colditz [https://community.jboss.org/people/fellowtom] created the discussion

"Need help with persistence and initialisation"

To view the discussion, visit: https://community.jboss.org/message/829233#829233

--------------------------------------------------------------
Hi all,

I have some questions wich I cant answer myself. What is the difference when initializing a process instance with Knowledgebuilder/KnowledgeBase/.. or with JBPMHelper and the RuntimeManager? Or better to say, when to use which one?
I just want to use jBPM in my own application. Persistance can be handled first in H2 inmem db. Later it will be handled with other db on a server. But atm I just want to test some process-scenarios. If I setup my process with that knowledgebase/... all events/task will work, but im not able to handle a usertask (cant get it working). If I set it up with JBPMHelper and the RuntimeManger the process always terminates when reaching for example a timer(probably all wait-states). No errors or something. Process just terminates. I think its just some kind of persistence problem, but I cant figure it out.
I'm using jBPM 6.0. The initialization of process is done like in chapter 4 (manual) or in type of JBPMHelper like the given exampleprocess "HumanTaskExample". If I run this example it works. But even if I copy this processfiles (bpmn+java) in own project it wont work.
Can somebody give me a hint?
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/829233#829233]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Thomas Colditz
2013-07-24 05:17:13 UTC
Permalink
Thomas Colditz [https://community.jboss.org/people/fellowtom] created the discussion

"Re: Need help with persistence and initialisation"

To view the discussion, visit: https://community.jboss.org/message/829414#829414

--------------------------------------------------------------
After testing a lot of stuff i was finally able to handle my usertasks the way I wanted. But there is still 1 thing I dont understand. The whole process with different tasks and gateways works fine, but at the moment it reaches a timer, it still just terminates without any error massage. I have no idea why. Timer should be set up fine (even if i set a timerduration directly).

<intermediateCatchEvent id="_14" name="Timer" >
     <timerEventDefinition>
          <timeCycle xsi:type="tFormalExpression">#{timerValue}###0</timeCycle>
     </timerEventDefinition>
</intermediateCatchEvent>


If somebody could explain that behaviour or help me to avoid it, i would be very happy. Thanks

tcolditz
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/829414#829414]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Maciej Swiderski
2013-07-26 08:13:14 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: Need help with persistence and initialisation"

To view the discussion, visit: https://community.jboss.org/message/829934#829934

--------------------------------------------------------------
First of all to get most of the solution you should use RuntimeManager in most of the cases. JBPMHelper is more for test purpose to simplify the setup and manual Kbase creation is the last (and lowest level) approach if you can't use the two mentioned first.

Would be good if you could provide more details what is not working as expected ... but if you already found the way to make it to work that's even better.

When it comes to timers, what you mean process terminate? Does the process instance is aborted or? In general timer is considered as wait state and thus will return the execution to the caller. But will be automatically resumed when timer expires.

HTH
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/829934#829934]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Thomas Colditz
2013-07-29 12:39:09 UTC
Permalink
Thomas Colditz [https://community.jboss.org/people/fellowtom] created the discussion

"Re: Need help with persistence and initialisation"

To view the discussion, visit: https://community.jboss.org/message/830274#830274

--------------------------------------------------------------
Hi Maciej,

thanks for your reply. Since I'm new to BPM I made a lot of mistakes. So I feel pretty ashamed about the mistake I've done. My process went through several timers, gateways and usertasks. After that it reaches a timer. Then the java-program always terminated. I had a
System.exit(0);

implemented from copy-paste somewhere. But to understand the workflow behaviour better. All tasks are handled in the same thread since a wait-state (usertask,timer,signal,receive) is reached?! So my java-main code was not finished since I reached such a wait-state because its the same thread? By reaching the timer my code goes on with execution and programm ended, right?
At least now its working fine and I'm sorry for wasting time with such mistakes.

Thank you very much.

With kind regards,
tcolditz
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/830274#830274]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Loading...