Calling Expression Rule inside Timer Event

Certified Associate Developer

We have a requirement to build the scheduler process to run 3 days before every quarter. The  Logic has been built in the expression rule . When I am trying to call the rule in the timer to get the specific day to run, the process is not running whereas when I implicitly paste the logic, it works. Is there any limitations that expression rule can't be evaluated inside the timer.

  Discussion posts and replies are publicly visible

Parents
  • The way I've seen this typically implemented dis that your timer runs every night at a pre-determined time, and then an XOR routes the processing either to an end node (if it's not the right time to run - in your case 3 days before every quarter), else it triggers a separate process. It pays to separate the "controller" aspect (i.e. the timer and the routing) from the actual processing, so build them as separate process models and have the controller call the processor.

  • Yeah I agree with other completely about having a process that runs every day, but I also wanted to mention one strong reason to do it this way. The tricky thing about timer conditions is that they have no traceability - it either starts the process or it doesn't, and if it doesn't start it can be difficult to understand why it didn't start. Instead if you have a process that starts every day and then you use an XOR gateway, you can always go back and monitor your process to figure out what the evaluation was to find why it triggered the sub-process or not.

Reply
  • Yeah I agree with other completely about having a process that runs every day, but I also wanted to mention one strong reason to do it this way. The tricky thing about timer conditions is that they have no traceability - it either starts the process or it doesn't, and if it doesn't start it can be difficult to understand why it didn't start. Instead if you have a process that starts every day and then you use an XOR gateway, you can always go back and monitor your process to figure out what the evaluation was to find why it triggered the sub-process or not.

Children
  • 0
    Certified Associate Developer
    in reply to Peter Lewis

    Thanks for your inputs . This design makes sense in terms of traceability. I would like to understand the reason behind the expression rule not getting executed when I called the rule to identify the day to run in the screenshot attached whereas if I paste the code it works fine. Is there any limitations?

  • 0
    Certified Lead Developer
    in reply to anjup0143

    Much as I said in my earlier comment on htis post, I believe *any* expressionable content on the execution time / start time for the process is evaluated at publishing time and not again until re-publishing.  When you use an expression rule as a container for some more advanced code like this, you should usually assume it will act exactly the same way as if you hardcoded that same code direclty into the expressionable box in the process model itself.  If you're seeing any behavior that seems to defy this, then you need to post some clearer code snippets / screenshots, because the single screenshot you've posted in your earlier comment doesn't really show us anything.