Menu
SuiteCRM dedicated support by SalesAgility
Welcome, Guest
Username: Password: Remember me

TOPIC: Workflow only works with "Less than or equal to" condition

Workflow only works with "Less than or equal to" condition 5 months 1 day ago #63960

  • acoolov
  • acoolov's Avatar
  • Offline
  • Senior Member
  • Posts: 71
  • Thank you received: 1
  • Karma: 0
Why does the workflow only work with a "Less than or equal to condition"?

Whenever I try to just set it to Less than or equal to NOW - 2 Hours it works,

But i'm trying to make it work using Equals to NOW - 2 hours. It won't work.

For some reason the only time conditions that work are Less than or equal to, or Greater than or equal to.

Equal to, or Greater than, or Less than, never work in my workflow scheduler.

Is there any reason for that?
The administrator has disabled public write access.

Workflow only works with "Less than or equal to" condition 2 weeks 3 days ago #71153

  • acoolov
  • acoolov's Avatar
  • Offline
  • Senior Member
  • Posts: 71
  • Thank you received: 1
  • Karma: 0
Will this be ever addressed in SuiteCRM? It's a very critical feature.
The administrator has disabled public write access.

Workflow only works with "Less than or equal to" condition 2 weeks 3 days ago #71155

  • amariussi
  • amariussi's Avatar
  • Offline
  • SuiteCRM Is My Life
  • Posts: 1069
  • Thank you received: 243
  • Karma: 58
Workflow is fine.

The problem is your logic which is wrong.

To understand why it is like this you have to understand how workflows work. The crucial point is that the workflows script is invoked by a scheduler.
The scheduler is run at specific time intervals (which you define at two levels: the system crontab and SuiteCRM scheduled jobs).

Since the timing is an interval and not continuous it is almost impossible to meet the criteria when you use the equal condition.

If you use Less than or equal or Greater than or equal the condition will become true on the first time the workflow script is run when the condition is met. However, So this ensures that the workflow is triggered, however with a potential small error equal to the time difference between each time the workflow script is run by the scheduler and the actual time of your condition. So, if you set your scheduler to run every 5 minutes you will get a minimum error of 0 seconds and a maximum error of 5 minutes.

You may set your crontab to run every second, reducing thus the error to maximum one second. However this may cause some serious overload of your system.

On the other hand, given the way schedulers work, if you use equal to, it may (very likely) occur that, when the scheduler runs, the time yo have set is before or after the time in which the workflow is running (even by one millisecond) so that your condition is never met,

I hope you understand this.

Try to do a simulation in which you workflow script runs every 5 minutes and you set a time for your condition. Each time it runs update your values and you will see that, at a certain point the condition will become TRUE and the workflow will be triggered.
The administrator has disabled public write access.
Time to create page: 0.047 seconds
Powered by Kunena Forum