Module: UU::OS::RoleInterface

Extended by:
RoleInterface
Included in:
RoleInterface
Defined in:
uu_os_client-0.10.6/lib/uu/os/role_interface/role_interface_export.rb,
uu_os_client-0.10.6/lib/uu/os/role_interface.rb,
uu_os_client-0.10.6/lib/uu/os/role_interface/role_interface_create.rb,
uu_os_client-0.10.6/lib/uu/os/role_interface/role_interface_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/role_interface/role_interface_set_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/role_interface/role_interface_get_export_data.rb,
uu_os_client-0.10.6/lib/uu/os/role_interface/role_interface_add_meta_artifact.rb,
uu_os_client-0.10.6/lib/uu/os/role_interface/role_interface_remove_meta_artifact.rb,
uu_os_client-0.10.6/lib/uu/os/role_interface/role_interface_get_meta_artifact_list.rb,
uu_os_client-0.10.6/lib/uu/os/role_interface/role_interface_get_meta_artifact_list_item.rb

Overview

Module Role Interface.

Defined Under Namespace

Classes: RoleInterfaceAddMetaArtifact, RoleInterfaceAttributes, RoleInterfaceCreate, RoleInterfaceExport, RoleInterfaceGetExportData, RoleInterfaceGetMetaArtifactList, RoleInterfaceGetMetaArtifactListItem, RoleInterfaceRemoveMetaArtifact, RoleInterfaceSetAttributes

Constant Summary

PATH =

Service path

'ues/core/role/UESRoleInterface'

Instance Method Summary (collapse)

Instance Method Details

- (Object) add_meta_artifact(role_interface_uri, role_interface = nil)

The command creates new meta artifact connection to the specified role interface.

Parameters:

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

    UESURI of the role interface where the meta artifacts will be connected

  • role_interface (RoleInterfaceAddMetaArtifact) (defaults to: nil)

    Object containing meta artifact that to be connected



93
94
95
96
97
98
99
100
# File 'uu_os_client-0.10.6/lib/uu/os/role_interface.rb', line 93

def add_meta_artifact(role_interface_uri, role_interface = nil)
  svc = UU::OS::REST::RemoteClient.new(RoleInterface)
  payload = UU::OS::RoleInterface::RoleInterfaceAddMetaArtifact.new(role_interface).to_json

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

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

Creates a new role interface. The command creates a new role interface in a specified meta model dictionary. At the very least meta artifact,name and code must be specified in RoleInterfaceCreate Object. 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 RoleInterfaceCreate Object.

Parameters:

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

    UESURI of the meta model dictionary where the role interface will be created.

  • role_interface (RoleInterfaceCreate) (defaults to: nil)

    Object containing attributes of the new role interface.

Returns:



32
33
34
35
36
37
38
39
40
# File 'uu_os_client-0.10.6/lib/uu/os/role_interface.rb', line 32

def create(location_uri, role_interface = nil)
  svc = UU::OS::REST::RemoteClient.new(RoleInterface)
  payload = UU::OS::RoleInterface::RoleInterfaceCreate.new(role_interface).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_interface_uri)

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

Parameters:

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

    UESURI of the role interface which is about to be deleted.



82
83
84
85
86
87
# File 'uu_os_client-0.10.6/lib/uu/os/role_interface.rb', line 82

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

- (UU::OS::UESURI) export(role_interface_uri)

Exports a role interface to the XML file, which is saved to the export storage. The export is an asynchronous process.
It is possible to wait for the end of the process. More information in Env::Process and in UU::OS::REST::Future.

Examples:

# Start exporting a role interface.
process_uri = UU::OS::RoleInterface.export('ues:TERRITORY:ROLE_INTERFACE')

# Wait for the end of the process.
export_uri = UU::OS::REST::Future.new(proces).get(:timeout=>600)

Parameters:

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

    UESURI of the role interface to export.

Returns:



154
155
156
157
158
159
160
161
162
# File 'uu_os_client-0.10.6/lib/uu/os/role_interface.rb', line 154

def export(role_interface_uri)
  svc = UU::OS::REST::RemoteClient.new(RoleInterface)
  payload = UU::OS::RoleInterface::RoleInterfaceExport.new(nil).to_json

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

- (RoleInterfaceAttributes) get_attributes(role_interface_uri)

This command returns attributes representing the role interface specified by the roleInterfaceUri parameter. The command does not change the state of the role interface in the system.

Parameters:

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

    UESURI of a role interface whose attributes are returned

Returns:



