We’ve very recently completed our Cloud migration and we have an issue with a few of our BPMs. We have them set up to run when a schedule’s NextRunOn field changes, and before our move this has always worked to schedule these BPMs to run every night. Since our move to Cloud, they haven’t been running at night, and we’re not sure why. I can change the NextRunOn field manually and this will trigger our BPMs, but at night when the schedules tick over themselves, it doesn’t seem to cause the same database update we look at as before.Does anyone have any insight to if something is different between On-Prem and Cloud when it comes to the System Agent Tasks? Here is an example of a condition in our BPMs that used to work.
Data directives can no longer be used on the systask table in the cloud. You will need to migrate your logic into a scheduled function.
EDIT:
oh wait this is sysagentsched hmmmm either way I think it would be best to move your BPMs into a scheduled function.
Agreed, scheduled functions for the win.
I ran into this recently as well. When I changed the Next Run field manually it worked, but they would not run over night.
I am still not sure what the root cause of the issue was. However, I narrowed it down to the user account that the System Agent uses for scheduling. In my case, the manager account.
For whatever reason, in my BPMs, when I called Session.PlantID it was not correctly retrieving a plant. My manager account does belong to two different plants so I figured maybe this was the issue. After removing each plant and adding them back again to the manager’s user account, everything worked as expected.
Hopefully this helps, though I agree that Epicor Functions is the better option if possible.
The absolute best option is to move this logic to an epicor function. It will be more efficient, and will not cause other performance problems that were being caused by BPMs being attached to the system agent.
Thank you all for your replies. I’ve started moving the logic in these BPMs to functions and scheduling them. Everything is looking good so far in our Test environment. For anyone who is looking for information on this in the future, this thread was also very helpful to me in solving some context differences between BPMs and functions when dealing with service objects.