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.

  • Hello Chunheng,

    A very good question!   It is a little more like art than science to answer it though.  I have updated the "Batch Server throughput" section in the X3 specific performance blog at https://www.sagecity.com/gb/sage-x3/b/sage-x3-uk-support-insights/posts/performance-tuning-your-sage-x3-system-x3-specific-considerations#_Toc118271532  which is the best general advice I can give.  Hopefully this will help you.

  • Hi Mike,

    This question is related to the attached document from first line: /cfs-file/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-ec02860b-b9de-47a1-9fdf-2d8a85f6ee85/7345.07-_2D00_-Batch-server.pdf

    In Administration > Batch Server, there is Maximum active queries.

    Is there a formula to calculate the max active queries?

    Like for example, I have two main runtimes dedicated servers,

    - runtime1 have 4 vCPU.

    - runtime2 have 4 vCPU.

    Then, should I put max active queries to 8 (4+4 = 8) or is it recommended to put a higher value?

    Currently, I am just using gut feelings to configure and I would like to know if there is a proper way for it.

  • Hello Heather,  thank you for your feedback it is good to hear my articles are being read and used!   

    As you have probably noticed already from your comments, when using recurring tasks it is up to you to define when and how often they run, so need to take into account system load and any conflicts yourself...  although hope there is enough flexibility in the recurring job setup to allow you to work it out.   By all means submit product improvement suggestions through our "Ideas" page.

    To answer your specific question, the online help is just telling you that the recurring tasks are analysed and any recurring tasks scheduled to launch the next day are created as separate tasks in the list of tasks to be run (i.e. will see them in the "Query management" list.)

    I am not clear the actual issue you are facing with performance and/or recurring requests not running, but this would be something better investigated with your local Sage Support team as it may need some detailed analysis.

    Hope this helps, Mike

  • sorry i hit enter before i finished. uggh. What is this statement intimating? I mean if you read it word for word, is it indicating no matter what you do it will run continuosly? Honestly my Asia region reports every single night they have performance issues. Is it basically hitting some conflict stopping and postponing? I am honestly stumped on this one. Usually I can figure out the X3 help even when it is half French and half Engish. lol My goal is the level load the requests and split if necessary where Asia runs during US hours and US runs during Asia hours. It is making it difficult to slot each of the requests. Becasue I am not an admin if you will I tend to take the help as written. Which is why I appreciate your posts because they are clear and make some very saliant points. With a Smile, Heather Sauceda

  • Hi this is a GREAT post. Appreciate the effort y'all put into some of these posts. I have had a number of questions on these recurring tasks etc... As it is now we have over 50 recurring tasks running. Since it does not seem that there is a "tool" out there to truly define the scheduling to avoid conflicts etc...I am working on something for us to use. That said in my pursuit of information this is posted within the X3 help docs: 

    Technical operation of the recurring tasks

    When starting the batch server (or after midnight, when the batch server operates continuously), all the recurring tasks in a day are created in the form of task execution requests that can be seen in batch task management.