Module: UU::OS::Role
- Extended by:
- Role
- Included in:
- Role
- Defined in:
- uu_os-0.29.16/lib/uu/os/role/role_create.rb,
uu_os-0.29.16/lib/uu/os/role.rb,
uu_os-0.29.16/lib/uu/os/role/role_attributes.rb,
uu_os-0.29.16/lib/uu/os/role/role_set_attributes.rb,
uu_os-0.29.16/lib/uu/os/role/role_get_artifact_list.rb,
uu_os-0.29.16/lib/uu/os/role/role_add_role_interface.rb,
uu_os-0.29.16/lib/uu/os/role/role_remove_role_interface.rb,
uu_os-0.29.16/lib/uu/os/role/role_get_artifact_list_item.rb,
uu_os-0.29.16/lib/uu/os/role/role_get_role_interface_list.rb,
uu_os-0.29.16/lib/uu/os/role/role_get_role_interface_list_item.rb
Overview
Module Role.
Defined Under Namespace
Classes: RoleAddRoleInterface, RoleAttributes, RoleCreate, RoleGetArtifactList, RoleGetArtifactListItem, RoleGetRoleInterfaceList, RoleGetRoleInterfaceListItem, RoleRemoveRoleInterface, RoleSetAttributes
Constant Summary
- PATH =
Service path
'ues/core/role/UESRole'
Instance Method Summary (collapse)
-
- (Object) add_role_interface(role_uri, role = nil)
Creates new role interface connection to the specified role.
-
- (UU::OS::UESURI) create(location_uri, role = nil)
Creates a new role.
-
- (Object) delete(role_uri)
Deletes the specified role from the system.
-
- (UU::OS::REST::ResultList<Role::RoleGetArtifactList, Role::RoleGetArtifactListItem>) get_artifact_list(role_uri, criteria = nil)
Returns a list of entries representing the artifacts for that the specified role is competent.
-
- (RoleAttributes) get_attributes(role_uri)
Returns attributes representing the role specified by theroleUri parameter.
-
- (UU::OS::REST::ResultList<Role::RoleGetRoleInterfaceList, Role::RoleGetRoleInterfaceListItem>) get_role_interface_list(role_uri, criteria = nil)
Returns list of the role interfaces that are connected to the specified role.
-
- (Object) remove_role_interface(role_uri, role = nil)
Removes role interface connection from the specified role.Only connected interfaces can be disconnected from role.
-
- (UU::OS::UESURI) set_attributes(role_uri, role = nil)
Command for setting attributes of a role.
Instance Method Details
- (Object) add_role_interface(role_uri, role = nil)
Creates new role interface connection to the specified role. The role interface has to be in an active state and mustn't 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.
176 177 178 179 180 181 182 183 |
# File 'uu_os-0.29.16/lib/uu/os/role.rb', line 176 def add_role_interface(role_uri, role = nil) svc = UU::OS::REST::RemoteClient.new(Role) payload = UU::OS::Role::RoleAddRoleInterface.new(role).to_json UU::OS::QoS::QoSHandler.auto_retry do svc.post('addRoleInterface', role_uri, payload) end end |
- (UU::OS::UESURI) create(location_uri, role = nil)
Creates a new role. The command creates a new role in a specified location.At the very least meta artifact must be specified in RoleCreate DTO. Competent role for the new role 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 RoleCreate DTO.
53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'uu_os-0.29.16/lib/uu/os/role.rb', line 53 def create(location_uri, role = nil) svc = UU::OS::REST::RemoteClient.new(Role) payload = UU::OS::Role::RoleCreate.new(role).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(role_uri)
Deletes the specified role from the system. The role is deleted even if it contains a locked sheet or attachment. The role cannot be deleted if:
the role is not in an active cast
the role's workflow is not created
a property contains a reference to this role
a time sheet exists with a reference to this role
an artifact exists with this role as competent role
an activity exists with this role as competent role
130 131 132 133 134 135 |
# File 'uu_os-0.29.16/lib/uu/os/role.rb', line 130 def delete(role_uri) svc = UU::OS::REST::RemoteClient.new(Role) UU::OS::QoS::QoSHandler.auto_retry do svc.post('delete', role_uri) end end |
- (UU::OS::REST::ResultList<Role::RoleGetArtifactList, Role::RoleGetArtifactListItem>) get_artifact_list(role_uri, criteria = nil)
Returns a list of entries representing the artifacts for that the specified role is competent. The list is sorted by the name(and codes in case are equal) of a entry by default.
150 151 152 153 154 155 156 157 158 159 160 |
# File 'uu_os-0.29.16/lib/uu/os/role.rb', line 150 def get_artifact_list(role_uri, criteria = nil) svc = UU::OS::REST::RemoteClient.new(Role) dto = Role::RoleGetArtifactList.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('getArtifactList', role_uri) return UU::OS::REST::ResultList.new(Role::RoleGetArtifactList, Role::RoleGetArtifactListItem, res) end end |
- (RoleAttributes) get_attributes(role_uri)
Returns attributes representing the role specified by theroleUri parameter. The command does not change the state of the role in the system.
76 77 78 79 80 81 82 |
# File 'uu_os-0.29.16/lib/uu/os/role.rb', line 76 def get_attributes(role_uri) svc = UU::OS::REST::RemoteClient.new(Role) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getAttributes', role_uri) return Role::RoleAttributes.new(res) end end |
- (UU::OS::REST::ResultList<Role::RoleGetRoleInterfaceList, Role::RoleGetRoleInterfaceListItem>) get_role_interface_list(role_uri, criteria = nil)
Returns list of the role interfaces that are connected to the specified role. Returned list does not contain any objects filtered out by executed UESQuery.
217 218 219 220 221 222 223 224 225 226 227 |
# File 'uu_os-0.29.16/lib/uu/os/role.rb', line 217 def get_role_interface_list(role_uri, criteria = nil) svc = UU::OS::REST::RemoteClient.new(Role) dto = Role::RoleGetRoleInterfaceList.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', role_uri) return UU::OS::REST::ResultList.new(Role::RoleGetRoleInterfaceList, Role::RoleGetRoleInterfaceListItem, res) end end |
- (Object) remove_role_interface(role_uri, role = nil)
Removes role interface connection from the specified role.Only connected interfaces can be disconnected from role.
196 197 198 199 200 201 202 203 |
# File 'uu_os-0.29.16/lib/uu/os/role.rb', line 196 def remove_role_interface(role_uri, role = nil) svc = UU::OS::REST::RemoteClient.new(Role) payload = UU::OS::Role::RoleRemoveRoleInterface.new(role).to_json UU::OS::QoS::QoSHandler.auto_retry do svc.post('removeRoleInterface', role_uri, payload) end end |
- (UU::OS::UESURI) set_attributes(role_uri, role = nil)
Command for setting attributes of a role. The command can't modify references to objects like location, competent role and so on.
105 106 107 108 109 110 111 112 113 |
# File 'uu_os-0.29.16/lib/uu/os/role.rb', line 105 def set_attributes(role_uri, role = nil) svc = UU::OS::REST::RemoteClient.new(Role) payload = UU::OS::Role::RoleSetAttributes.new(role).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('setAttributes', role_uri, payload) return UU::OS::UESURI.new(res) end end |