Module: UU::OS::Group

Extended by:
Group
Included in:
Group
Defined in:
uu_os_client-0.10.6/lib/uu/os/group/group_create.rb,
uu_os_client-0.10.6/lib/uu/os/group.rb,
uu_os_client-0.10.6/lib/uu/os/group/group_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/group/group_set_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/group/group_cancel_activities.rb,
uu_os_client-0.10.6/lib/uu/os/group/group_add_role_interface.rb,
uu_os_client-0.10.6/lib/uu/os/group/group_propagate_activities.rb,
uu_os_client-0.10.6/lib/uu/os/group/group_remove_role_interface.rb,
uu_os_client-0.10.6/lib/uu/os/group/group_get_role_interface_list.rb,
uu_os_client-0.10.6/lib/uu/os/group/group_get_role_interface_list_item.rb

Overview

Module Group.

Defined Under Namespace

Classes: GroupAddRoleInterface, GroupAttributes, GroupCancelActivities, GroupCreate, GroupGetRoleInterfaceList, GroupGetRoleInterfaceListItem, GroupPropagateActivities, GroupRemoveRoleInterface, GroupSetAttributes

Constant Summary

PATH =

Service path

'ues/core/role/UESGroup'

Instance Method Summary (collapse)

Instance Method Details

- (Object) add_role_interface(group_role_uri, group = nil)

This command creates new role interface connection to the specifiedrole. The role interface has to be in an active state and mustn't bealready connected. The role interface has to be connected to the oneof the authorized roles for this command, or the authorized role hasto be casted to the default group of meta model where the roleinterface is located.

Parameters:

  • group_role_uri (String, UU::OS::UESURI)

    UESURI of the group rolewhere the role interface will be connected

  • group (GroupAddRoleInterface) (defaults to: nil)

    DTO containing role interface that to be connected



148
149
150
151
152
153
154
155
# File 'uu_os_client-0.10.6/lib/uu/os/group.rb', line 148

def add_role_interface(group_role_uri, group = nil)
  svc = UU::OS::REST::RemoteClient.new(Group)
  payload = UU::OS::Group::GroupAddRoleInterface.new(group).to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    svc.post('addRoleInterface', group_role_uri, payload)
  end
end

- (Object) cancel_activities(group_role_uri, group = nil)

This command cancels activities which exist due to group roles for thespecified roles.

Parameters:

  • group_role_uri (String, UU::OS::UESURI)

    UESURI of the group role withactivities

  • group (GroupCancelActivities) (defaults to: nil)

    DTO containing attributes to cancelingactivities for casted roles



131
132
133
134
135
136
137
138
# File 'uu_os_client-0.10.6/lib/uu/os/group.rb', line 131

def cancel_activities(group_role_uri, group = nil)
  svc = UU::OS::REST::RemoteClient.new(Group)
  payload = UU::OS::Group::GroupCancelActivities.new(group).to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    svc.post('cancelActivities', group_role_uri, payload)
  end
end

- (UU::OS::UESURI) create(location_uri, group = nil)

Creates a new group role. The command creates a new group in a specified location. At the very least meta artifact must be specified in GroupCreate DTO. Competent role for the new group will be selected as the most suitable according to specified container and meta artifact (executive/authorized role with connected interface),or can be also specified in GroupCreate DTO.

Examples:

# Create new group.
UU::OS::Group.create('ues:TERRITORY:FOLDER', :code => 'NEW_GROUP', :name => 'New Group')

# Verifying that new group can be created.
UU::OS::Group.create('ues:TERRITORY:FOLDER', :code => 'NEW_GROUP', :name => 'New Group', :dryRun => true)  

Parameters:

  • location_uri (String, UU::OS::UESURI)

    locationUri UESURI of the folder/org. unit/meta model where the group will be created.

  • group (UU::OS::Group::GroupCreate) (defaults to: nil)

    Specific options.

