9 Replies Latest reply on Jun 17, 2009 11:07 AM by rudi1

    jBPM Timer Configuration with EL

    mikeschulze

      Hi,
      does anybody know whether it's possible to use JBoss EL within the duedate-declaration of a timer. I want to use it in this way:


      <create-timer name="timerA" duedate="#{myComponent.getDueDate()}">



      I know that jBPM supports EL, but as far as I know I could only use the expressions given in the reference. But with those I can't use the full seam-functionality.


      Thx in advance - Mike

        • 1. Re: jBPM Timer Configuration with EL
          kukeltje.ronald.jbpm.org

          duedate and reminder accept EL. I'm not sure if I implemented it for create-timer as well. I'm positive method based expressions are not supported though

          • 2. Re: jBPM Timer Configuration with EL
            rudi1

            I'm currently not able to get the EL-style initialisation of duedate working, either using getter on a Seam component nor for value stored in BusinessContext/jBPM variable. So for timer it should work for sure.
            jBPM version 3.2.6 and Seam 2.1.1.GA.
            Here is the code example



            <task name="Task_1">
              <assignment actor-id="#{actor_for_task_1}"/>
                <timer name="task_1_timeout" duedate="#{dueDateJBPM}" >
                  <script>System.out.println("task_1 timed out")</script>
                </timer>
             </task>



            The variable dueDateJBPM has java.util.Date type.
            Is here any thing wrong?

            • 3. Re: jBPM Timer Configuration with EL
              kukeltje.ronald.jbpm.org

              I see no reason why it should not work. Can you check in the database if the duedate on the timer has a value? Or check if timers work at all? Turning on debug logging might show some more info as well.


              • 4. Re: jBPM Timer Configuration with EL
                rudi1

                If I'm using a fix value something like 10 seconds the timer is working just fine.
                Using EL expression as above an Exception is thrown just on creation of the timer:



                Caused by: java.lang.IllegalArgumentException: improper format of duration '#{dueDateJBPM}'
                    at org.jbpm.calendar.Duration.<init>(Duration.java:151)
                    at org.jbpm.scheduler.def.CreateTimerAction.createTimer(CreateTimerAction.java:84)
                    at org.jbpm.scheduler.def.CreateTimerAction.execute(CreateTimerAction.java:74)
                    at org.jboss.seam.bpm.SeamUserCodeInterceptor$1.process(SeamUserCodeInterceptor.java:80)
                    at org.jboss.seam.bpm.SeamUserCodeInterceptor$ContextualCall.run(SeamUserCodeInterceptor.java:33)
                    at org.jboss.seam.bpm.SeamUserCodeInterceptor.executeAction(SeamUserCodeInterceptor.java:74)
                    at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:262)
                


                btw thanks for quick reply,
                Rudolf

                • 5. Re: jBPM Timer Configuration with EL
                  kukeltje.ronald.jbpm.org

                  are you sure you are using jBPM 3.2.6? The linenumbers in the stacktrace make no sense at all in combination with the error for any of the jbpm releases that support EL in duedates. Could there be an older version of jBPM on the classpath somewhere? Must be pre 3.2.2 cause that is what I can go back to in svn (via fisheye)

                  • 6. Re: jBPM Timer Configuration with EL
                    rudi1

                    it might be, I'm just figuring out, why my sources don't fit the stack-trace

                    • 7. Re: jBPM Timer Configuration with EL
                      rudi1

                      thanks a lot for  the hint, indeed I used an older jBPM version (3.2.2).

                      • 8. Re: jBPM Timer Configuration with EL
                        kukeltje.ronald.jbpm.org

                        Please let me know if it works with a newer version.

                        • 9. Re: jBPM Timer Configuration with EL
                          rudi1

                          for jbpm version 3.2.6 it's fine.


                          cheers
                          Rudolf