Module: UU::OS::Role
- Extended by:
- Role
- Included in:
- Role
- Defined in:
- uu_os_client-0.10.6/lib/uu/os/role/role_create.rb,
uu_os_client-0.10.6/lib/uu/os/role.rb,
uu_os_client-0.10.6/lib/uu/os/role/role_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/role/role_set_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/role/role_get_artifact_list.rb,
uu_os_client-0.10.6/lib/uu/os/role/role_add_role_interface.rb,
uu_os_client-0.10.6/lib/uu/os/role/role_remove_role_interface.rb,
uu_os_client-0.10.6/lib/uu/os/role/role_get_artifact_list_item.rb,
uu_os_client-0.10.6/lib/uu/os/role/role_get_role_interface_list.rb,
uu_os_client-0.10.6/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)
This command 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)
This command deletes the specified role from the system.
-
- (UU::OS::REST::ResultList<Role::RoleGetArtifactList, Role::RoleGetArtifactListItem>) get_artifact_list(role_uri, criteria = nil)
This command returns a list of entries representing the artifacts for that the specified role is competent.
-
- (RoleAttributes) get_attributes(role_uri)
This command 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)
The command 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)
This command 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.
140 141 142 143 144 145 146 147 |
# File 'uu_os_client-0.10.6/lib/uu/os/role.rb', line 140 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.
54 55 56 57 58 59 60 61 62 |
# File 'uu_os_client-0.10.6/lib/uu/os/role.rb', line 54 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) return UU::OS::UESURI.new(res) end end |
- (Object) delete(role_uri)
This command 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 when:
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
105 106 107 108 109 110 |
# File 'uu_os_client-0.10.6/lib/uu/os/role.rb', line 105 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)
This command 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.
120 121 122 123 124 125 126 127 128 129 130 |
# File 'uu_os_client-0.10.6/lib/uu/os/role.rb', line 120 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)
This command returns attributes representing the role specified by theroleUri parameter. The command does not change the state of the role in the system.
70 71 72 73 74 75 76 |
# File 'uu_os_client-0.10.6/lib/uu/os/role.rb', line 70 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.
172 173 174 175 176 177 178 179 180 181 182 |
# File 'uu_os_client-0.10.6/lib/uu/os/role.rb', line 172 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)
The command removes role interface connection from the specified role.Only connected interfaces can be disconnected from role.
154 155 156 157 158 159 160 161 |
# File 'uu_os_client-0.10.6/lib/uu/os/role.rb', line 154 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.
85 86 87 88 89 90 91 92 93 |
# File 'uu_os_client-0.10.6/lib/uu/os/role.rb', line 85 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 |