Show TOC

Using Substitution Rules with the BPM APILocate this document in the navigation structure

The Business Process Management (BPM) application programming interfaces (APIs) allow you to customize and enhance the way you use business processes and execute tasks.

This document describes how to use the BPM APIs to create, read, update, and delete substitution rules.

Substitution rules allow users to act as substitutes of other users. For example, you can do the following:

  • Assign another user to manage your task

  • Receive (fill in) your task

  • Create multiple substitution rules to cover all options

  • Accept tasks from other users

The substituted user is the user whose tasks are taken over by another user. The user who is taking over these tasks is named as the substitute or substituting user.

For a detailed description of the BPM public API, see http://help.sap.com/javadocs.

Authorization Concept of the SubstitutionRulesManager

You need special authorizations to create, read, update, and delete substitution rules. For each operation a permission check is defined in the SubstitutionRulesManager of the BPM public API. If the user does not have the authorization for an operation, an exception (BPMIllegalAccessException) is thrown.

For more information about authorizations, roles, and actions, see Authorizations and Roles.

Read Operations

If you want to perform read operations on substitution rules, the SAP_BPM_Substitution_ReadAll action must be assigned to your user. As a substituted user, you are also authorized to perform read operations, but with restrictions: For rules that potentially return multiple substitution rules, the result set only contains rules for which the caller is authorized. When querying for user information, the executing user must be the same as specified as the query parameter.

To retrieve information about substitution rules, the SubstitutionRulesManager of the BPM public API provides the following get methods.

  • getActiveRulesBySubstitute

    Retrieves all active rules for which the given user is the substituting user.

  • getActiveRulesBySubstitutedUser

    Retrieves all active rules for which the given user is the substituted user.

  • getRules

    Retrieves all substitution rules that match the given parameters. Each parameter can be null - in this case these parameters will be ignored in the search query.

  • getRulesBySubstitute

    Retrieves all rules for which the given user is the substituting user.

  • getRulesBySubstitutedUser

    Retrieves all rules for which the given user is the substituted user.

  • getSubstitutedUsers

    Retrieves all the users who the given substitute is substituting. Checks only active rules.

  • getSubstitutedUsersIds

    Retrieves all the IDs of the users who the given substitute is substituting according to an active substitution rule.

  • getSubstituteUsers

    Retrieves all the users who are substituting the given substituted user. Checks only active rules.

  • getUsersByActiveRules

    Maps the given users to a matching set of users currently in charge as defined by substitution rules. The returned set contains the substituting user for a given user, or if there is none, the given user itself.

Create Operations

If you want to create a substitution rule, the SAP_BPM_Substitution_CreateAll action must be assigned to your user or user role, or you are the substituted user.

You can use the createRule method to create a new substitution rule. This substitution rule is not automatically persisted. To persist it, use the ruleStore method. You can also assign a substitution profile to the rule. For more information, see Using Substitution Profiles with the BPM API.

Update Operations

If you want to modify a substitution rule, the SAP_BPM_Substitution_UpdateAll action must be assigned to your user or user role, or you are the substituted user in both the current and the modified version of the rule.

Delete Operations

If you want to delete a substitution rule, the SAP_BPM_Substitution_DeleteAll action must be assigned to your user or user role, or you are the substituted user.