Starting Workflows or Tasks from Messages
Use
Workflows or tasks can be started from message long texts.
If there are appropriate (target) elements in the workflow container or task container, the system passes the following data to the started workflow or started work item:
|
Container element |
Data Type Reference |
Explanation |
|---|---|---|
|
ARBGB |
T100-ARBGB |
Message ID (application area, for example 'WO') |
|
MSGNR |
T100-MSGNR |
Message number (for example '430') |
|
MSGTY |
SYST-MSGTY |
Message type ('E', 'A', 'S', and so on) |
|
MSGV1 |
SYST-MSGV1 |
Message variable 1 |
|
MSGV2 |
SYST-MSGV2 |
Message variable 2 |
|
MSGV3 |
SYST-MSGV3 |
Message variable 3 |
|
MSGV4 |
SYST-MSGV4 |
Message variable 4 |
|
TEXT |
T100-TEXT |
Message text in which the variables (&) are not replaced |
|
MESSAGE |
Without type, that is C(255) |
Message text in which the variables are replaced |
This data is available in the container of the task started and can be used to control the process flow.
Features
You are supported in the functions described below by a Workflow Wizard. Choose .
How do you link a message to a workflow?
To implement this functionality, you enter the assignment between task and message in table T100W. Maintenance of this table is client-specific.
If the message long text is displayed and an assignment is maintained, the function Start workflow is active and can be used to start the saved workflow or task.
Workflow definition details
It is important that you add the container elements described above to the container concerned (workflow container or task container). Otherwise, the information from the message cannot be evaluated in a meaningful way in the task or workflow started. At runtime, the system then fills the container elements with the relevant values from the message.
If the message variables are to contain the values of object key fields, the object reference must first be created within the workflow from these key fields. To do this, you must provide an appropriate instance-independent method with import parameters as shown in the following example (object method Build):
BEGIN_METHOD BUILD CHANGING CONTAINER.
DATA: KEYFIELD LIKE....
SWC_GET_ELEMENT CONTAINER 'MSGV1' KEYFIELD.
SWC_SET_OBJECTKEY KEYFIELD.
END_METHOD.

