Class: UuDevman::ConstructionTask

Inherits:
Object
  • Object
show all
Defined in:
lib/uu_devman/construction_task.rb,
lib/uu_devman/construction_task/feature_type.rb,
lib/uu_devman/construction_task/estimated_effort.rb

Overview

Specific assignment for a construction division. Construction task is further divided into work items.

Defined Under Namespace

Modules: EstimatedEffort, FeatureType

Class Method Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (ConstructionTask) initialize(session, options = nil)

Creates a new instance of ConstructionTask.

Parameters:

  • session (UU::OS::Security::Session)

    Session to use for remote calls.

  • options (Hash) (defaults to: nil)

    Options for UU::OS::CMD::CommandClient.



18
19
20
# File 'lib/uu_devman/construction_task.rb', line 18

def initialize(session, options = nil)
  @cmd = UU::OS::CMD::CommandClient.new("uu-devman", session, options)
end

Class Method Details

+ (String) create(product_folder_uri, opts)

Creates a new construction task for the specified idea. This method is a convenience shortcut for the #create instance method.

Examples:

Create construction task without idea and issues.

product_uri = "ues:UU-BT:SI/OS8"
ct = UuDevman::ConstructionTask.new(UU::OS::Security::Session.current_session)
ct_uri = ct.create(product_uri,
  :name => "uuTEK Open artifact from quickfind to new window",
  :code => "TEK/CT_001",
  :description => "Allow to open an artifact with the specified code from quickfind to a new window.",
  :moduleUri => "ues:UU-BT:OS/LEGACY",
  :devRoleuri => "ues:UU-BT:UU.TEK~MGR",
  :estimatedEffort => UuDevman::ConstructionTask::EstimatedEffort::LOW,
  :releaseUri => "ues:UU-BT:OS/R8-14"
)

Create construction task with specified issues.

product_uri = "ues:UU-BT:SI/OS8"
ct = UuDevman::ConstructionTask.new(UU::OS::Security::Session.current_session)
ct_uri = ct.create(product_uri,
  :name => "uuTEK Open artifact from quickfind to new window",
  :code => "TEK/CT_001",
  :description => "Allow to open an artifact with the specified code from quickfind to a new window.",
  :moduleUri => "ues:UU-BT:OS/LEGACY",
  :devRoleuri => "ues:UU-BT:UU.TEK~MGR",
  :estimatedEffort => UuDevman::ConstructionTask::EstimatedEffort::LOW,
  :releaseUri => "ues:UU-BT:OS/R8-14",
  :issues => ['ues:TER:ISSUE1', 'ues:TER:ISSUE2']
)

Create construction task with specified idea.

product_uri = "ues:UU-BT:SI/OS8"
ct = UuDevman::ConstructionTask.new(UU::OS::Security::Session.current_session)
ct_uri = ct.create(product_uri,
  :name => "uuTEK Open artifact from quickfind to new window",
  :code => "TEK/CT_001",
  :description => "Allow to open an artifact with the specified code from quickfind to a new window.",
  :moduleUri => "ues:UU-BT:OS/LEGACY",
  :devRoleuri => "ues:UU-BT:UU.TEK~MGR",
  :estimatedEffort => UuDevman::ConstructionTask::EstimatedEffort::LOW,
  :releaseUri => "ues:UU-BT:OS/R8-14",
  :ideaUri => 'ues:TER:IDEA'
)

Returns:

  • (String)

    String representation of UESURI of the created construction task artifact.

See Also:



142
143
144
145
# File 'lib/uu_devman/construction_task.rb', line 142

def self.create(product_folder_uri, opts)
  session = UU::OS::Security::Session.current_session
  self.new(session).create(product_folder_uri, opts)
end

+ (Object) get_attributes(construction_task_uri)

Get attributes of construction task.

Examples:

Print attributes

ct_uri = "ues:UU-BT:TEK/CT_026"
attrs = UuDevman::ConstructionTask.get_attributes(ct_uri)
unless attrs.nil?
  puts attrs[:uri]
  puts attrs[:name]
  puts attrs[:code]
  puts attrs[:description]
  puts attrs[:product_uri]
  puts attrs[:module_uri]
  puts attrs[:tmo_role_uri]
  puts attrs[:dev_role_uri]
  puts attrs[:estimated_effort]
  puts attrs[:release_uri]
  puts attrs[:issues]
end

Parameters:

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

    UESURI of construction task.

