Module: UU::OS::MetaModel Deprecated

Extended by:
MetaModel
Included in:
MetaModel
Defined in:
uu_os_client-0.10.6/lib/uu/os/meta_model.rb,
uu_os_client-0.10.6/lib/uu/os/meta_model/meta_model_create.rb,
uu_os_client-0.10.6/lib/uu/os/meta_model/meta_model_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/meta_model/meta_model_get_entry_list.rb,
uu_os_client-0.10.6/lib/uu/os/meta_model/meta_model_set_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/meta_model/meta_model_entry_attributes.rb

Overview

Deprecated.

Use AppPackage instead.

Meta Model service.

Defined Under Namespace

Classes: MetaModelAttributes, MetaModelCreate, MetaModelEntryAttributes, MetaModelGetEntryList, MetaModelSetAttributes

Constant Summary

PATH =

Service path

'ues/core/container/UESMetaModel'

Instance Method Summary (collapse)

Instance Method Details

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

Creates a new meta model. The command creates a new meta model in a specified location. At the very least meta artifact and name must be specified in MetaModelCreate DTO. Competent role for the meta model 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 MetaModelCreate DTO.

Parameters:

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

    UESURI of the folder/org. unit/meta model where meta model will be created.

  • meta_model (MetaModelCreate) (defaults to: nil)

    DTO containing attributes of the new meta model.

Returns:



29
30
31
32
33
34
35
36
37
# File 'uu_os_client-0.10.6/lib/uu/os/meta_model.rb', line 29

def create(location_uri, meta_model = nil)
  svc = UU::OS::REST::RemoteClient.new(MetaModel)
  payload = UU::OS::MetaModel::MetaModelCreate.new(meta_model).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(meta_model_uri)

This command deletes the specified meta model from the system. The meta model is deleted even if it contains a locked sheet or attachment. The meta model cannot be deleted when:

the meta model is not empty
the meta model's workflow is not created 
a property contains a reference to this meta model 
a time sheet exists with a reference to this meta model

Parameters:

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

    UESURI of the meta model which is about to be deleted.



80
81
82
83
84
85
# File 'uu_os_client-0.10.6/lib/uu/os/meta_model.rb', line 80

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

- (MetaModelAttributes) get_attributes(meta_model_uri)

This command returns attributes representing the meta model specified by the metaModelUri parameter. The command does not change the state of the meta model in the system.

Parameters:

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

    UESURI of a meta model whose attributes are returned

Returns:



46
47
48
49
50
51
52
# File 'uu_os_client-0.10.6/lib/uu/os/meta_model.rb', line 46

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

- (UU::OS::REST::ResultList<MetaModel::MetaModelGetEntryList, MetaModel::MetaModelEntryAttributes>) get_entry_list(meta_model_uri, criteria = nil)

This command returns a list of entries (artifacts, meta artifacts, meta interfaces, containers, meta model dictionaries or shortcuts) enlisted in the specified meta model dictionary. Command does not return all entries, only a sublist. The list of returned entries could be filtered by the name, code or entityTypeUri of an entry. The list is sorted by the name (and codes in case are equal) of a entry by default, or it can be sorted arbitrarily by any of entry attributes usable for the filtering or these attributes combinations.

name, code and entityTypeUri.

See UESQuery Documentation.

Parameters:

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

    UESURI of the meta model dictionary from where entries are listed.

  • criteria (MetaModelGetEntryList) (defaults to: nil)

    DTO containing criteria. Available parameters are:

Returns:



103
104
105
106
107
108
109
110
111
112
113
114
# File 'uu_os_client-0.10.6/lib/uu/os/meta_model.rb', line 103

def get_entry_list(meta_model_uri, criteria = nil)
  svc = UU::OS::REST::RemoteClient.new(MetaModel)
  dto = MetaModel::MetaModelGetEntryList.new(criteria)
  svc.add_parameter('pageIndex', dto.page_index)
  svc.add_parameter('pageSize', dto.page_size)
  svc.add_parameter('query', dto.query)
  svc.add_parameter('recursive', dto.recursive)
  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.get('getEntryList', meta_model_uri)
    return UU::OS::REST::ResultList.new(MetaModel::MetaModelGetEntryList, MetaModel::MetaModelEntryAttributes, res)
  end
end

- (UU::OS::UESURI) set_attributes(meta_model_uri, meta_model = nil)

Command for setting attributes of a meta model. The command can't modify references to objects like location, competent role and so on.

Parameters:

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

    UESURI of the meta model whose attributes are to be changed

  • meta_model (MetaModelSetAttributes) (defaults to: nil)

    DTO containing new attributes the meta model

Returns:



61
62
63
64
65
66
67
68
69
# File 'uu_os_client-0.10.6/lib/uu/os/meta_model.rb', line 61

def set_attributes(meta_model_uri, meta_model = nil)
  svc = UU::OS::REST::RemoteClient.new(MetaModel)
  payload = UU::OS::MetaModel::MetaModelSetAttributes.new(meta_model).to_json

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