Module: UU::OS::MetaVisualUseCase

Extended by:
MetaVisualUseCase
Included in:
MetaVisualUseCase
Defined in:
uu_os-0.29.16/lib/uu/os/meta_visual_use_case.rb,
uu_os-0.29.16/lib/uu/os/meta_visual_use_case/meta_visual_use_case_copy.rb,
uu_os-0.29.16/lib/uu/os/meta_visual_use_case/meta_visual_use_case_attributes.rb,
uu_os-0.29.16/lib/uu/os/meta_visual_use_case/meta_visual_use_case_set_attributes.rb

Defined Under Namespace

Classes: MetaVisualUseCaseAttributes, MetaVisualUseCaseCopy, MetaVisualUseCaseSetAttributes

Constant Summary

PATH =

Service path

'/uu/os/MetaVisualUseCase'

Instance Method Summary (collapse)

Instance Method Details

- (UU::OS::UESURI) copy(source_meta_artifact_uri, meta_visual_use_case = nil)

Copy a meta visual use case. The command creates a new meta visual use case according to specified source meta visual use case in a specified location. At the very least location meta visual use case and name must be specified in MetaVisualUseCaseCopy DTO. Competent role for the new meta visual use case copy will be selected as the most suitable according to specified container and role(executive/authorized role with connected interface), or can be also specified in MetaVisualUseCaseCopy DTO.

Examples:

# Copy meta visual use case
UU::OS::MetaVisualUseCase.copy('ues:TERRITORY:META_ARTIFACT',
     :location_uri=>'ues:TERRITORY:LOCATION',
     :name=>'Copy name',
     :code=>'COPY_CODE',
     :description=>'Some description string',
     :competent_role_uri=>'ues:TERRITORY:COMPETENT_ROLE',
     :security_level=>UU::OS::Artifact::SecurityLevel::TOP_SECRET,
     :copy_sheets=>false,
     :copy_lifecycle=>false,
     :copy_attachments=>true,
     :copy_sheet_templates=>false,
     :default_name=>'Default name',
     :default_code=>'DEFAULT_CODE',
     :default_security_level=>UU::OS::Artifact::SecurityLevel::CONFIDENTIAL
)

Parameters:

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

    UESURI of the meta visual use case which will be copied

  • meta_visual_use_case (MetaVisualUseCaseCopy) (defaults to: nil)

    DTO containing attributes of the new meta visual use case copy

Options Hash (meta_visual_use_case):

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

    UESURI of the meta model dictionary where to the meta visual use case will be copied. If the rights does not permit to copy a meta visual use case from the meta visual use case in this location, the copy command fails. The value must not be nil.

  • :name (String)

    Name of the new meta visual use case. If nil is set, default name from meta artifact is used if set, otherwise the create command fails.

  • :code (String)

    Code of the new meta visual use case. If nil is set, the code is generated automatically using the system sequence. The code must be unique in the given territory, otherwise the create command fails.

  • :description (String)

    Description of the new meta visual use case. If nil is set, default description from meta artifact is used if set, otherwise no description is set on the new meta visual use case.

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

    UESURI of the competent role. If nil is set, the executive role from authorization is used. If no role is authorized to create the role into specified container, the create command fails. If the selected role doesn’t have connected the role interface with the selected meta artifact, the create command fails. If the selected role doesn’t belong to the same organizational unit as a new role or if it doesn’t belong to one of superior organizational units, the create command fails.

  • :security_level (String, UU::OS::Artifact::SecurityLevel)

    Security level. If nil is set, security level is taken from the source meta visual use case security level. If the source meta visual use case security level is higher than the user’s security clearance, the copy command fails.

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

    UESURI of the meta visual use case’s icon. If nil is set, the meta visual use case uses icon from meta artifact. An example of icon URI: ‘ues:#{system}:#{ues_v5.core_v1.codetable_v1.base_v1.CodeTable_Icons}:#{ART_077}’.

  • :copy_sheets (Boolean)

    Specifies whether to copy content from the source meta visual use case to the new copy. Default value is false.

  • :copy_lifecycle (Boolean)

    Specifies whether to copy life cycle from the source meta visual use case to the new copy. Default value is false.

  • :copy_attachments (Boolean)

    Specifies whether to copy attachments from the source meta visual use case to the new copy. Default value is false.

  • :copy_sheet_templates (Boolean)

    Specifies whether to copy sheet templates from the source meta visual use case to the new copy. Default value is false.

  • :default_name (String)

    Specifies default name of the created visual use case according to new meta visual use case copy. If nil is set, the default name is taken from the source meta visual use case.

  • :default_code (String)

    Specifies default code of the created visual use case according to new meta visual use case copy. If nil is set, the default code is taken from the source meta visual use case.

  • :default_security_level (String, UU::OS::Artifact::SecurityLevel)

    Specifies default security level of the created visual use case according to new meta visual use case copy. If nil is set, the default security level is taken from the source meta visual use case.

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

    Specifies default icon of the created visual use case according to new meta visual use case copy. If nil is set, the default icon is taken from the source meta visual use case. An example of icon URI: ‘ues:#{system}:#{ues_v5.core_v1.codetable_v1.base_v1.CodeTable_Icons}:#{ART_077}’.

  • :component_content (Boolean)

    Defines whether the primarily displayed content of the uuEE is component content. Default value is false.

  • :default_component_content (Boolean)

    Defines whether the primarily displayed content of a visual use case created according to the new meta visual use case copy is component content. When nil is set, the default component content setting is copied from the source meta artifact.