See Also:



289
290
291
292
# File 'lib/uu_devman/construction_task.rb', line 289

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

+ (UU::OS::UESURI) set_attributes(construction_task_uri, opts)

Set construction task attributes

Examples:

Set attributes.

ct_uri = "ues:UU-BT:TEK/CT_026"
UuDevman::ConstructionTask.set_attributes(ct_uri,
                                               :name => 'Nove CT jmeno',
                                               :code => 'NEW_CODE',
                                               :description => "New description",
                                               :moduleUri => 'ues:UU-BT:MODULE',
                                               :releaseUri => 'ues:UU-BT:RELEASE',
                                               :estimatedEffort => 'LOW'
)

Parameters:

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

    UESURI of construction task.

  • opts (Hash)

    Parameters.

Options Hash (opts):

  • name (String)

    New name of construction task.

  • code (String)

    New code of construction task.

  • description (String)

    New description of construction task.

  • estimatedEffort (EstimatedEffort)

    Estimated work effort to accomplish this construction task.

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

    New module of construction task.

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

    New release of construction task.

Returns:

  • (UU::OS::UESURI)

    UESURI of construction task.



347
348
349
350
# File 'lib/uu_devman/construction_task.rb', line 347

def self.set_attributes(construction_task_uri, opts)
  session = UU::OS::Security::Session.current_session
  self.new(session).set_attributes(construction_task_uri, opts)
end

+ (void) set_release(construction_task_uri, parameters)

This method returns an undefined value.

Assigns construction task to the specified release. This method is a convenience shortcut for the #set_release instance method.

Examples:

Assign construction task to a release (as a proposed feature); scope of the target release has not been frozen yet

ct_uri = "ues:UU-BT:TEK/CT_026"
UuDevman::ConstructionTask.set_release(ct_uri,
  :releaseUri => "ues:UU-BT:OS/R8-14"
)

Move construction task to (planned) features in the same release

ct_uri = "ues:UU-BT:TEK/CT_026"
UuDevman::ConstructionTask.set_release(ct_uri,
  :featureType => UuDevman::ConstructionTask::FeatureType::PLANNED
)

Move construction task to another release (as a proposed feature); scope of either release has been frozen

ct_uri = "ues:UU-BT:TEK/CT_026"
UuDevman::ConstructionTask.set_release(ct_uri,
  :releaseUri => "ues:UU-BT:OS/R8-15",
  :reason => "Insufficient team capacity to solve this feature in uuOS 8-14 due to higher priority tasks."
)

Move construction task to backlog (postpone it from the currently assigned release); scope of that release has been frozen

ct_uri = "ues:UU-BT:TEK/CT_026"
UuDevman::ConstructionTask.set_release(ct_uri,
  :featureType => UuDevman::ConstructionTask::FeatureType::POSTPONED,
  :reason => "Insufficient team capacity due to higher priority tasks."
)

See Also:



237
238
239
240
# File 'lib/uu_devman/construction_task.rb', line 237

def self.set_release(construction_task_uri, parameters)
  session = UU::OS::Security::Session.current_session
  self.new(session).set_release(construction_task_uri, parameters)
end

Instance Method Details

- (String) create(product_folder_uri, opts)

Creates a new construction task.

Examples:

Create construction task without idea and issues.

product_uri = "ues:UU-BT:SI/OS8"
ct = UuDevman::ConstructionTask.new(UU::OS::Security::Session.current_session)
ct_uri = ct.create(product_uri,
  :name => "uuTEK Open artifact from quickfind to new window",
  :code => "TEK/CT_001",
  :description => "Allow to open an artifact with the specified code from quickfind to a new window.",
  :moduleUri => "ues:UU-BT:OS/LEGACY",
  :devRoleuri => "ues:UU-BT:UU.TEK~MGR",
  :estimatedEffort => UuDevman::ConstructionTask::EstimatedEffort::LOW,
  :releaseUri => "ues:UU-BT:OS/R8-14"
)

Create construction task with specified issues.

product_uri = "ues:UU-BT:SI/OS8"
ct = UuDevman::ConstructionTask.new(UU::OS::Security::Session.current_session)
ct_uri = ct.create(product_uri,
  :name => "uuTEK Open artifact from quickfind to new window",
  :code => "TEK/CT_001",
  :description => "Allow to open an artifact with the specified code from quickfind to a new window.",
  :moduleUri => "ues:UU-BT:OS/LEGACY",
  :devRoleuri => "ues:UU-BT:UU.TEK~MGR",
  :estimatedEffort => UuDevman::ConstructionTask::EstimatedEffort::LOW,
  :releaseUri => "ues:UU-BT:OS/R8-14",
  :issues => ['ues:TER:ISSUE1', 'ues:TER:ISSUE2']
)

