Module: UU::OS::UseCase

Extended by:
UseCase
Included in:
UseCase
Defined in:
uu_os_client-0.10.6/lib/uu/os/use_case.rb,
uu_os_client-0.10.6/lib/uu/os/use_case/use_case_create.rb,
uu_os_client-0.10.6/lib/uu/os/use_case/use_case_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/use_case/use_case_set_options.rb,
uu_os_client-0.10.6/lib/uu/os/use_case/use_case_get_options.rb,
uu_os_client-0.10.6/lib/uu/os/use_case/use_case_set_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/use_case/use_case_get_use_case_list.rb

Defined Under Namespace

Classes: UseCaseAttributes, UseCaseCreate, UseCaseGetOptions, UseCaseGetUseCaseList, UseCaseSetAttributes, UseCaseSetOptions

Constant Summary

PATH =

Service path

'uu/os/UseCase'

Instance Method Summary (collapse)

Instance Method Details

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

The command creates a use case in a specified meta artifact. @param metaArtifactUri URI of the meta artifact where the use case is aggregated. @paramuseCase DTO containing attributes of the new use case @return URI of the new use case @throws UseCaseRTException

Parameters:

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

    UESURI of MetaArtifact in which the UC will be created

  • usecase (UseCaseCreate) (defaults to: nil)

    DTO containing attributes needed for UC creation

Returns:



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

def create(meta_artifact_uri, usecase = nil)
  svc = UU::OS::REST::RemoteClient.new(UseCase)
  payload = UU::OS::UseCase::UseCaseCreate.new(usecase).to_json               

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

- (Object) delete(use_case_uri)

The command deletes the specified use case from the system @param useCaseUri URI of the use case which is about to be deleted

Parameters:

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

    UESURI of the UC to be deleted



42
43
44
45
46
47
# File 'uu_os_client-0.10.6/lib/uu/os/use_case.rb', line 42

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

- (UseCaseAttributes) get_attributes(use_case_uri)

This command returns attributes representing the use case specified by the useCaseUri parameter. of the use case

Parameters:

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

    UESURI URI of the use case

Returns:



56
57
58
59
60
61
62
# File 'uu_os_client-0.10.6/lib/uu/os/use_case.rb', line 56

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

- (UseCaseGetOptions) get_options(use_case_uri, get_dto = nil)

The command returns options of the specified use case.

Parameters:

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

    UESURI of the use case

  • get_dto (UseCaseGetOptions) (defaults to: nil)

    DTO containing options for getting usecase options.

Returns:



99
100
101
102
103
104
105
106
107
# File 'uu_os_client-0.10.6/lib/uu/os/use_case.rb', line 99

def get_options(use_case_uri, get_dto = nil)
  svc = UU::OS::REST::RemoteClient.new(UseCase)
  dto = UU::OS::UseCase::UseCaseGetOptions.new(get_dto)
  svc.add_parameter('requestedMimeType', dto.requested_mime_type)
  UU::OS::QoS::QoSHandler.auto_retry do
    ret = svc.get('getOptions', use_case_uri)
    return UU::OS::REST::BinaryValue.new(ret, true)
  end
end

- (UU::OS::REST::ResultList<UseCase::UseCaseGetUseCaseList, UseCase::UseCaseAttributes>) get_use_case_list(meta_artifact_uri, criteria = nil)

Returns list of the use cases that are defined on the specified meta artifact. The list of returned use cases could be filtered by the name or code.Returned list does not contain any objects filtered out by executed UESQuery. The list is sorted by the name (and codes in case are equal) of an use case by default.

Parameters:

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

    UESURI of the meta artifact uri

  • criteria (UseCaseGetUseCaseList) (defaults to: nil)

    DTO containing the criteria for listing use cases.

Returns:



119
120
121
122
123
124
125
126
127
128
129
# File 'uu_os_client-0.10.6/lib/uu/os/use_case.rb', line 119

def get_use_case_list(meta_artifact_uri, criteria = nil)
  svc = UU::OS::REST::RemoteClient.new(UseCase)
  dto = UseCase::UseCaseGetUseCaseList.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('getUseCaseList', meta_artifact_uri)
    return UU::OS::REST::ResultList.new(UseCase::UseCaseGetUseCaseList, UseCase::UseCaseAttributes, res)
  end
end

- (UU::OS::UESURI) set_attributes(use_case_uri, usecase = nil)

The command sets attributes on specified use case according to useCaseUri.

Parameters:

Returns:



70
71
72
73
74
75
76
77
78
# File 'uu_os_client-0.10.6/lib/uu/os/use_case.rb', line 70

def set_attributes(use_case_uri, usecase = nil)
  svc = UU::OS::REST::RemoteClient.new(UseCase)
  payload = UU::OS::UseCase::UseCaseSetAttributes.new(usecase).to_json

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

- (Object) set_options(uri, dto = nil)

The command sets options of the specified use case.

Parameters:

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

    UESURI of the use case

  • dto (UseCaseSetOptions) (defaults to: nil)

    DTO containing the options data for setting use case options.



84
85
86
87
88
89
90
91
# File 'uu_os_client-0.10.6/lib/uu/os/use_case.rb', line 84

def set_options(uri, dto = nil)
  svc = UU::OS::REST::RemoteClient.new(UseCase)
  payload = UU::OS::UseCase::UseCaseSetOptions.new(dto).to_json
  
  UU::OS::QoS::QoSHandler.auto_retry do
    svc.post('setOptions', uri, payload)
  end
end