Introduction: Process Task Manager
The Process Task Manager was introduced to Compiere in version 3.4. It includes features to spread your operation workload to offload large document processing to off-peak hours thereby optimizing your machine resources
• Document workflow processing can now be scheduled for a future time.
• Ability to limit the number of concurrent workflow processes executed by each workflow processor.
This feature is available in both Swing and Web UI.
From the System user and System Administrator responsibility, create a Schedule record that will be used to determine how frequently a workflow processor will check to see if there are scheduled processes to be started. This schedule can be used by multiple workflow processors. The example below shows how to create a schedule to run every 5 minutes 7 days a week. To minimize the impact on system resources, it is recommended that the schedule for background processors not be run more frequently than every 5 minutes.
Workflow Processor Setup
Once the appropriate schedules have been defined, they can be assigned to the Workflow Processor which is effectively the queue that processes all the document actions. There is one defined by default (called the System Workflow Processor) and it should be used to run all the processes immediately.You can set the Maximum Number of Processes field for it, but if you leave it blank (or 0), there will be no maximum. If this existing record does not have a Schedule currently assigned to it, then you will need to assign one if you want to change any of the existing fields.
Now create at least one scheduled Workflow Processor to go along with the existing System Workflow
Processor and assign the desired Schedule to it. For the Maximum Number of Processes field, you should enter the maximum number of jobs that you want to be running concurrently on this Workflow Processor.
You may want to create several such workflow processors, one to run the processing of invoices, one for the processing of material receipts, etc., each with a maximum number of processes set to one which would insure that only one invoice, material receipt, etc. can be processed in the background at a time. In the example below, a workflow processor called Scheduled Workflow Processor is created and assigned the schedule of running every 5 minutes. It has a maximum number of process set to one. If 0 or null is specified, then there is no maximum value. It is recommended that this value be as low as feasible to evenly spread the load across the system.
Still using the System user, open the Workflow window and select all the workflows with Workflow Type=Document Process. Then in the Workflow Processor field, enter the value "System Workflow Processor". This is the workflow processor that will be used to process all documents immediately. In the Background Workflow Processor field, enter the name of the workflow processor that you want to process this type of document. In the example below, the "Scheduled Workflow Processor" is entered as the workflow processor that will be used to process invoices that have been scheduled to run at a specified date. If a document action is selected for invoices and no scheduled date is entered, then the System Workflow Processor will process it.
If you do not assign a specific workflow processor to either of the Workflow Processor or Background Workflow Processor fields, then one running workflow processor will be randomly selected by the system when the document is being processed. Therefore, in order to insure that the desire workflow processor is selected for a particular document, it is best to specifically assign a workflow processor to each of these fields for each workflow.
Application Server Setup
Now bounce the Application Server to make sure all the workflow processors you have created are running on the specified schedule. You can use the Compiere Server Manager page to view this as shown in the screenshots below (login using the System user and password):
Documents can be scheduled when submitting a document action. For Ex:
Because the processing of the document actions is performed via workflow, the existing Workflow Process window will be used to monitor the document actions that have been completed and queued for later execution. If the current user is an Administrator, then all processes will be displayed on this window. If the user is not an Administrator, then only the processes initiated by this user will be displayed. The records in this window should be sorted with the most recently created entries showing first (i.e. in descending order by Created On date)
Like all standard Compiere windows these records can be viewed in multi-line mode and sorted by Workflow Status, User, Start Date, etc.
Manage Process button does allow users to Abort a process if it is stuck in a Running status and cannot be acted upon. This would be in cases where the database crashed or Compiere was brought down while these processes were still running. If neither of these situations have occurred, it would be prudent to monitor the database sessions to see if this process is still running before attempting to abort the workflow process. Occasionally, locked database sessions that are killed may require that the corresponding workflow process be aborted in order to resubmit a document action.
New functionality will permit this screen to be used to abort processes that have not yet started.