Options Hash (group):

  • :meta_artifact_uri (String, UU::OS::UESURI)

    UESURI of the meta artifact. Only a meta artifact with the template class of group (not its descendants) can be used. If the rights does not permit to create a new group from the meta artifact in the specified location, the create command fails.

  • :name (String)

    Name of the new group. When null is set, tName from meta artifact is used if set, otherwise the create command fails.

  • :code (String)

    Code of the new group. When null is set, the code is generated automatically using the system sequence. The code must be unique in the given territory, otherwise the create command fails.

  • :description (String)

    Description of the new group. When null is set, tDescription from meta artifact is used if set, otherwise no description is set on thenew group.

  • :competent_role_uri (String, UU::OS::UESURI)

    UESURI of the competent role. When null is set, the executive role from authorization is used. If no role is authorized to create the group into specified container, the create command fails. If the selected role doesn’t have connected the role interface with the selected meta artifact, the create command fails. If the selected role doesn’t belong to the same organizational unit as the new group role or if it doesn’t belong to one of superior organizational units, the create command fails.

  • :security_level (String)

    Security level. When null is set, security level is taken from the meta artifact tSecurityLevel. If the meta artifact tSecurityLevel is higher than the user’s security clearance, the create command fails.

  • :searchable_in_territory (Boolean)

    Specifies if it is possible to search the new group in its territory. When null is set, tSearchableInTerritory from meta artifact is used if set, otherwise the create command fails.

  • :icon_uri (String, UU::OS::UESURI)

    URI of the group’s icon. When null is set, the group uses icon from meta artifact.

    Allowed format URI of icon:ues:#system:#UU::OS::Group.ues_v5ues_v5.core_v1ues_v5.core_v1.codetable_v1ues_v5.core_v1.codetable_v1.base_v1ues_v5.core_v1.codetable_v1.base_v1.CodeTable_Icons:#CODE_OF_ICON

    For example:ues:#system:#UU::OS::Group.ues_v5ues_v5.core_v1ues_v5.core_v1.codetable_v1ues_v5.core_v1.codetable_v1.base_v1ues_v5.core_v1.codetable_v1.base_v1.CodeTable_Icons:#ART_077

  • :grant_all_from_organizational_unit (Boolean)

    Specifies if the group will be included among All roles from organizational unit. When true or null is set, the role will be included, otherwise it will not be included among All roles from organizational unit.

  • :dry_run (Boolean)

    Specifies whether this is only a test run to verify that the object can be created. The default value is false.

Returns:



52
53
54
55
56
57
58
59
60
# File 'uu_os_client-0.10.6/lib/uu/os/group.rb', line 52

def create(location_uri, group = nil)
  svc = UU::OS::REST::RemoteClient.new(Group)
  payload = UU::OS::Group::GroupCreate.new(group).to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.post('create', location_uri, payload)
    return UU::OS::UESURI.new(res)
  end
end

- (Object) delete(group_uri)

This command deletes the specified group role from the system. The group is deleted even if it contains a locked sheet or attachment. The group cannot be deleted when: the group is notin an active cast, the group's workflow is not created, a property contains a reference to this group, a time sheet exists with a reference to this group, an activity exists with this role as competent role.

Parameters:

  • group_uri (String, UU::OS::UESURI)

    UESURI of the group which is about to be deleted.



103
104
105
106
107
108
# File 'uu_os_client-0.10.6/lib/uu/os/group.rb', line 103

def delete(group_uri)
  svc = UU::OS::REST::RemoteClient.new(Group)
  UU::OS::QoS::QoSHandler.auto_retry do
    svc.post('delete', group_uri)
  end
end

- (GroupAttributes) get_attributes(group_uri)

This command returns attributes representing the group role specified bythe groupRoleUri parameter. The command does not change the state ofthe group in the system.

Parameters:

  • group_uri (String, UU::OS::UESURI)

    UESURI of a group whoseattributes are returned

Returns:



69
70
71
72
73
74
75
# File 'uu_os_client-0.10.6/lib/uu/os/group.rb', line 69

def get_attributes(group_uri)
  svc = UU::OS::REST::RemoteClient.new(Group)
  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.get('getAttributes', group_uri)
    return Group::GroupAttributes.new(res)
  end