Create construction task with specified idea.

product_uri = "ues:UU-BT:SI/OS8"
ct = UuDevman::ConstructionTask.new(UU::OS::Security::Session.current_session)
ct_uri = ct.create(product_uri,
  :name => "uuTEK Open artifact from quickfind to new window",
  :code => "TEK/CT_001",
  :description => "Allow to open an artifact with the specified code from quickfind to a new window.",
  :moduleUri => "ues:UU-BT:OS/LEGACY",
  :devRoleuri => "ues:UU-BT:UU.TEK~MGR",
  :estimatedEffort => UuDevman::ConstructionTask::EstimatedEffort::LOW,
  :releaseUri => "ues:UU-BT:OS/R8-14",
  :ideaUri => 'ues:TER:IDEA'
)

Parameters:

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

    UESURI of product folder.

  • opts (Hash)

    Construction task opts.

Options Hash (opts):

  • name (String)

    Construction task name. Must not be nil or an empty String.

  • code (String)

    Construction task code. If not specified, a unique ID is used as code automatically.

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

    UESURI of module this construction task belongs to. Module is a folder in which the construction task artifact is created. Must not be nil and must be a valid UESURI.

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

    UESURI of role from development. This role is going to be competent for the construction task artifact. Must be a valid UESURI on nil.

  • estimatedEffort (EstimatedEffort)

    Estimated work effort to accomplish this construction task. May be nil.

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

    UESURI of release in which outputs of the construction task are included. May be nil, but must be a valid UESURI if specified.

  • issues (Array<String, UU::OS::UESURI>)

    List of issues.

Returns:

  • (String)

    String representation of UESURI of the created construction task artifact.



84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/uu_devman/construction_task.rb', line 84

def create(product_folder_uri, opts)
  is_uesuri! product_folder_uri, "Product folder uri"
  is_uesuri! opts[:ideaUri], "Idea URI" unless opts[:ideaUri].nil?
  is_not_empty! opts[:name], "Name"
  is_not_empty! opts[:code], "code" unless opts[:code].nil?
  is_uesuri! opts[:moduleUri], "Module URI"
  is_uesuri! opts[:devRoleUri], "Development role URI" unless opts[:devRoleUri].nil?
  is_enum_value! opts[:estimatedEffort], UuDevman::ConstructionTask::EstimatedEffort, "Estimated effort" unless opts[:estimatedEffort].nil?
  is_uesuri! opts[:releaseUri], "Release URI" unless opts[:releaseUri].nil?


  @cmd.invoke("ConstructionTask/create", product_folder_uri, parameters: opts)
end

- (Hash, NilClass) get_attributes(construction_task_uri)

Get attributes of construction task.

Examples:

Print attributes

ct_uri = "ues:UU-BT:TEK/CT_026"
ct = UuDevman::ConstructionTask.new(UU::OS::Security::Session.current_session)
attrs = ct.get_attributes(ct_uri)
unless attrs.nil?
  puts attrs[:uri]
  puts attrs[:name]
  puts attrs[:code]
  puts attrs[:description]
  puts attrs[:product_uri]
  puts attrs[:module_uri]
  puts attrs[:tmo_role_uri]
  puts attrs[:dev_role_uri]
  puts attrs[:estimated_effort]
  puts attrs[:release_uri]
  puts attrs[:issues]
end

Parameters:

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

    UESURI of construction task.

Returns:

  • (Hash, NilClass)

    Hash of attributes if construction task exist, else nil.



264
265
266
267
268
# File 'lib/uu_devman/construction_task.rb', line 264

def get_attributes(construction_task_uri)
  is_uesuri! construction_task_uri, "Construction Task URI"
  @cmd.invoke("ConstructionTask/getAttributes", construction_task_uri)

end

- (UU::OS::UESURI) set_attributes(construction_task_uri, opts)

Set construction task attributes

Examples:

Set attributes.

