Binding
Definitions from Task Container
You can define bindings from the task container to the following containers:
● Workflow container
● Rule container
● Method container
The binding is applied after execution of the work item. The binding can be defined in step type definitions that refer to a task. It is necessary if you require information for the workflow, which is available after execution of the underlying object method.
If an object is created (for example, with the method Create) or established (for example, with the method Find) in task processing, you must define the binding from the element _WI_Object_ID in the task container to the element in the workflow container, which can contain the object reference. The information is only available in the workflow, and therefore for the subsequent steps, if you have defined this binding.

If the workflow container contains an element which is defined with a data type reference to the same object type that is created in the referenced task, this binding definition is proposed automatically when an activity is defined.
If no element with an appropriate data type reference is available in the workflow container, a suitable element is added to the workflow container and the binding entered.
If you want to transfer the actual agent of a work item (available under the element ID _WI_Actual_Agent in the task container) to the workflow container for further use, you define an appropriate element in the workflow container to contain this information.
You create this element with a reference to the ABAP Dictionary field WFSYST-AGENT.

The binding from the step container back to the Workflow container is only executed when a method has been successfully executed. The binding is not executed in the following situations:
■ Processing of the work item is denied (for example, from the Business Workplace)
■ An administrator or control step sets the work item to obsolete
■ A deadline becomes active and steps in a modeled outcome are executed
■ The "complete work item" condition for the step is true and the step is completed without executing the method
To nevertheless determine the agent in the instances above, use the container element _PREDECESSOR_WI to access the predecessor work item. For example, the expression &_PREDECESSOR_WI.WORKITEMID& gets the work item ID of the predecessor work item.
For a detailed description of how to use the _PREDECESSOR_WI container element, see SAP Note 903692.
The result of the object method is available under the element ID result (_WI_Result) in the task container. You must define an appropriate element in the workflow container, if you want to transfer the result into the workflow container. When defining the container element, use the same data type reference that the element _WI_Result has in the task container.

You require the result of this activity in a subsequent step of the type loop (UNTIL) in order to formulate the loop condition.
You define this binding in the definition of a task if you have entered rules for one or more recipient types on the tab page Default rules.
You must add the elements required to resolve the rule to the task container in order to define a binding between these new elements and the appropriate elements of the rule container.

Note that you must create a binding from the workflow container to the task container in the step definition, via which these "new" container elements are given their values.
Depending on the type of the rule for agent determination, you need to transfer the following data:
Rule type |
What is transferred in the binding? |
Responsibilities |
Container elements that are used for the responsibility check |
Organizational data |
Attribute of the business object that refers to the organizational object |
Function module |
Container elements that are used as import parameters for the function module |
The task container is completely copied to the method container at runtime as standard.
You can define this binding definition when defining a task. SAP only recommends that you do this if you do not explicitly want to provide the import parameter of the method with data or if you define your own binding from the method to the task container.

If you define the binding of the task to the method container, you also have to define the binding from the method to the task container. The content of the container is only automatically copied to the relevant target container if you do not define either of the two bindings.
The container element _WI_Object_ID in the task container is not incorporated into the binding definition to the method container. At runtime, the workflow system ensures that the object reference from the element _WI_Object_ID is available in the key fields in the program of the object type.
For more information, see Operation of the Binding Editor.