On Subjob Error
Let's extend our first example by illustrating how a job can be made to take different execution paths based on what happens during the running of the job.
In the previous example we configured an OnSubjobOK example, but what if the subjob did not work as expected? The Studio also offers another subjob connector—OnSubjobError—for this situation. Let's modify the job to show this; perform the following steps:
Search for
message
in the Palette window and drop a tMsgBox component onto the designer.We can accept most of the default settings for this component, but change the Message parameter to
Something Went Wrong!!
.Right-click on the order_lines component, select Trigger | On Subjob Error, and drop the connector onto the message box component.
If we run the job now, it will work in exactly the same way as before. The database query will run, the data will be extracted to a file, and the file will be zipped.
However, let's change the order_lines configuration to force an error...