Workflow API

The Workflow API provides the following kinds of information to a custom script in a workflow process:
cim1265
The Workflow API provides the following kinds of information to a custom script in a workflow process:
  • Information about the currently executing 
    CA Identity Manager
     event
  • Information about the administrator who submitted the event
  • Information within the 
    CA Identity Manager
     environment
The workflow script evaluates the information and determines the path of the workflow process accordingly.
Methods in the Workflow API are called from either of the following:
  • A custom workflow script, that is, from scripts in automated workflow activities and scripts in conditional transitions
  • A Java object that is accessed from a workflow script
For more information about using WorkPoint workflow, see the
Administration Guide
.
Workflow API Summary
  • Operation
    Custom objects perform operations during workflow processing.
  • Called by
    A custom script in an automated workflow activity or a workflow conditional transition, or a Java object which is accessed from a workflow script.
  • When called
    When the workflow script is executed.
  • Operates on
    The
    Identity Manager
    event mapped to the workflow process, including
    Identity Manager
    objects contained in the event.
  • Object update
    The run-time instance of the managed object in an event.
  • Can validate?
    No. However, after evaluating the information, the workflow process can move the event to an accepted or rejected state.
Use Case Examples for the Workflow API
The following are examples of how the Workflow API can be used:
  • Determine workflow direction based on a User object attribute
    The first activity in a workflow process for a CreateUserEvent is an automated activity with three conditional transitions leading from it. The condition script in each transition retrieves the email attribute from the User object contained in the event.
    The next activity that the workflow process performs is determined by the outcome of the condition scripts, as follows:
    • In the transition CA.COM SUFFIX, the condition script checks whether the user’s email address ends in ca.com. If it does, the script returns true, and the transition is performed. This transition leads to a single approval activity where the addition of the user is determined by an approver who is assigned the role HR Manager.
    • In the transition SECURITY.COM SUFFIX, the condition script checks whether the user’s email address ends in security.com. If it does, the script returns true, and the transition is performed. This transition leads to an intermediate approval activity (by an approver with the role HR Manager) and a subsequent approval activity (by an approver with the role IT Manager).
    • In the transition EMAIL INVALID, the condition script checks whether the user’s email address ends in something other than ca.com or security.com. If this script returns true, the transition is performed, leading directly to an automated activity that rejects the event CreateUserEvent.
  • Update a
    Identity Manager
    object during a workflow process
    In the previous use case example, suppose the condition script for the transition CA.COM SUFFIX is updated to check whether the email attribute is blank. If it is blank, the script constructs an email address from the user’s ID and the default suffix ca.com. The script assigns the address to the email attribute of the User object. The script then returns true, and the transition is performed as in the previous example. The updated object is saved when
    Identity Manager
    completes the execution of the event.
  • Validate an object from a workflow process using third-party data
    The workflow process for a CreateUserEvent contains an automated activity that retrieves the new user’s credit score from a third-party database. First, the activity script calls the Workflow API to retrieve the event and the User object within the event. Then, after the script retrieves the user’s credit score, it uses the workflow engine’s API to write the credit score to the User Data for the activity, and finally completes the activity. Transition scripts leading from the activity then use the workflow engine’s API to retrieve the credit score from the User Data and evaluate it to determine the subsequent course of the workflow process.