Batch server: Groups of Tasks

4 minute read time.

In my "Understanding and troubleshooting the Batch Server" session during the "Sage X3 Technical Support Tips and Tricks (March 2022)" I did not discuss "Groups of Tasks" as I didn’t have time to go into it.   In this blog I will now take a look at "Groups of Tasks" to demonstrate how it can be used.

What are “Groups of Tasks”

Groups of Tasks are a list of Tasks which must be run together through the Batch Server.  Groups of Tasks can be launched by manually submitting, or setting up as a recurring task, in the same way as a single Batch Task is run.

You can control if certain tasks in the list will run sequentially or in parallel (you can mix both methods).    You also control if the group continues to run if one of the tasks completes with an error or not.

You can read more in the online help at https://online-help.sageerpx3.com/erp/12/staticpost/groups-of-tasks/

Configuring Groups of Tasks

Navigate to Usage, Batch Server, Groups of Tasks

Create a new code.  You can enter the Authorisation Level and Hourly constraints if these are needed.   If you wish the Groups of Tasks to continue processing the list if one of the previous ones ends in Error status, you can select "Proceed if error" checkbox.  For now, I will leave it unchecked.

I have then added in my Task Codes with a sequence number.   All tasks are executed in order of the sequence number once after the other.  However, if more than one task has the same sequence number then these tasks are executed in parallel, as you can see in my example with the three reports being run together.

Ensure "Active" is checked and save the record.

Executing Groups of Tasks

You can launch a Group of Tasks as a one-off run or as a Recurring Task, in the same way as you would for a single batch task.

Launch as a one-off task

Navigate to Usage, Batch Server, Query submission

Select the Group code and enter the language, date, time as normal where required

Click "Validation"

You will then be required to enter the parameters for each of the tasks that are to be run as part of the group (where parameters are required).  Enter appropriate parameters and click OK for each one

Once all parameters have been entered, the Groups of Tasks is then submitted to the batch server for processing.

You can now navigate to Usage, Batch Server, Query Management to see all the tasks in the Groups of Tasks listed.

The first task is scheduled but the others are "Held" status until the previous tasks in the sequence have been completed.

Once the first job has finished, as I had configured the three reports to run in parallel, they are now all scheduled and are released to be picked up by the batch server together.  These tasks are scheduled and run by the batch server normally, within any restrictions such as number of concurrent tasks, etc.

The three reports will all need to complete before the next task can be scheduled to be processed.

In this case, the AWRKSIG finishes with an error, and all remaining tasks are therefore aborted.  This behaviour is controlled by the "Proceed on error" flag.

I will now update my Groups of Tasks setup to enable the "Proceed on error"

Launch as a Recurring Task

Next I will launch my group as a Recurring Task, by navigating to Usage, Batch Server, Recurring Task Management and creating a new Recurring Task

Enter the information to suit your requirements, then Save the record.  You then need to select "Parameter definitions" as many times as needed to enter the parameter information for all tasks which have Parameters that need entering, as demonstrated earlier.

Once you have entered the parameters for all required tasks, you can select the "Active" checkbox and re-save the record for it to take effect

When the first task is scheduled to run, you will see the task in Query Management

The behaviour is the same as demonstrated earlier, except this time the final ZSLEEP task will be executed, as I am now ignoring errors.  The other difference is obviously that the task will be scheduled to run again, according to whatever you configured for your recurring task setup.

Conclusion

I hope this article has provided insight into using Groups of Tasks.    Feel free to leave a comment below to let me know your feedback.

Parents Comment Children