Вы находитесь на странице: 1из 8

How To Guide

Setup a Workflow for a Batch Task


This document shows how to setup a workflow for a batch task in v5. This will also work for recurring
batch tasks because they are nothing more that a batch task that runs at some type of interval.

Before Starting
In order for this to work properly, the workflow parameters (SERMES and TYPMES) must be setup and
be able to send e-mails from the server, sending messages from the Client is not an option for this type of
workflow.
Setup > General Parameters > Parameter values
Module: SUP
Group: WRK
SERMES is the Mail Server.
TYPMES must be set to Server.

February 2010 Sage Page 1 of 8


Creating a Copy of a Folder

Batch Task Setup


Usage > Batch Server > Task Management
On the batch task there is a box for user message this must be checked to allow a workflow to be
triggered from the batch task.
Note: In this example I am just using the task IMPORT but this can be set on any batch task.

February 2010 Sage Page 2 of 8


Creating a Copy of a Folder

Workflow Setup
Setup > Workflow > Workflow Rules
Create a new workflow, enter in a code and make it active. The description and category are optional.
Note: There are 2 event types that you can use for the batch server, they are End of Task and Task
Interruption. Please see the help below on the difference of the two types.

Note: Depending on the patch level and the actual event type names may vary a little, in this example:
Abort Task = End of Task
Stop Task = Task Interruption

February 2010 Sage Page 3 of 8


Creating a Copy of a Folder

The General Tab


Event Type: should be set to Abort Task (End of Task).
Event Code: should be set to the task that the workflow is to be triggered from, as a reminder this task
needs to be flagged as a user message or an error will pop-up on screen.
Data Model: Can be added if needed.
Conditions Section: Conditions can be added as needed.
Controls Section: Make sure that the Trigger Mail is checked.
Note: When adding conditions to batch task events you have limited table access without use of a data
model. The only table that can be used is ABATRQT. This table contains information related to
the batch status (i.e. the date and time this task started and stopped).

The field [F:ABR]FLAG holds the status of the


task, so for this example I only want to send
this workflow if the task has errors.

February 2010 Sage Page 4 of 8


Creating a Copy of a Folder

Note: The Flag field uses local menu 21 to define its statuses:

Note: If you want to trap more than one condition this will need to be done on the same condition line.
Conditions continuing beyond one line acts as an And statement. A valid Or statement for a
task that contains errors or aborted would look similar to the example below:

February 2010 Sage Page 5 of 8


Creating a Copy of a Folder

Recipients Tab
Define as many Recipients as needed. At least one address is required and must be contain a valid e-
mail address. If using X3 user codes, make sure they have quotes around the user.

February 2010 Sage Page 6 of 8


Creating a Copy of a Folder

Message Tab
Add the subject and body of the message. The standard functionality of the workflow can be used to
customize the workflow as needed.

Tracking Tab
Not used in this type of workflow

Action Tab
Not used in this type of workflow.

When Finished Save\Create the workflow and validate it.

February 2010 Sage Page 7 of 8


Creating a Copy of a Folder

Test the workflow and if all goes well you will get a message similar to this one:

February 2010 Sage Page 8 of 8

Вам также может понравиться