Fuego.Lib : OrganizationGroup

The OrganizationGroup component is used to retrieve or update information about an organizational group's properties. You can also use the OrganizationGroup component to add groups, roles and participants to a group. Updates are performed in the Directory Service and are immediately available to the Process Engine.

Example 1

The following example retrieves information about Group1's properties:

mygroup = OrganizationGroup("Group1")
display "ID :" + mygroup.id +
    "\nDisplayname: " + mygroup.displayName +
    "\nEnabled: " + mygroup.enabled +
    "\nDescription: " + mygroup.description +
    "\nName: " + mygroup.name +
    "\nHas Part1: " + hasParticipantAssigned(mygroup, participant : "Part1") +
    "\nHas Role1: " + hasRoleAssigned(mygroup, role : "Role1")
 

Example 2

The following example retrieves all roles that are assigned to a group:

for each g in mygroup.rolesAssignment
do
    display "RoleAssignment: " + g
end
 
// Assign a Role to a Group
addRoleAssignment mygroup
    using role = "Role4",
    parametricValue = "VIP",
    permissions = 0
 
for each g in mygroup.rolesAssignment
do
    display "After adding RoleAssignment: " + g
end

Example 3

The following example adds a participant to a group:

addParticipant mygroup
    using participant = "Part1"

Example 4

The following example retrieves all participants who are assigned to a group:

for each p in mygroup.assignedParticipants
do
    display "Participants: " + p
end

Example 5

The following example removes a participant from a group:

removeParticipant mygroup
    using participant = "Part1"

Example 6

The following example removes a role from a group:

removeRoleAssignment mygroup
    using role = "Role4",
    parametricValue = "VIP"

Example 7

The following example finds a particular group by ID:

group2 = OrganizationGroup.find(name : "Group2")
 
display "ID :" + group2.id +
    "\nDisplayname: " + group2.displayName +
    "\nEnabled" + group2.enabled +
    "\nDescription: " + group2.description