4 Replies Latest reply on Oct 6, 2005 1:22 PM by ulfreich

    how to set timer set up data

    alal lal Newbie







      How can I specify values of duedate, repeat values at run time base on context variables. I don't want to set these values at design time but at run time.

      appreciate your help

        • 1. Re: how to set timer set up data
          alal lal Newbie









          question above was in referen eto timers setting

          • 2. Re: how to set timer set up data
            ulfreich Newbie

            Hi, did you get to a solution? I would like to do the same, but I have only been able to change the created Timer dueDate (using a Duration object).

            The string with the duedate can be found in the JBPM_ACTION table, that's where I want to change it, but I just dont know how. Thanks!

            • 3. Re: how to set timer set up data
              alal lal Newbie

              can you put solution about how you did for due date. I was busy with other thing so didn't worked on above issue. But, will let you know if I find any solution.

              jBPM guru, this seems to be very common requirement. Any pointer how we can achive this?

              • 4. Re: how to set timer set up data
                ulfreich Newbie

                What I could do easily was set a new dueDate of an already existing Timer "instance" (a record in the JBPM_TIMER table) using a Duration object, but not the dueDate string in the JBPM_ACTION table. What I did is as follows:

                //Any duration:
                String dueDate = "30 seconds";
                
                // parses the dueDateStr:
                BusinessCalendar businessCalendar = new BusinessCalendar();
                Duration duration = new Duration(dueDateStr);
                Date dueDate = businessCalendar.add( new Date(), duration );
                
                timer.setDueDate(dueDate);
                
                jbpmSession.getSession().update(timer);
                


                You have to wrap that in the respective transaction handler code (beginTX, commit, rollback).

                Seems like the jbpm API doesnt have a method to set the dueDate in the definition of the Timer (JBPM_ACTION table).. :S