Parked jobs
You can park a job during its processing and restart the processing again from the beginning at a later time. For this purpose, the function "abort job and schedule again after x seconds()" can be used. If this function is called in the profile, the job interrupts the processing. Because the job is in phase 3 (mapping) at this time, all subsequent phases within the job will no longer be executed. After the number of seconds specified in the function, the job is restarted.
The function "counter of scheduled retries()" provides the number of restarts initiated by the function above. This makes it possible to completely terminate the job after a defined number of restarts.
An example of parking a job is the following scenario.
A profile is supposed to process jobs that are serialised with an order number. The orders should be processed in the correct order. This means that order number 10 must be processed after order number 9.
The profile has a time-driven Input Agent that reads files from a directory at defined times. A job is started for each file in the directory that matches the file pattern. During the mapping, the respective job checks whether the order it is working on can be processed. This might, for example, be done with a database query. If the job determines that the order cannot be processed, the job calls the function "abort job and schedule again after x seconds()" and thereby terminates the processing.
After the number of seconds specified in the function call, the job restarts the processing with the already stored input data. If the previously missing orders were processed in the meantime, the job finishes the processing to the end.
If a missing order never arrives, the jobs will be parked and restarted over and over again and will never be completed. By using the function "counter of scheduled retries()", the processing of the job can be terminated after a defined number of repetitions, for example, by calling the functions "abort execution()" or "throw exception(a)".
Settings
(1) List below: The input file of the parked job can be viewed, downloaded and deleted in the context menu.
(2) Profile: The name of the profile of the parked job. You can use the wildcard "*" in the filter field, e.g. "Company*AS2*send".
(3) Next run: The time at which the parking will expire and the job will restart automatically.