Fuego.Lib : Role

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.

Example 1

In this example, the Role component is used to retrieve information about a role id:

Important: The role ID expected by the Role component is that of the actual role (as defined on the Enterprise runtime environment), and not the abstract role (as defined in Studio). When executing the a project in Studio, the abstract and actual role ids match.
reviewerRole = Role("reviewer")
display "Description: " + reviewerRole.description +
    "\nRole ID: " + reviewerRole.id +
    "\nName: " + reviewerRole.name +
    "\nOrganization: " + reviewerRole.organization +
    "\nIs this a parametric Role: " + myrole.parametric

Example 2

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

Example 3

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"

Example 4

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
 

Example 5

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