5 Replies Latest reply on Dec 19, 2011 4:57 PM by Yu Chai

    Question about using Timer node

    Yu Chai Newbie

      Hi,

       

      I have a test work flow triggered by JMS. When a new JMS comes in, this work flow starts. In my work flow, there's a timer node to put a delay between to task nodes. However, whatever value i put in the Timer node, the subsequent work flow never get resumed after the timer expires. I tested the same work flow in a standard java program it worked though.

       

      I suspect the timer thread cannot return to my message listener thread. Could anyone help? thanks!

       

      Best regards

       

      Yu

        • 1. Re: Question about using Timer node
          Marco Rietveld Novice

          Yu,

           

          Which version of jBPM are you using?

           

          Also, if you're using jBPM 5, what are you doing with the knowledgesession when the timer is waiting?

           

          Thanks,

          Marco

          • 2. Re: Question about using Timer node
            Yu Chai Newbie

            Hi Marco,

             

            I'm using jBPM5.1.

             

            In the work flow, I have a rule node to define the delay time for the timer. After timer expires, I'm doing a soap web service call. So there's nothing sepcial I'm doing with the knowledgesession while the timer is waiting.

             

            I also did a test work flow in which a timer sits in between two simple script task nodes. When I started it in a simple java app, it worked well. However when i put it in my project, which runs in JBoss and triggers the work flow after a jms comes in, the work flow cannot be resumed after the timer expires.

             

            Thanks and regards

             

            Yu

            • 3. Re: Question about using Timer node
              Yu Chai Newbie

              Hi all,

               

              Any more comment on this? I'm using Seam2.2.0 and the knowledge session is created from JPAKnowledgeService. I tried to not use JPA to create the session but the timer still didn't fire.

               

              Is there any configuration in particular that I need to do for jBPM timer to run in seam?

               

              Best regards

               

              Yu

              • 4. Re: Question about using Timer node
                Marco Rietveld Novice

                Yu,

                 

                There are two things I can think of that might be happening:

                - the timer can not/will not fire if there is no (knowlege) session present and linked to the process instance.

                - in some cases, if the node before the timer node (or after) is not correct and fails, that exception is sometimes not shown and the process can silently die.

                 

                Would you mind posting of the bpmn of the three nodes: the one before the timer, the timer node and the one after the timer?

                 

                Thanks,

                Marco

                • 5. Re: Question about using Timer node
                  Yu Chai Newbie

                  Hi Marco,

                   

                  Thank you very much for the suggestion. I think the first point addressed my issue exactly. I reviewd my project code and test java code and found in my project code i called ksession.dispose in "finally" satement but in test code I didn't. After i removed the finally statement it worked! Apparently the ksession has been disposed before the timer expires.

                   

                  Ksession.dispose() is needed to recycle the memory. So could you please suggest where the best place is to dispose the ksession?

                   

                  Meanwhile, given the fact ksession needs to be alive for the timer to trigger, can I trigger the timer in an asynchronous way? So that when timer expires the ksession can be resumed using JPAKnowledgeService to continue the process instance.

                   

                  Thanks again Marco!

                   

                  Best regards

                   

                  Yu