49
50
51
52
53
54
55
# File 'uu_os_client-0.10.6/lib/uu/os/role_interface.rb', line 49

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

- (UU::OS::UESURI) get_export_data(role_interface_uri, role_interface = nil)

Returns a XML file generated by the export command RoleInterface#export.

Examples:

# Start exporting a role interface
process_uri = UU::OS::RoleInterface.export('ues:TERRITORY:ROLE_INTERFACE')

# Wait for the end of the process.
export_uri = UU::OS::REST::Future.new(process_uri).get(nil, 600)

# Get exported XML file.
exported_data = UU::OS::RoleInterface.get_export_data(export_uri, :requested_mime_type => 'application/xml')

Parameters:

Options Hash (role_interface):

  • :requested_mime_type (String)

    MIME type of the returned value. All possible MIME types can be found as constants in UU::OS::Artifact::ExportMimeType class. ZIP is returned by default.

Returns:

  • (UU::OS::UESURI)

    Data file of an exported role interface (XML or ZIP containing XML).



181
182
183
184
185
186
187
188
189
190
191
# File 'uu_os_client-0.10.6/lib/uu/os/role_interface.rb', line 181

def get_export_data(role_interface_uri, role_interface = nil)
  svc = UU::OS::REST::RemoteClient.new(RoleInterface)
  dto = UU::OS::RoleInterface::RoleInterfaceGetExportData.new(role_interface)
  if dto.requested_mime_type
    svc.add_parameter('requestedMimeType', dto.requested_mime_type)
  end
  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.get('getExportData', role_interface_uri)
    return UU::OS::REST::BinaryValue.new(res, true)
  end
end

- (UU::OS::REST::ResultList<RoleInterface::RoleInterfaceGetMetaArtifactList, RoleInterface::RoleInterfaceGetMetaArtifactListItem>) get_meta_artifact_list(role_interface_uri, criteria = nil)

Returns list of the meta artifacts that are connected to the specified role interface. Returned list does not contain any objects filtered out by executed UESQuery. The list of returned meta artifacts could be filtered by the name or code. The list is sorted by the name (and codes in case are equal). See the UES query documentation for more information.

name and code

See UESQuery Documentation.

Parameters:

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

    UESURI of the role interface for which the connected meta artifacts are to be listed

  • criteria (RoleInterfaceGetMetaArtifactList) (defaults to: nil)

    Object containing criteria for listing connected meta artifacts. Available parameters are:

Returns:



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

def get_meta_artifact_list(role_interface_uri, criteria = nil)
  svc = UU::OS::REST::RemoteClient.new(RoleInterface)
  dto = RoleInterface::RoleInterfaceGetMetaArtifactList.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('getMetaArtifactList', role_interface_uri)
    return UU::OS::REST::ResultList.new(RoleInterface::RoleInterfaceGetMetaArtifactList, RoleInterface::RoleInterfaceGetMetaArtifactListItem, res)
  end
end

- (Object) remove_meta_artifact(role_interface_uri, role_interface = nil)

The command removes meta artifact connection from the specified role interface. Only connected meta artifacts can be disconnected from the role interface.

Parameters:

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

    UESURI of the role interface where the meta artifacts will be disconnected.

  • role_interface (RoleInterfaceRemoveMetaArtifact) (defaults to: nil)

    Object containing meta artifact that to be disconnected



107
108
109
110
111
112
113
114
# File 'uu_os_client-0.10.6/lib/uu/os/role_interface.rb', line 107

def remove_meta_artifact(role_interface_uri, role_interface = nil)
  svc = UU::OS::REST::RemoteClient.new(RoleInterface)
  payload = UU::OS::RoleInterface::RoleInterfaceRemoveMetaArtifact.new(role_interface).to_json

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

- (UU::OS::UESURI) set_attributes(role_interface_uri, role_interface = nil)

Command for setting attributes of a role interface. The command can'tmodify references to objects like location, competent role and soon.

Parameters:

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

    UESURI of the role interface whose attributes are to be changed

  • role_interface (RoleInterfaceSetAttributes) (defaults to: nil)

    Object containing new attributes the role interface

Returns:



64
65
66
67
68
69
70
71
72
# File 'uu_os_client-0.10.6/lib/uu/os/role_interface.rb', line 64

def set_attributes(role_interface_uri, role_interface = nil)
  svc = UU::OS::REST::RemoteClient.new(RoleInterface)
  payload = UU::OS::RoleInterface::RoleInterfaceSetAttributes.new(role_interface).to_json

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