about us      downloads      documentation      contact      home 
 products
 antHR
 workflow studio
 technical toolkits
 content entry
 workflow
 security
 hierarchy
 concepts
 how tos
 reference
 FAQs

Responsible script

In order to select users and groups at various points in the system a responsible script is used. It provides various methods of selecting which user or group is to be used.

By right clicking in text boxes that require responsible script, you are given a menu which helps author scripting commands.

 

Examples

In this example we will assume that we have 3 users called Ann, Bob and Carol all in provider "DB". In terms of relationships, Ann manages Bob and Bob manages Carol. Bob and Carol are both in the "Development" group.

Example 1: Select a user by name.

Script: User("DB/Ann")


Output: User called Ann from provider DB.

This is a trivial example that requires little explanation. In general it is not good practice to assign tasks to users, it is better to assign them to groups or to users who have been selected in parameters (see below).

Example 2: Select a group by name.

Script: Group("Development")


Output: Group called Development.

This example returns a group rather than a user, while not every area of the system can operate with groups they are used by activities, and tasks can be assigned to groups rather than individuals.

Example 3: Get owner of the workflow.

Script: Owner


Output: Returns the owner of the workflow

This command returns the owner of the workflow

Example 4: Get user from a parameter.

Script: Param("requestedReviewer")


Output: User or group who is specified in the field "requestedReviewer" of the parameters of the workflow

This is the way to access the parameters of the workflow and get a user or group from them.

Example 5: Gets a user from a relationship.


Script: Relationship("Line management", BToA, Creator, User("DB/Ann"))


Output: User who is the manager of the creator of the workflow. If the user does not have a line manager, then the user Ann is selected. If the direction was AToB instead then a direct report of the creator would be selected.
This command allows relationships to be followed. It powerfully allows the line manager or project manager of any user in the system to be selected. In this example if the creator of the workflow is Ann (who has no line manager), then Ann is the result of the relationship.

Command reference

Command Parameters Description Example
Owner   Returns the owner of the workflow, this is the creator of the workflow unless explicitly altered. Owner
Creator   Returns the creator of the workflow Creator
LastActor   Returns the actor who completed the last activity, this command is only valid in the activity definition responsible. LastActor
User User: Quoted string representing the full username of the user Returns the named user User("DB/Ann")
Group Group: Quoted string representing the name of the group Returns the named group. Group("Administrators")
Param Parameter name: Quoted string which represents the name of the field in the parameters which holds a user or a group. Returns the user or group which is specified in the workflow parameter Param("parameterName")
Case Case name: Quoted string which represents the name of the field in the case which holds a user or a group. Returns the user or group which is specified in the workflow case Case("fieldName")
Relationship

Relationship name: Name of the relationship type
Direction: value of either AToB or BToA which specifies in which direction to follow the relationship
User: Responsible string representing the user who is at the start of the relationship
Default user: User who is selected if the result of the relationship is undefined (eg, the user has no project manager).

Returns the user at the far end of the relationship specified. If no user is at the far end of the relationship, then the default user is returned. Relationship("Line management", BToA, User("DB/Carol"), User("DB/Ann"))

Did you find this article helpful? Comments on this page are welcome and can only help us improve the quality of our documentation.
© Ant Organisation Ltd, 2003