Module: UU::OS::Group
- Extended by:
- Group
- Included in:
- Group
- Defined in:
- uu_os-0.29.16/lib/uu/os/group/group_create.rb,
uu_os-0.29.16/lib/uu/os/group.rb,
uu_os-0.29.16/lib/uu/os/group/group_attributes.rb,
uu_os-0.29.16/lib/uu/os/group/group_set_attributes.rb,
uu_os-0.29.16/lib/uu/os/group/group_cancel_activities.rb,
uu_os-0.29.16/lib/uu/os/group/group_add_role_interface.rb,
uu_os-0.29.16/lib/uu/os/group/group_propagate_activities.rb,
uu_os-0.29.16/lib/uu/os/group/group_remove_role_interface.rb,
uu_os-0.29.16/lib/uu/os/group/group_get_role_interface_list.rb,
uu_os-0.29.16/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)
-
- (Object) add_role_interface(group_role_uri, group = nil)
Creates new role interface connection to the specified role.
-
- (Object) cancel_activities(group_role_uri, group = nil)
Cancels activities which exist due to group roles for the specified roles.
-
- (UU::OS::UESURI) create(location_uri, group = nil)
Creates a new group role.
-
- (Object) delete(group_uri)
Deletes the specified group role from the system.
-
- (GroupAttributes) get_attributes(group_uri)
Returns attributes representing the group role specified by the group_uri parameter.
-
- (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 specified group role.
-
- (Object) propagate_activities(group_uri, group = nil)
Propagates activities of the group to its casted roles or casted groups.
-
- (Object) remove_role_interface(group_role_uri, group = nil)
Removes role interface connection from the specified group role.
-
- (UU::OS::UESURI) set_attributes(group_uri, group = nil)
Command for setting attributes of a group role.
Instance Method Details
- (Object) add_role_interface(group_role_uri, group = nil)
Creates new role interface connection to the specified role. The role interface has to be in an active state and must not be already connected. The role interface has to be connected to the one of the authorized roles for this command, or the authorized role has to be casted to the default group of meta model where the role interface is located.
197 198 199 200 201 202 203 204 |
# File 'uu_os-0.29.16/lib/uu/os/group.rb', line 197 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)
Cancels activities which exist due to group roles for the specified roles.
173 174 175 176 177 178 179 180 |
# File 'uu_os-0.29.16/lib/uu/os/group.rb', line 173 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.
53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'uu_os-0.29.16/lib/uu/os/group.rb', line 53 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) # res is nil if dry_run was set to true. In that case, return nil (do nothing) if !(res.nil? || res.empty?) return UU::OS::UESURI.new(res) end end end |
- (Object) delete(group_uri)
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 if: the group is not in 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.
133 134 135 136 137 138 |
# File 'uu_os-0.29.16/lib/uu/os/group.rb', line 133 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)
Returns attributes representing the group role specified by the group_uri parameter. The command does not change the state of the group in the system.
77 78 79 80 81 82 83 |
# File 'uu_os-0.29.16/lib/uu/os/group.rb', line 77 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 specified group role. The list of returned interfaces could be filtered by the name or code. Returned list does not contain any objects filtered out by executed UESQuery. The list is sorted by the name (and by code in case are equal) of an interface by default.
248 249 250 251 252 253 254 255 256 257 258 |
# File 'uu_os-0.29.16/lib/uu/os/group.rb', line 248 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)
Propagates activities of the group to its casted roles or casted groups. Only the active activities are propagated, it means that they have a state and the state must not be final.
153 154 155 156 157 158 159 160 |
# File 'uu_os-0.29.16/lib/uu/os/group.rb', line 153 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)
Removes role interface connection from the specified group role. Only connected interfaces can be disconnected from the group role.
218 219 220 221 222 223 224 225 |
# File 'uu_os-0.29.16/lib/uu/os/group.rb', line 218 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 cannot modify references to objects like location, competent role and so on.
110 111 112 113 114 115 116 117 118 |
# File 'uu_os-0.29.16/lib/uu/os/group.rb', line 110 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 |