Defining Rules Using Function to Be Executed Asynchronously

Use

You use an ABAP class for defining an agent determination rule when you require very complex selection criteria for agent determination that cannot be depicted by other rule categories, and when you want to determine agents asynchronously.

The rule container, which is filled by binding, and the work item ID are transferred to this rule. Then the system can transfer the result of the rule execution to the initiating work item. This is done with the help of the function module SAP_WAPI_ASYNC_RULE_COMPLETE.

Prerequisites

An ABAP class exists that supports the interface IF_SWF_IFS_ASYNCHRONOUS_RULE, in which the method INITIATE_EVALUATION is implemented and which calls agent determination. The ABAB class receives the necessary data from the workflow environment via the rule container.

Procedure

  1. Enter a short description and a name for the rule.
  2. As the rule category, choose Agent Determination: Function to be Executed Asynchronously.
  3. Enter the name of the ABAP class.
  4. Switch to the Container tab page.
  5. Choose .

    The Change Container Element dialog box appears.

  6. Make entries in the Element, Name, and Short Description fields.
  7. Create either an object reference or an ABAP dictionary reference for the container element. As a guide, use the data type reference of the container element of the workflow or task container from which the container will be filled at runtime.
  8. On the Properties tab page, set, if required, the Obligatory and/or Multiline indicators.
  9. Repeat steps 5 to 8 until you have defined all the necessary elements for the rule container.
  10. Save the rule.

Result

If you execute a rule of this type, the work item is created with the initial status Ready, but it has no recipient. First, the rule must determine agents. The system then transfers the agents to the work item, and determines the recipients of the work item. All recipients can now see the work item in their workflow inbox.