Changes to scheduled jobs!
New scheduled job platform that allows for easy customization
Last updated
New scheduled job platform that allows for easy customization
Last updated
As of version 16 we've made important changes to how scheduled jobs are created and deployed. Scheduled jobs now use the recently introduced service hoster in order to have full customization support. The previous scheduled jobs have been moved from the now defunct BusinessFunctions
class into the apropriately named busScheduledJobs
business object.
Adding a custom scheduled job is as easy as customizing the busScheduledJobs
business object and adding a new method that accepts no parameters and returns void
.
Here is an example we used to have in the documentation for custom scheduled jobs, adapted to version 16. In order to create a new custom scheduled job, first create a new customization from TimeLine Developer.
The next step is to customize the busScheduledJobs business object and add our new logic.
To ensure our custom methods are picked up by the service hoster we need to make sure we edit the server tlx.ini to add the custom path to our server mandant (as shown at the top of this page). Please make sure you restart the service hoster service in order for this change to take effect!
We can easily add a new custom method that can be invoked via the scheduled jobs mechanism by writing a non-static public method that returns void and has no parameters.
If everything is set up correctly you should be able to see the custom added method in the scheduled job configurator dropdown:
For the above example to work you need to have the Beleg02.lst report in your server installation reports directory. A succesful job run should produce the expected results:
Please note that only calls to the busScheduledJobs.Log method actually get logged into the jobs' log file - any other output (like calls to the TimeLine Framework Log static class will be written into the log associated with the ServerBusinessObjects service hosted by the Service Hoster. In this case, this file is located at TimeLine Server 16.0\Logs\ServiceHoster\ServerBusinessObjects_Neo16 where Neo16 is the mandant name this was running under.