Returns:



65
66
67
68
69
70
71
72
73
# File 'uu_os-0.29.16/lib/uu/os/meta_visual_use_case.rb', line 65

def copy(source_meta_artifact_uri, meta_visual_use_case = nil)
  svc = UU::OS::REST::RemoteClient.new(MetaVisualUseCase)
  payload = UU::OS::MetaVisualUseCase::MetaVisualUseCaseCopy.new(meta_visual_use_case).to_json

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

- (MetaVisualUseCaseAttributes) get_attributes(meta_visual_use_case_uri)

Returns attributes representing the meta visual use case specified by the meta_visual_use_case_uri parameter.

Examples:

# Get meta visual use case attributes.
attributes = UU::OS::MetaVisualUseCase.get_attributes('ues:TERRITORY:META_VISUAL_USE_CASE')

Parameters:

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

    UESURI of the MVUC for which we’ll fetch its attributes

Returns:



85
86
87
88
89
90
91
# File 'uu_os-0.29.16/lib/uu/os/meta_visual_use_case.rb', line 85

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

- (UU::OS::UESURI) set_attributes(meta_visual_use_case_uri, meta_visual_use_case = nil)

Sets attributes on specified meta visual use case according to meta_visual_use_case_uri.

Examples:

# Set attributes of meta artifact.
UU::OS::MetaArtifact.set_attributes('ues:TERRITORY:META_ARTIFACT',
        :name=>'Meta art name',
        :code=>'CODE',
        :description=>'Text description without sense.',
        :security_level=>UU::OS::Artifact::SecurityLevel::CONFIDENTIAL,
        :default_name=>'Mar default name',
        :default_code=>'DEFAULT_CODE',
        :default_security_level=>UU::OS::Artifact::SecurityLevel::CONFIDENTIAL
        )

Parameters:

Options Hash (meta_visual_use_case):

  • :name (String)

    The new name of the meta visual use case. If nil is set, the name is not modified.

  • :code (String)

    The new code of the meta visual use case. If nil is set, the code is not modified. If blank string is set, the code is generated automatically using the system sequence. The code must be unique in a given territory, otherwise the set_attributes command fails.

  • :description (String)

    The new description of the meta visual use case. If nil is set, the description is not modified.

  • :security_level (String, UU::OS::Artifact::SecurityLevel)

    The new security level of the meta visual use case. If nil is set, the security level is not modified. If user is setting the meta visual use case template security level higher than the user’s security clearance, the set_attributes command fails.

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

    URI of the new meta visual use case’s icon. If nil is set, the icon is not modified. If nil URI (“ues:[-1]:[-1]:”) is set, the meta visual use case icon is removed and the meta visual use case uses icon from its meta visual use case. An example of icon URI: ‘ues:#{system}:#{ues_v5.core_v1.codetable_v1.base_v1.CodeTable_Icons}:#{ART_077}’.

  • :default_name (String)

    Specifies new default name of the created visual use case according to meta visual use case (specified in source_meta_artifact_uri). If nil is set, the default name is not modified.

  • :default_code (String)

    Specifies new default code of the created visual use case according to meta visual use case (specified in source_meta_artifact_uri). If nil is set, the default code is not modified.

  • :default_security_level (String, UU::OS::Artifact::SecurityLevel)

    Specifies new default security level of the created visual use case according to meta visual use case (specified in source_meta_artifact_uri). If nil is set, the default security is not modified.

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

    Specifies new default icon of the created visual use case according to meta visual use case (specified in meta_artifact_uri). If nil is set, the default icon is not modified. An example of icon URI: ‘ues:#{system}:#{ues_v5.core_v1.codetable_v1.base_v1.CodeTable_Icons}:#{ART_077}’.

  • :component_content (Boolean)

    Defines whether the primarily displayed content of the uuEE is component content. Default value is false.

  • :default_component_content (Boolean)

    Defines whether the primarily displayed content of a visual use case created according to the meta visual use case (specified in source_meta_artifact_uri) is component content. When nil is set, the default component content setting is not modified.

Returns:



122
123
124
125
126
127
128
129
130
# File 'uu_os-0.29.16/lib/uu/os/meta_visual_use_case.rb', line 122

def set_attributes(meta_visual_use_case_uri, meta_visual_use_case = nil)
  svc = UU::OS::REST::RemoteClient.new(MetaVisualUseCase)
  payload = UU::OS::MetaVisualUseCase::MetaVisualUseCaseSetAttributes.new(meta_visual_use_case).to_json

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