Evaluation and Maintenance of Instance Linkage Table 

Use

The instance linkage describes the assignment of a receiver instance to a particular combination of object type, object key and event. This linkage is entered into the instance linkage table by the receiver instance itself using a function module provided.

The entries in the instance linkage table are always made at event receiver runtime.

If events are used in SAP Business Workflow (as triggering and terminating events, for wait steps), the entries required in the linkage tables are made by the workflow system.

An entry is made in the instance linkage table by the workflow system if work items wait for a terminating event. This can apply to the following work item types:

Integration

The instance linkage enhances the type linkage such that the reaction to the event is only produced if the event is derived from a particular object. This object is specified in the instance linkage table using its object key.

The unique ID (receiver ID) of a receiver instance can also be specified in the instance linkage table. This receiver ID is then written to the event container by the event manager and forwarded to the event receiver when the receiver function module is called.

The instance linkage table is only evaluated by the event manager following the evaluation of the type linkage table if the linkage is not designated a global event linkage in the type linkage table. The process flow is as follows:

  1. The event manager checks whether the object type, object key and event in the instance linkage table are in accordance with the event parameters of the created event.
  2. If this is the case, the ID of the receiver instance (receiver ID) is entered into the event container from the instance linkage table.

  3. The check function module is called if entered in the type linkage table.
  4. If this function module terminates without an exception (or if no check function module is specified), the receiver function module in the type linkage table is called with the transfer parameters event, receiver type and event container.
  5. If it was possible to establish the instance linkage, the entry is deleted from the instance linkage table. The entry in the type linkage table remains.

The specifications made in the type linkage table at definition time are used again for the actual assignment of the event to the receiver. This double construction is necessary since the generic selection of the receiver function module must be defined before runtime, but the instance values are not yet known at definition time.

The linkage logic does not allow an actual receiver instance to wait for an event whose triggering object is not yet known. The key of the triggering object must also always be known for an instance linkage.

This problem occurs when an object is created in a work item by an asynchronous method and this is reported to the workflow system by an event. The work item, as an actual receiver instance, is to wait for an event whose triggering object is not yet known when the work item is entered in the instance linkage table.

For this event, there is the workflow requester via which a relationship can be created between the unknown object and the waiting work item.

Features

Structure of the instance linkage table

The following fields are available in the instance linkage table:

Type of the object that creates the event.

Event created.

Object type and event must be defined in the Business Object Repository.

Concatenated key of the object that creates the event.

ID or instance of a receiver type.

The instance linkages (with associated type linkages) required for the wait steps and the terminating events of an activity in the workflow definition are entered automatically.

Do not change these entries!

The following are entered in the type linkage table:

The following are entered in the instance linkage table:

If it was possible to establish the instance linkage, the entry is deleted from the instance linkage table. The entry in the type linkage table remains.

Evaluation of the instance linkage table

For the purpose of troubleshooting and error analysis, it may be useful to display the instance linkages entered. To do this, you can display a section from the instance linkage table according to certain selection criteria.

Maintenance of the instance linkage table

You maintain the instance linkage table if you use event control within your own developments outside workflow.

The instance linkage table can be maintained using the following function modules:

You can insert entries into the instance linkage table using the parameters of this function module.

You can delete an entry from the instance linkage table using this function module.

You can delete all entries for a receiver from the instance linkage table using this function module.

If you make entries in the instance linkage table, ensure you delete them again when an instance linkage is no longer expected.

You should also delete the associated entries in the type linkage table. Ensure that there are no (more) instance linkages for this type linkage.

Activities

To maintain the type linkage table, choose Tools ® Business Workflow ® Development ® Utilities ® Events ® Instance linkages.