end

- (UU::OS::REST::ResultList<Group::GroupGetRoleInterfaceList, Group::GroupGetRoleInterfaceListItem>) get_role_interface_list(group_role_uri, criteria = nil)

Returns list of the role interfaces that are connected to the specifiedgroup role. The list of returned interfaces could be filtered by thename or code. Returned list does not contain any objects filteredout by executed UESQuery. The list is sorted by the name (and bycode in case are equal) of an interface by default.

Available parameters are: name and code

See UESQuery Documentation.

Parameters:

  • group_role_uri (String, UU::OS::UESURI)

    UESURI of the access role for which the connected roleinterfaces are to be listed

  • criteria (GroupGetRoleInterfaceList) (defaults to: nil)

    DTO containing criteriafor listing access role interfaces.

Returns:



184
185
186
187
188
189
190
191
192
193
194
# File 'uu_os_client-0.10.6/lib/uu/os/group.rb', line 184

def get_role_interface_list(group_role_uri, criteria = nil)
  svc = UU::OS::REST::RemoteClient.new(Group)
  dto = Group::GroupGetRoleInterfaceList.new(criteria)
  svc.add_parameter('pageIndex', dto.page_index)
  svc.add_parameter('pageSize', dto.page_size)
  svc.add_parameter('query', dto.query)
  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.get('getRoleInterfaceList', group_role_uri)
    return UU::OS::REST::ResultList.new(Group::GroupGetRoleInterfaceList, Group::GroupGetRoleInterfaceListItem, res)
  end
end

- (Object) propagate_activities(group_uri, group = nil)

This command propagates activities of the group to its casted roles orcasted groups. Only the active activities are propagated, it meansthat they have a state and the state must not be final.

groupwith groupRoleUri and into which the activities will be propagated

Parameters:

  • group_uri (String, UU::OS::UESURI)

    UESURI of the group which activities will be propagated

  • group (GroupPropagateActivities) (defaults to: nil)

    UESURIs of the roles which must be casted into



117
118
119
120
121
122
123
124
# File 'uu_os_client-0.10.6/lib/uu/os/group.rb', line 117

def propagate_activities(group_uri, group = nil)
  svc = UU::OS::REST::RemoteClient.new(Group)
  payload = UU::OS::Group::GroupPropagateActivities.new(group).to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    svc.post('propagateActivities', group_uri, payload)
  end
end

- (Object) remove_role_interface(group_role_uri, group = nil)

The command removes role interface connection from the specified grouprole. Only connected interfaces can be disconnected from the grouprole.

Parameters:

  • group_role_uri (String, UU::OS::UESURI)

    UESURI of the group role where the roleinterface will be disconnected

  • group (GroupRemoveRoleInterface) (defaults to: nil)

    DTO containingrole interface that to be disconnected



162
163
164
165
166
167
168
169
# File 'uu_os_client-0.10.6/lib/uu/os/group.rb', line 162

def remove_role_interface(group_role_uri, group = nil)
  svc = UU::OS::REST::RemoteClient.new(Group)
  payload = UU::OS::Group::GroupRemoveRoleInterface.new(group).to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    svc.post('removeRoleInterface', group_role_uri, payload)
  end
end

- (UU::OS::UESURI) set_attributes(group_uri, group = nil)

Command for setting attributes of a group role. The command can't modifyreferences to objects like location, competent role and so on.

Parameters:

  • group_uri (String, UU::OS::UESURI)

    UESURI of the group whose attributes are to bechanged

  • group (GroupSetAttributes) (defaults to: nil)

    DTO containing new attributes the group

Returns:



84
85
86
87
88
89
90
91
92
# File 'uu_os_client-0.10.6/lib/uu/os/group.rb', line 84

def set_attributes(group_uri, group = nil)
  svc = UU::OS::REST::RemoteClient.new(Group)
  payload = UU::OS::Group::GroupSetAttributes.new(group).to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.post('setAttributes', group_uri, payload)
    return UU::OS::UESURI.new(res)
  end
end