Sugar BPM / Advanced Workflow future/current/past comparisons

Hi,

I'm writing some business workflows in 9.0.1 Enterprise and I'm following a design similar to:

https://community.sugarcrm.com/thread/34139-using-advanced-workflow-to-identify-overdue-records

I'm working with meetings and want to fire events when scheduled meetings become overdue. The sample given in the link above will work perfectly - but with the wait event being 10 seconds in the past rather than 5 days in the future. However, we have one edge case that I can't see how to incorporate.

(Note, the process termination is set to the meeting status being set to held/not-held).

If a meeting has been set to held/not-held and then subsequently set back to scheduled (either on purpose or by accident) then:

If the start date is in the future, treat as a normally scheduled meeting and start a process again with the wait event as above.

Else, if it's in the past, never start or terminate.

I can't see how to use a 'now' comparison in the criteria for the start_date in the start-event - it only allows for given date/times.

Any suggestions on how to best handle this case?

Thanks

  • Hi Steven Cox,

    You cannot use a dateTime variable like now() in Start Events, so the solution would need to let the record into the process, then assess the Meeting's StartDate in a Wait Event, and terminate if now() or before.

    Here is one way you might approach this:

    The exact criteria of the Wait Event might need to be modified to ensure it does not interfere with the functionality of the rest of the process, so Start Date (which translates to "Start Date = now()") might not work the way you want it to.

    Whatever you set the Wait Event to, the ideal is that the next scheduler run will direct the record right to the Terminate Event (End Event # 1 in this example) instead of continuing the record through whatever route the vertical path from the parallel gateway has the record waiting/sleeping at.

    I hope this helps!