4 Replies Latest reply on Feb 4, 2009 10:12 AM by Ronald van Kuijk

    method binging in expression

    Hans Huber Newbie

      hello,

      i would like to dynamically calculate the due date of timers at runtime.

       <timer duedate="#{myBean.calcDueDate}" name="timer1">
      


      a few questions:

      * whats the correct syntax for method binding?
      * besides SEAM are there other expression evaluator implementations that support method binding? eg. for spring beans

      any samples or pointers to a solution would be highly appreciated.

      thank you,

      hans

        • 1. Re: method binging in expression
          Ronald van Kuijk Master

           

          "hhhuber" wrote:

          * whats the correct syntax for method binding?

          afaik, you can't in jBPM...
          "hhhuber" wrote:

          * besides SEAM are there other expression evaluator implementations that support method binding? eg. for spring beans
          There might be, but I'm not sure if you could get them in jBPM


          "hhhuber" wrote:

          any samples or pointers to a solution would be highly appreciated.

          thank you,

          hans


          you could calculate it in an actionhandler, store it in a processvariable and reference that....


          • 2. Re: method binging in expression
            Ronald van Kuijk Master

            aaaaaaaaaaaaaaaaahhhhhhhhhhhhhhhhh sorry for the mess...

            • 3. Re: method binging in expression
              Hans Huber Newbie

              yeah, i tried it with preprocessing the duedate and storing it in a process variable. wasn't happy with this solution though.

              current solution: i replaced JbpmVariableResolver with my own class which extends from it and implemented a quick hack that allows to call method of spring beans.

              for example:

              <timer ... duedate="#{registrationService_dueDate} .../>
              


              will lead to a lookup of spring bean with id 'registrationService' and then call method 'dueDate' via reflection.

              ugly, but it works :-)

              if anybody else has something better to offer, please let me know.

              hans

              • 4. Re: method binging in expression
                Ronald van Kuijk Master

                 

                if anybody else has something better to offer, please let me know.


                I doubt it.... though in jBPM 4 the resolver stuff changes for the better afaik.... not sure though if all attributes will automatically support method binding then....

                Isn't it nice btw that jBPM is so flexible that you can replace resolvers? Try that with other systems...