You can use a team filter service to dynamically
prevent certain users from being assigned to an activity. The filtering
can be based on any criteria and can use input parameters from relevant
process variables to determine which users to filter out.
To define a team filter service, you first define the input variables
that the service receives with the input team object, then you implement
the service so that it eliminates ineligible users and returns a team
object that contains the remaining users who can be assigned.
Before you begin
You have assigned an activity to a team or a lane, as described
in
Assigning activities, and in the
Team Filter Service section, you clicked
New.
About this task
The team filter service is optional. If you choose to use
it, the filter is applied to the static team associated with an activity
or to the dynamic team returned by a team retrieval service. The results
of the team filter service are then subject to the selected user distribution.
Using a team filter service allows the team to be narrowed down according
to whatever criteria or policies you choose to implement.
Procedure
- Enter a suitable name for the service, for example, High Value Claims Team Filter Service or Separation of duties - filter out previous user.
- Select the Variables tab. The mandatory input and output variables are already present and
are locked. If the new team filter service requires information from
the activity, click Add Input to specify more
input parameters. In the Details section, specify
the name of the variable, its type, and any default value.
Tip: The input variables that are required depend on the policy
that the filter must implement. If, for example, certain users cannot
work on tasks that are above a certain value, the service might need
the process variable tw.local.estimatedClaimAmount as an input parameter that the service implementation uses to determine
which users to eliminate from the input team. Similarly, for example,
to implement a separation of duties policy, where the user who completed
the previous activity cannot be assigned to the following one, you
might specify an input variable previousUser that
you map to the process variable tw.system.user.id so that the service implementation can remove the previous user
from the input team.
- 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 optionally include the name of
a team of managers, and optionally the name of the team (this parameter
is ignored).
- If you want the results of the service to be cached for each
combination of input variables, 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.
- When caching is disabled, the Cache results for section is not displayed.
- When caching is enabled, the Cache results for section is displayed. By default, when caching is enabled, the results
for each combination of input parameters are kept in the cache for
12 hours. To change the caching period, use the Days, Hours, Minutes, and Seconds fields to select the duration that you want.
Important: Depending on the size of the results, you might need
to tune the size of the service results cache to avoid memory problems.
By default, the cache stores up to 4096 results. You can change the
size of the cache by setting a different value for <service-result-cache-size> in the 100Custom.xml file, inside the <server merge="mergeChildren"> section.
Restriction: The service results cache setting only
works for top level services. When a service is called by another
service, the service results cache setting for the nested service
is ignored and the results for the nested service are not cached.
- If the team filter service that you selected requires more
parameters, then the Team Filter Service Input Mapping section is displayed. For each required parameter, enter
the corresponding process variable name or literal, for example tw.local.estimatedClaimAmount or 8000.
Results
The new team filter service is added to the list of team filter
services that you can select when you assign a team to an activity.
What to do next
Apply the new team filter service to the team that is assigned
to an activity by completing
Assigning activities.