Class: UU::OS::MetaModel::ArtifactInterface

Inherits:
Object
  • Object
show all
Defined in:
uu_os-0.29.16/lib/uu/os/meta_model/artifact_interface.rb

Class Method Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (ArtifactInterface) initialize(session)

Creates a new instance of ArtifactInterface.

Parameters:



28
29
30
31
# File 'uu_os-0.29.16/lib/uu/os/meta_model/artifact_interface.rb', line 28

def initialize(session)
  options = {use_legacy_config: true, append_routing_data: false}
  @cmd = UU::OS::CMD::CommandClient.new("uu/os/meta_model/cmd", session, options)
end

Class Method Details

+ (Object) add_use_case(artifact_interface_uri, use_case = nil)

#add_use_case convenient self-instantiating shortcut



182
183
184
185
# File 'uu_os-0.29.16/lib/uu/os/meta_model/artifact_interface.rb', line 182

def self.add_use_case(artifact_interface_uri, use_case = nil)
  session = UU::OS::Security::Session.current_session
  self.new(session).add_use_case(artifact_interface_uri, use_case)
end

+ (Object) create(meta_artifact_uri, artifact_interface = nil)

#create convenient self-instantiating shortcut



59
60
61
62
# File 'uu_os-0.29.16/lib/uu/os/meta_model/artifact_interface.rb', line 59

def self.create(meta_artifact_uri, artifact_interface = nil)
  session = UU::OS::Security::Session.current_session
  self.new(session).create(meta_artifact_uri, artifact_interface)
end

+ (Object) delete(artifact_interface_uri)

#delete convenient self-instantiating shortcut



132
133
134
135
# File 'uu_os-0.29.16/lib/uu/os/meta_model/artifact_interface.rb', line 132

def self.delete(artifact_interface_uri)
  session = UU::OS::Security::Session.current_session
  self.new(session).delete(artifact_interface_uri)
end

+ (Object) get_artifact_interface_list(meta_artifact_uri, criteria = nil)

#get_artifact_interface_list convenient self-instantiating shortcut



160
161
162
163
# File 'uu_os-0.29.16/lib/uu/os/meta_model/artifact_interface.rb', line 160

def self.get_artifact_interface_list(meta_artifact_uri, criteria = nil)
  session = UU::OS::Security::Session.current_session
  self.new(session).get_artifact_interface_list(meta_artifact_uri, criteria)
end

+ (Object) get_attributes(artifact_interface_uri)

#get_attributes convenient self-instantiating shortcut



86
87
88
89
# File 'uu_os-0.29.16/lib/uu/os/meta_model/artifact_interface.rb', line 86

def self.get_attributes(artifact_interface_uri)
  session = UU::OS::Security::Session.current_session
  self.new(session).get_attributes(artifact_interface_uri)
end

+ (Object) get_use_case_list(artifact_interface_uri)

#get_use_case_list convenient self-instantiating shortcut



225
226
227
228
# File 'uu_os-0.29.16/lib/uu/os/meta_model/artifact_interface.rb', line 225

def self.get_use_case_list(artifact_interface_uri)
  session = UU::OS::Security::Session.current_session
  self.new(session).get_use_case_list(artifact_interface_uri)
end

+ (Object) remove_use_case(artifact_interface_uri, use_case)

#remove_use_case convenient self-instantiating shortcut



204
205
206
207
# File 'uu_os-0.29.16/lib/uu/os/meta_model/artifact_interface.rb', line 204

def self.remove_use_case(artifact_interface_uri, use_case)
  session = UU::OS::Security::Session.current_session
  self.new(session).remove_use_case(artifact_interface_uri, use_case)
end

+ (Object) set_attributes(artifact_interface_uri, artifact_interface = nil)

#set_attributes convenient self-instantiating shortcut



115
116
117
118
# File 'uu_os-0.29.16/lib/uu/os/meta_model/artifact_interface.rb', line 115

def self.set_attributes(artifact_interface_uri, artifact_interface = nil)
  session = UU::OS::Security::Session.current_session
  self.new(session).set_attributes(artifact_interface_uri, artifact_interface)
end

Instance Method Details

- (Object) add_use_case(artifact_interface_uri, use_case = nil)

Connects the selected use case into the selected artifact interface.

Examples:

# Connect a use case to an artifact interface.
UU::OS::MetaModel::ArtifactInterface.add_use_case('ues:TERRITORY:META_ARTIFACT:ARTIFACT_INTERFACE',
    :use_case_code => 'UU.OS/CONTENT/SHEET/GET_SHEET_LIST'
)

Parameters:

Options Hash (use_case):

  • :use_case_code (String)

    Code of the use case which is to be connected to the artifact interface. Must not be nil.



176
177
178
179
# File 'uu_os-0.29.16/lib/uu/os/meta_model/artifact_interface.rb', line 176

def add_use_case(artifact_interface_uri, use_case = nil)
  payload = wrap_params(UU::OS::MetaModel::ArtifactInterfaceAddUseCase.new(use_case))
  @cmd.invoke('ArtifactInterface/addUseCase', artifact_interface_uri, payload)
end

- (UU::OS::UESURI) create(meta_artifact_uri, artifact_interface = nil)

Returns the UESURI of the newly created artifact interface.

Examples:

# Create a new artifact interface.
UU::OS::MetaModel::ArtifactInterface.create('ues:TERRITORY:META_ARTIFACT',
    :name => 'New Interface',
    :code => 'NEW_INTERFACE',
    :description => 'New artifact interface',
    :grant_all_from_territory => false
)

Parameters:

Options Hash (artifact_interface):

  • :name (String)

    Name of the new artifact interface. Must not be nil.

  • :code (String)

    Code of the new artifact interface. Must be unique for the template object. When nil set, new code is generated automatically from the sequence. It cannot be changed after the artifact creation.

  • :description (String)

    Description of the new artifact interface.

  • :grant_all_from_territory (Boolean) — default: false

    Flag indicating whether the new artifact interface is automatically connected to users with access to the territory. Default value is false.

Returns:

  • (UU::OS::UESURI)

    The UESURI of the newly created artifact interface.



52
53
54
55
56
# File 'uu_os-0.29.16/lib/uu/os/meta_model/artifact_interface.rb', line 52

def create(meta_artifact_uri, artifact_interface = nil)
  payload = wrap_params(UU::OS::MetaModel::ArtifactInterfaceCreate.new(artifact_interface))
  res = @cmd.invoke("ArtifactInterface/create", meta_artifact_uri, payload)
  return UU::OS::UESURI.new(res)
end

- (Object) delete(artifact_interface_uri)

Deletes an artifact interface.

Examples:

# Delete an artifact interface.
UU::OS::MetaModel::ArtifactInterface.delete('ues:TERRITORY:META_ARTIFACT:ARTIFACT_INTERFACE')

Parameters:

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

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



127
128
129
# File 'uu_os-0.29.16/lib/uu/os/meta_model/artifact_interface.rb', line 127

def delete(artifact_interface_uri)
  @cmd.invoke("ArtifactInterface/delete", artifact_interface_uri)
end

- (UU::OS::REST::ResultList<UU::OS::MetaModel::ArtifactInterfaceGetArtifactInterfaceList, UU::OS::MetaModel::ArtifactInterfaceAttributes>) get_artifact_interface_list(meta_artifact_uri, criteria = nil)

Retrieves the list of artifact interfaces connected to the given meta artifact. The list is sorted by name of the artifact interface by default.

Examples:

