IBM Support

How to implement a custom cron job

Question & Answer


Question

How to implement a custom cron job

Answer

The custom cron jobs should be implemented by extending the ApplicationCron (for Application Cron jobs) and overriding the Service method.

The service method should not have any business logic and should only be used only to call message type (MT). The business logic should go into the bizlets mapped to the MTs.

Also the cron job uses the bizlet session to carry out authentication and other storefront related properties.

If the business logic is used in the Service method directly and no MTs are called, then this can lead to unknown behavior. Few known issues that a user can face are:

-- The user authentication is not done when the cron job is triggered.

-- When cron job is triggered automatically the user session is null and none of the storefront properties are picked up.

-- When cron job is triggered manually the user session of the login user is used to process the cron job.

[{"Product":{"code":"SS6PEW","label":"IBM Sterling Order Management"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"MCS","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Historical Number

HTG3198

Document Information

Modified date:
16 June 2018

UID

swg21561986