You can define a team retrieval service that dynamically
returns a set of users and managers at run time.
About this task
A team retrieval service can use custom defined input
parameters to resolve a set of team members and team managers.
Procedure
To create a team that is dynamically resolved, complete the following steps in the
designer:
- Open the designer.
- In the library, click the plus sign (+) next to the Teams
category.
- In the New Team window, enter a name for the team and click
Finish.
- In the team editor, under Behavior, choose to specify team members
by using a service.
You can select an existing service flow create a new one that is
enabled for use as a team retrieval service:
- Click New, specify the name of the new service flow, and click
Finish to complete the wizard.
- Enter a suitable name for the service, for example,
Claims Team Retrieval
Service.
- Click the Variables tab.
The mandatory input and output variables are already present and are locked. Additional input
parameters can be populated by the team itself. The team can assign static values and environment
variables that are passed as data into the additional input variables.
Limitation: Updating shared business objects in a team retrieval service is not supported
when the same shared business object is updated within the same execution unit in the process
beforehand. Shared business objects can either be saved explicitly or automatically by enabling
"Automatically sync shared business objects" in the team retrieval service. In general, consider a
team retrieval service conceptually as a read-only service flow.
Important: If you
want to use this dynamic team as the managers of another team, you can use only additional input
parameters that have default values that are defined for them.
-
Select the Diagram tab and provide the implementation of the service.
Based on the input parameters, the service must return a
Team object that contains
a list of team members. It can also include the name of a team of managers, and the name of the team
(this parameter is ignored).
For example:
// get a new team object
var resultTeam = new tw.object.Team();
var members= [];
// push members (users and groups) into the array
members.push("Group1");
members.push("User1");
// set members in result team
resultTeam.members=members;
// set the result team
tw.local.team = resultTeam;
-
If you want the results of the service to be cached for each combination of input parameter
values, select the Overview tab, then in the Service Result
Cache section, select Enable caching of service results to
display the cache configuration fields. By default, caching is disabled.
- To use an existing team retrieval service, complete the
following steps.
- Click Select. A selection dialog
is displayed that lists all existing services that match the team
retrieval service template.
- Select the team retrieval service that you want to use.
If the team retrieval service that you selected requires extra
parameters, then the Team Retrieval Service Input Mapping section
is displayed.
- Click Save or
Finish Editing.
For details about declaring
variables for the client-side human services, see
Declaring variables
Results
The team's members are determined dynamically by the appropriate team retrieval service. If
you defined a new team retrieval service, you can select it when you assign activities to teams. See
Assigning teams to process activities.