The Role component is used to retrieve or update information about a role. You can create roles and assign parameters and permissions to roles.
You can associate any data with a particular role by using the Role.store*Property() set of methods. To retrieve previously stored data, use the Role.retrieve*Property() set of methods.
In this example, the Role component is used to retrieve information about a role id:
reviewerRole = Role("reviewer")
display "Description: " + reviewerRole.description +
"\nRole ID: " + reviewerRole.id +
"\nName: " + reviewerRole.name +
"\nOrganization: " + reviewerRole.organization +
"\nIs this a parametric Role: " + myrole.parametric
In this example, the Role component is used to retrieve the participants who are assigned to the current role.
In this example, the Activity component is used to access an instance of Role representing the current role. This instance of Role represents the actual role (as defined on the Enterprise runtime environment), and not the abstract role as defined in Studio)
currentRole = Activity.role
for each p in currentRole.participants
do
display "Participants: " + p.id
end
In this example, the Role component is used to add a parameter to a role:
addParameter regionMgrRole
using parameter = "WEST"
display "Added parameter WEST to Region Manager Role"
In this example, the Role component is used to retrieve a role's parametric values:
for each region in regionMgrRole.parametricValues
do
display "Region for Region Manager Role: " + region
end
In this example, the Role component is used to find a role that has a defined parametric value:
eastMgrRole = myrole.findParametric(name : "RegionManager", parameter : "EAST") display "This is RegionManager with parameter 'EAST': " + eastMgrRole.name display "Its parameter is: " + eastMgrRole.parametricValue