4 Replies Latest reply on Mar 25, 2009 12:04 PM by Jose Rodriguez

    Overdue actions, timers.

    Jose Rodriguez Newbie


      Our process definitions are based on nodes and actions inside them (being executed in async mode). We are using jBPM for controlling batch processes, therefore I thought the best option was using nodetype "node".

      One of the requirements is notifying if one of the actions is "running late", if it's overdue (for example if it has been running for 30 minutes and still hasn't finished)

      I have been trying to associate a timer to an action or a node for trying to obtain this behaviour, but the only thing I have been able to do is to "schedule" the execution of the action, although not being able to supervise its duration.

      Is there an easy way to obtain this functionality from jBPM or should I code that functionality inside my actions ?

      Thanks a lot in advance.

        • 1. Re: Overdue actions, timers.
          jc little Newbie

          i aslo have this problem, do you have the solution?
          my timer is aslo can't interrupt the action handler execution if it running for a long time.

          • 2. Re: Overdue actions, timers.
            Alejandro Velazquez Newbie

            If I got it well, this could be solved by defining tracking actions for node-enter and node-leave events.

            In the node-enter you can capture the start time and use it in the node-leave event, to determine if the node actions were executed on time.


            • 3. Re: Overdue actions, timers.
              Ronald van Kuijk Master

              interupting long runnning things is not different in jBPM then in any other java application.

              Make actionhandlers that can receive events (non-jbpm events) and act upon them. Have your timer send one of these events then..

              But it might be a nice addition to jBPM I think to be able to cancel long running async things when they are already running (timers can be cancelled when not started yet)

              • 4. Re: Overdue actions, timers.
                Jose Rodriguez Newbie


                There was a change in the requirements so instead of having to interrupt the execution I had to generate an alert (send an email notifying an operator of the delay in the execution).

                I associated a timer to the execution of the actions, and injected the implementation of the alert/notification. I used java.util.Timer and the Timer.schedule method.

                Right now I am sending an email notifying the delay in the execution, but I guess that if the requirements change once again I could create a new implementation and inject it instead of the email alert.

                Ronald, I think my solution is similar to what you were suggesting with the exception that my timer is associated to the task but in your case it seems to me it would be independent. Is that correct ?

                If so... how would you link the timer with the execution of the action ?