There are mainly 3 groups of Agents:
- Possible Agents
- Responsible Agents
- Excluded Agents
Apart from these 3 groups, there are 2 other categories of agents:
- Actual Agents
- These are people who can execute a task.
- Defined in the "Task" level
- Best practice to assign possible agents, is to sync with Security Roles
- A task can be marked as "General Task" to allow anyone to execute the work item.
- There are different ways to assign possible agents.
- For SAP provided workflows, we can assign possible agents using IMG.
- When we are displaying a task, we can use the following menu path
- Additional data --> Agent assignment --> Maintain
- The transaction is PFTC_DIS.
- From task profile section of organization plan
- From profile generator (Roll Maintenance); Transaction PFCG
- From workflow builder during step definition.
- Responsible agents are people who you want to execute a particular work item.
- Responsible agents are usually assigned in workflow step level, but can also be assigned at the task level via default agent determination rules
- Usually responsible agents are determined during runtime using two main ways
- In expressions, the data needed for agent determination is stored in workflow containers, which later is used in computations and agent is determined based on container values.
- In rules, agents are determined dynamically when work items are created.
- We can bind data from workflow to the rules to provide data for agent determination computations.
- For a work item to be forwarded to a responsible agent, the agent should also be a possible agent.
- Excluded agents are people who should not receive the work item for execution
- Excluded agents are always assigned by an expression to the workflow step
- Typically we put all excluded agents in a multi-line container in the workflow container, and use an expression to assign the list of excluded agents to a particular step.
- Recipients are agents who receive a work item.
- Recipients are
- Possible Agents
- Responsible Agents
- Are Not Part of Excluded Agents
- If there are no possible agents, then nobody will receive the work item.
- If no responsible agents are determined, the system checks to see if any default agents are defined in the task level.
- Recipients can forward work items to another agent. Whether or not the recipient can forward the work item is determined by the attribute of task.
- General Task
- Work item can be forwarded to anyone and executed by anybody
- General Forwarding
- Work item can be forwarded to any user.
- No General Forwarding
- Work item can only be forwarded to possible agents.
- No Forwarding
- Work item cannot be forwarded.
- General Task
- Actual agent is the agent that is currently processing a work item or the user who has last processed a work item.
Assigning Multiple Agents to Work Items
- Many agents can be assigned to a single work item.
- The work item shows up in all agents inbox, and disappears from everyone else when one agent reserves or executes a work item.
- Sometimes we need every agent to make an active decision from particular process. To do this, we can create one work item per agent.
Deadline and Notification Agents
- Deadline agents are people who receive work item when a deadline has exceeded for a work item
- These agents are entered in the deadline Of workflow step.
- Notification agents are people who are notified when a work item is completed.
- Usually entered in notification tab of workflow step.
Agent assignment using organizational structure
- Every workflow agent must have a userid.
- Assigning userid directly for task may be very high maintenance.
- Organizational plan helps in simplifying this issue.
- Every SAP application server comes with basic organizational plan
Basic organization Plan
- Represents a group of people such as 18, section, Department, work area, lab, help desk, or shared service Centre.
- A job described functional role within the organization.
- Position represents a headcount placement.
- Users is the actual userid of a person.
- Workflow task can be linked to one or more Organization units, positions, jobs, or users.
Extended Organization Plan
- SAP my HR comes with extended organization plan
- Extended organizational plan includes personal numbers
- A person represents a PERNR
- a person may be assigned to one or more positions.
- A user is assigned to a person by setting up info type 105 (Communication)
- From workflow perspective, extended organizational plan has following benefits
- Much more data in organizational plan to help make decisions.
- "Evaluation paths" can be custom built and used as rules to find organization objects.
Reassign Work Items from One Agent to Another
- If a user changes job or position, existing work item may need reassignment.
- Typically, only served work item needs reassignment.
- We can find outstanding work items for the user using transaction : SWI5. This transaction should be run before removing the user
- We can find orphaned work items using transaction : SWI2_ADM1
Temporary Substitution of Agents
Sometimes will need to temporarily substituted the agent. This can be done in two ways:
- The HR substitute relationship A210
- User Substitution (Table: HRUS_D2)
The HR substitute relationship A210
- We create substitute for a position using A210 relation between position and substitute.
- All work items for that position are made available to the substitute.
User Substitution Using Table HRUS_D2
- This is usually maintained from user's inbox using menu path
Inbox --> Settings --> Workflow Settings --> Maintain Substitutes
- We can also create entries directly using ABAP
Substitute itself can be of two types:
- In active substitution, work items are automatically forwarded or appear in the substitutes inbox.
Passive Substitute (also called adopt Substitute)
- Require the substitutes to explicitly choose to see original agents work item
Refreshing Organisational Plan an Environment
- The organisation plan is buffered for efficiency.
- Changing an organisation plan will not immediately be updated in the buffer, and hence can create confusion especially for workflows using the plan for agent determination.
- Typically buffer is refreshed at midnight.
- Alternatively, in development systems, we can trigger refreshing of buffer using transaction: SWU_OBUF
- It should be noted that the buffer afresh is a resource intensive process
- When writing your own programs for buffer afresh, following function modules can be handy: