2 Replies Latest reply on Mar 8, 2011 5:12 AM by jbpmfan

    Global variable in Timer Event node

    jbpmfan Newbie

      When I try to use global variable to calculate timer delay, i receive following error:

       

      Could not find variable scope for variable service.calculateDate()

      when trying to replace variable in processId for sub process Timer

      Continuing without setting process id.

      org.drools.RuntimeDroolsException: Error parsing time string: [ #{service.calculateDate()} ]

       

      Of course, service.calculateDate() (where service is global variable) works well in Script Task node.

      Is it a bug?

        • 1. Global variable in Timer Event node
          Mauricio Salatino Master

          Hi,

          Where are you using that? in a timer property?

          Probably that property don't support the use of experessions or the experssions that can be used for that property is not looking inside the global variables.

          Can you explain a little bit more about what are you trying to achieve?

          Greetings.

          • 2. Global variable in Timer Event node
            jbpmfan Newbie

            Thank you for response.

             

            I am using it in "Timer delay" property of "Timer Event" node.

            This property supports expressions cause I can invoke #{service.calculateDate()} when service is declared

            as local variable in process(for instance kcontext.setVariable("service", new SomeObjectService()))

             

             

            BUT when service becomes global variable suddenly JBPM cannot invoke its method in "Timer Delay" of "Timer Event".

            I suppose global variables are not visible in context of Timer Event (just local, process variables).

             

            In our project we assumed that services will be provided to processes by global variables and work item handlers.