# Get list of artifact interfaces whose names end with "Interface". Order the result list by name and code.
UU::OS::MetaModel::ArtifactInterface.get_artifact_interface_list('ues:TERRITORY:META_ARTIFACT',
    :query => 'name="%Interface" ORDER BY name,code'

Parameters:

Options Hash (criteria):

  • :query (String)

    Query for filtering and ordering of the result list. See uuQuery 2.0 documentation for further details. It is possible to filter the result list by name and code.

Returns:

See Also:



152
153
154
155
156
157
# File 'uu_os-0.29.16/lib/uu/os/meta_model/artifact_interface.rb', line 152

def get_artifact_interface_list(meta_artifact_uri, criteria = nil)
  payload = wrap_params(UU::OS::MetaModel::ArtifactInterfaceGetArtifactInterfaceList.new(criteria))
  res = @cmd.invoke('ArtifactInterface/getArtifactInterfaceList', meta_artifact_uri, payload) #, invocation_method: 'get')
  ret = {:total_size => res.size, :page_entries => res.to_a}
  return UU::OS::REST::ResultList.new(UU::OS::MetaModel::ArtifactInterfaceGetArtifactInterfaceList, UU::OS::MetaModel::ArtifactInterfaceAttributes, ret)
end

- (UU::OS::MetaModel::ArtifactInterfaceAttributes) get_attributes(artifact_interface_uri)

Returns an Object containing the artifact interface attributes.

Examples:

# Get attributes of an artifact interface.
UU::OS::MetaModel::ArtifactInterface.get_attributes('ues:TERRITORY:META_ARTIFACT:ARTIFACT_INTERFACE')

Parameters:

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

    UESURI of the artifact interface whose attributes will be returned.

Returns:

  • (UU::OS::MetaModel::ArtifactInterfaceAttributes)

    An object containing the artifact interface attributes.

    • :uri (UU::OS::UESURI) - Normalized UESURI of the artifact interface.

    • :name (String) - Name of the artifact interface.

    • :code (String) - Code of the artifact interface.

    • :description (String) - Description of the artifact interface.

    • :grant_all_from_territory (Boolean) - Flag indicating whether the new artifact interface is automatically connected to users with access to the territory.

    • :creation_stamp (String) - Time when the artifact interface was created.

    • :modification_stamp (String) - Time when the artifact interface was modified.



80
81
82
83
# File 'uu_os-0.29.16/lib/uu/os/meta_model/artifact_interface.rb', line 80

def get_attributes(artifact_interface_uri)
  res = @cmd.invoke('ArtifactInterface/getAttributes', artifact_interface_uri) #, invocation_method: 'get')
  return UU::OS::MetaModel::ArtifactInterfaceAttributes.new(res)
end

- (UU::OS::REST::ResultList<UU::OS::MetaModel::ArtifactInterfaceGetUseCaseList, UU::OS::MetaModel::ArtifactInterfaceUseCaseAttributes>) get_use_case_list(artifact_interface_uri)

Retrieves the code list of use cases connected to the given artifact interface in json format.

Examples:

# Get list of use cases connected to an artifact interface.
UU::OS::MetaModel::ArtifactInterface.get_use_case_list('ues:TERRITORY:META_ARTIFACT:ARTIFACT_INTERFACE')

Parameters:

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

    UESURI of the artifact interface for which the data will be returned.

Returns:



218
219
220
221
222
# File 'uu_os-0.29.16/lib/uu/os/meta_model/artifact_interface.rb', line 218

def get_use_case_list(artifact_interface_uri)
  res = @cmd.invoke('ArtifactInterface/getUseCaseList', artifact_interface_uri) #, invocation_method: 'get')
  ret = {:total_size => res.size, :page_entries => res.to_a}
  return UU::OS::REST::ResultList.new(UU::OS::MetaModel::ArtifactInterfaceGetUseCaseList, UU::OS::MetaModel::ArtifactInterfaceUseCaseAttributes, ret)
end

- (Object) remove_use_case(artifact_interface_uri, use_case)

Removes the selected use case from the selected artifact interface.

Examples:

# Disconnect a use case from an artifact interface.
UU::OS::MetaModel::ArtifactInterface.remove_use_case('ues:TERRITORY:META_ARTIFACT:ARTIFACT_INTERFACE',
    :use_case_code => 'UU.OS/CONTENT/SHEET/GET_SHEET_LIST'
)

Parameters:

Options Hash (use_case):

  • :use_case_code (String)

    Code of the use case which is to be removed from the artifact interface. Must not be nil.



198
199
200
201
# File 'uu_os-0.29.16/lib/uu/os/meta_model/artifact_interface.rb', line 198

def remove_use_case(artifact_interface_uri, use_case)
  payload = wrap_params(UU::OS::MetaModel::ArtifactInterfaceRemoveUseCase.new(use_case))
  @cmd.invoke('ArtifactInterface/removeUseCase', artifact_interface_uri, payload)
end

- (UU::OS::UESURI) set_attributes(artifact_interface_uri, artifact_interface = nil)

Returns UESURI of the updated artifact interface.

Examples:

# Modify a few attributes of an artifact interface.
UU::OS::MetaModel::ArtifactInterface.set_attributes('ues:TERRITORY:META_ARTIFACT:ARTIFACT_INTERFACE',
    :name => 'New name',
    :description => 'New artifact interface description',
    :grant_all_from_territory => true
)

Parameters:

Options Hash (artifact_interface):

  • :name (String)

    New name of the artifact interface. When nil is set, the attribute will not be modified. Must not be blank.

  • :description (String)

    New description of the artifact interface. When nil is set, the attribute will not be modified.

  • :grant_all_from_territory (Boolean)

    Flag indicating whether the new artifact interface is automatically connected to users with access to the territory. When nil is set, the attribute will not be modified.

Returns:



108
109
110
111
112
# File 'uu_os-0.29.16/lib/uu/os/meta_model/artifact_interface.rb', line 108

def set_attributes(artifact_interface_uri, artifact_interface = nil)
  payload = wrap_params(UU::OS::MetaModel::ArtifactInterfaceSetAttributes.new(artifact_interface))
  res = @cmd.invoke('ArtifactInterface/setAttributes', artifact_interface_uri, payload)
  return UU::OS::UESURI.new(res)
end