ct_uri = "ues:UU-BT:TEK/CT_026"
ct = UuDevman::ConstructionTask.new(UU::OS::Security::Session.current_session)
ct.set_attributes(ct_uri,
                  :name => 'Nove CT jmeno',
                  :code => 'NEW_CODE',
                  :description => "New description",
                  :moduleUri => 'ues:UU-BT:MODULE',
                  releaseUri => 'ues:UU-BT:RELEASE',
                  :estimatedEffort => 'LOW'
)

Parameters:

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

    UESURI of construction task.

  • opts (Hash)

    Parameters.

Options Hash (opts):

  • name (String)

    New name of construction task.

  • code (String)

    New code of construction task.

  • description (String)

    New description of construction task.

  • estimatedEffort (EstimatedEffort)

    Estimated work effort to accomplish this construction task.

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

    New module of construction task.

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

    New release of construction task.

Returns:

  • (UU::OS::UESURI)

    UESURI of construction task.

See Also:



317
318
319
320
321
322
323
324
325
# File 'lib/uu_devman/construction_task.rb', line 317

def set_attributes(construction_task_uri, opts)
  is_uesuri! construction_task_uri, "Construction Task URI"
  is_uesuri! opts[:moduleUri], "Module URI" unless opts[:moduleUri].nil?
  is_uesuri! opts[:releaseUri], "Module URI" unless opts[:releaseUri].nil?

  @cmd.invoke("ConstructionTask/setAttributes", construction_task_uri, parameters:opts)
  UU::OS::UESURI.new(construction_task_uri)

end

- (void) set_release(construction_task_uri, parameters)

This method returns an undefined value.

Assigns construction task to the specified release.

Examples:

Assign construction task to a release (as a proposed feature); scope of the target release has not been frozen yet

ct_uri = "ues:UU-BT:TEK/CT_026"
ct = UuDevman::ConstructionTask.new(UU::OS::Security::Session.current_session)
ct.set_release(ct_uri,
  :releaseUri => "ues:UU-BT:OS/R8-14"
)

Move construction task to (planned) features in the same release

ct_uri = "ues:UU-BT:TEK/CT_026"
ct = UuDevman::ConstructionTask.new(UU::OS::Security::Session.current_session)
ct.set_release(ct_uri,
  :featureType => UuDevman::ConstructionTask::FeatureType::PLANNED
)

Move construction task to another release (as a proposed feature); scope of either release has been frozen

ct_uri = "ues:UU-BT:TEK/CT_026"
ct = UuDevman::ConstructionTask.new(UU::OS::Security::Session.current_session)
ct.set_release(ct_uri,
  :releaseUri => "ues:UU-BT:OS/R8-15",
  :reason => "Insufficient team capacity to solve this feature in uuOS 8-14 due to higher priority tasks."
)

Move construction task to backlog (postpone it from the currently assigned release); scope of that release has been frozen

ct_uri = "ues:UU-BT:TEK/CT_026"
ct = UuDevman::ConstructionTask.new(UU::OS::Security::Session.current_session)
ct.set_release(ct_uri,
  :featureType => UuDevman::ConstructionTask::FeatureType::POSTPONED,
  :reason => "Insufficient team capacity due to higher priority tasks."
)

Parameters:

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

    UESURI of the construction task to assign to a release. Must not be nil and must be a valid UESURI.

  • parameters (Hash)

    Additional parameters.

Options Hash (parameters):

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

    UESURI of the release to assign the specified construction task to. May be nil if the construction task has been assigned to a release and featureType is set. Must be a valid UESURI if specified.

  • reason (String)

    Reason to assign to or postpone from the specified release. This appears in the release change log. May not be nil if the release has already reached its “Release Scope Freeze” milestone.

  • featureType (UuDevman::ConstructionTask::FeatureType)

    Determines type of feature this construction task represents in a particular release. May be nil in case of first release assignment or when moving the construction task to another release ( UuDevman::ConstructionTask::FeatureType::PROPOSED is assumed in such case).



198
199
200
201
202
203
204
# File 'lib/uu_devman/construction_task.rb', line 198

def set_release(construction_task_uri, parameters)
  is_uesuri! construction_task_uri, "Construction Task URI"
  is_uesuri! parameters[:releaseUri], "Release URI" unless parameters[:releaseUri].nil?
  is_enum_value! parameters[:featureType], UuDevman::ConstructionTask::FeatureType, "Feature type" unless parameters[:featureType].nil?

  @cmd.invoke("ConstructionTask/setRelease", construction_task_uri, parameters: parameters)
end