Unit 15: Using a Rule
Use
In the organizational plan you have created up to now, there are two positions, each of which is described by a job. Each position must be linked to a different user.
The job of department manager is linked to the department manager position. The job of department manager, in turn, is linked to the task Check notification of absence. In a more extensive organizational plan containing several positions for department managers, each position can be linked to the job of department manager.
These links ensure that each user who is assigned to a position as department manager is one of the possible agents of the task Check notification of absence. If you want to assign all of the department managers as possible agents of a different task, all you have to do is link this task to the job of department manager. You do not need to make any detailed changes.
If you then create a notification of absence, it is offered to all of the possible agents for processing. This is clearly undesirable, since the notification of absence should only be presented to your own superior. This superior is the head of department who has the chief position in the organizational unit to which you too belong.
To ensure that the notification of absence is not submitted to all of the possible agents, you must define responsible agents in your step definition. All of the responsible agents who are also possible agents for this task then become recipients of the work item for the task. In this example, the responsible agents must be defined dynamically, since the relevant agent depends on the requester (person initiating the workflow). To do so, you use a Rule for Agent Determination.
SAP delivers the rule Superior of. This rule first establishes a user's position and the relevant organizational unit and also finds the chief position in this organizational unit.
By using a rule to assign responsibilities, you do not need to have any specific knowledge of the organizational plan when you define a workflow definition. When the rule is resolved at runtime, all of the necessary information is provided using the binding definition from the workflow container to the rule container.
Procedure
Start the Workflow Builder and open your workflow definition in change mode. Proceed as described in Unit 7: Including "Check Notification of Absence" in the Workflow Definition
Selecting a rule
-
In the navigation area, select the activity Check notification of absence. The relevant step definition is opened.
-
Choose Superior of workflow initiator under Agents.
The system then enters the rule ID (00000168) in the Rule selection field and in the input field.
Concluding the step definition
-
Choose
to check the step definition. -
Choose
to exit the step definition. -
Choose
.The workflow definition is checked, saved, and, provided it does not contain any errors, activated. The system displays a message if problems are encountered during the test.
Result
You can now subject your workflow definition to another test.