With process choreographer you can separate your business process logic from the staff resolution. Staff queries are resolved using a plug-in that is specific to the directory service. Some examples of using the staff service are described here:
For detailed information on the staff resolution plug-ins, refer to the Process
Choreographer: Staff Resolution Architecture and the Process
Choreographer: Programming Model for Staff Resolution White papers
in
DeveloperWorks WebSphere
Staff queries using the staff support service
You can use WebSphere Studio Application Developer Integration Edition to define staff queries for the staff support service. Staff queries are templates that define how to retrieve the list of users authorized for a certain work item. You can use the abstract query templates (staff verbs) in the WebSphere Studio process editor when you model a business process. These staff verbs are transformed during deployment into a set of queries that can be run on a staff repository.
Before the initial staff query verbs in the process editor and the parameterized verbs in the process models can be run as queries on a specific staff repository, they must be translated into executable queries using an XSL transformation. The result of a transformation (mapping) can be run by staff resolution plug-ins that provide access to specific directories, such as LDAP or the user registry. At run time, the plug-in runs the query by invoking the staff repository APIs and by creating the list of authorized user IDs for the corresponding work item.
During process deployment, the staff support service is invoked to deploy the staff query. The staff service retrieves the staff plug-in provider configuration with the corresponding Java Naming and Directory Interface (JNDI) name. The JNDI name is set in WebSphere Studio, the default is the user registry. The staff support service then converts the parameterized staff query verb into a query run by a specific staff resolution plug-in defined in the configuration for the Extensible Stylesheet Language transformation (XSLT) verb mapping file and the staff resolution plug-in. All staff query verbs belonging to a process template must use the same provider configuration.
The following example illustrates a snippet for a V5.0-style process as generated by the process editor to retrieve the manager of the employee that started the process:
<wf:staff type="staffSupportService"> <staff:verb> <staff:id>Manager of Employee by user ID</staff:id> <staff:name>Manager of Employee by user ID</staff:name> <staff:parameter id="EmployeeUserID"> %wf:process.starter% </staff:parameter> </staff:verb> </wf:staff>
Staff query verb set
The staff support service accepts queries in an abstract form that is independent of the directory infrastructure used. The process editor has a set of predefined staff query verbs. The individual staff resolution plug-ins and the XSLT mapping files do not support all the verbs. The Manager of Employee verb, for example, is not available if you use the user registry or the system plug-in.
The staff query verbs are contained in the VerbSet.xml file. This file is located in:
You can modify this set of staff query verbs. Make your changes to a copy of the file. Ensure that the copied file has a different file name.
The following predefined set of verbs is available. For information on the parameters that you can use with each of the verbs, see Predefined staff verbs and their parameters.
User [username='%wf:process.starter%']This verb is useful for testing processes. This verb is supported by the system, user registry, and LDAP plug-ins. You might need to customize the default mapping XSLT file to match the LDAP schema of your organization.
Explicit staff assignments using the system staff plug-in
The system staff plug-in does not require any configuration parameters; it is preinstalled and ready for use. Using this plug-in, you can hard code user names in your business process. This practice is not normally recommended, but it can be useful for testing if you are using context variables or special queries, as illustrated by the following examples:
<sur:staffQueries> <staff:userID name="%wf:process.starter%"> <staff:userID name="%wf:process.administrators%"> </sur:staffQueries>
<sur:staffQueries> <staff:everybody> </sur:staffQueries>
<sur:staffQueries> <staff:nobody> </sur:staffQueries>
The following XML snippet explicitly retrieves the WebSphere user ID smith:
<staff:staffQueries> <staff:userID name="smith"> </staff:staffQueries>
Staff queries transformed for the user registry staff plug-in
Using this plug-in, staff queries can refer to users and groups that are known to the WebSphere Application Server user registry. This plug-in does not require any configuration parameters, comes preinstalled and is ready for use.
The following XML snippet example retrieves the user IDs of all the members of the Administrators group, and all users whose names begin with Mi:
<sur:staffQueries> <sur:usersOfGroup groupName="Administrators"/> <sur:search type="user" name="Mi*"/> </sur:staffQueries>
This XML snippet is an example of the transformation output.
Staff queries transformed for the LDAP staff plug-in
If you want to use the LDAP plug-in, you probably need to create a customized version of the LDAP XSL transformation to match the LDAP schema of your organization. The standard XSLT provided for LDAP is located:
Make your changes to a copy that has a different file name. When you have made your changes:
The following XML snippet illustrates the results of the LDAP transformation for a search:
<sldap:staffQueries> <sldap:search baseDN="ou=mydivision, o=mycompany, c=us" filter="cn=*" searchScope="onelevelScope" recursive="no"> <sldap:attribute name="uid" objectclass="person" usage="simple"/> </sldap:search> </sldap:staffQueries>