Jiwa 7.0.157
I found few issues with setting up plugin schedule in the past almost all caused me heartache...
1. schedule type = "One Time", it runs everytime schedule service runs, i.e. never stops
- I heard this is fixed in a recent version (post .157) but I haven't tried yet.
2. if your code in Execute(...) throws an error, the particular schedule will rerun (due to next run time not set at the end I assume)
- sample below, if you dont catch your error, your step1() will get executed over and over...
- Code: Select all
Public Class ScheduledExecutionPlugin
Inherits System.MarshalByRefObject
Implements JiwaApplication.IJiwaScheduledExecutionPlugin
Public Sub Execute(ByVal Plugin As JiwaApplication.Plugin.Plugin, ByVal Schedule As JiwaApplication.Schedule.Schedule) Implements JiwaApplication.IJiwaScheduledExecutionPlugin.Execute
Try
step1() 'no error
step2() 'throws error
Catch ex As Exception
'suppress exception
End Try
End Class
3. monthly schedule is weird... I setup a monthly schedule (runs first sunday of every 1 month) on 2016-08-25.
- first schedule ran ok on 2016-09-04
- it didn't run 2016-10-02 (last Sunday)
- it ran yesterday... (2016-10-04)
- looks like it is just doing Month +1
4. dont export your plugin (from dev) with schedule...
- on import, it creates a new schedule and you end up with same schedule many times
One of my plugin is to email 1000+ invoices to customers and you dont want it repeated every 1 min
Apart from bug fixes, I also would like to know if this can be implemented
- setup multiple instances of plugin schedule service and each can run different plugin schedules
If we can at least specify a name on each service instance and have that passed into Execute() as a parameter