Class: Mio::Model::Workflow::Node

Inherits:
Mio::Model show all
Defined in:
lib/mio/model/workflow/node.rb

Instance Attribute Summary

Attributes inherited from Mio::Model

#args, #client, #search

Instance Method Summary collapse

Methods inherited from Mio::Model

#configure, #create, field, #go, #initialize, mappings, nested, #set_enable, set_resource, #set_start, #validate

Constructor Details

This class inherits a constructor from Mio::Model

Instance Method Details

#create_hashObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/mio/model/workflow/node.rb', line 14

def create_hash
  h = {name: @args.name,
       path: "/#{@args.path}",
       type: @args.type.upcase,
      }
  unless @args.assetContext.eql? ''
    h[:assetContext] = @args.assetContext
  end
  if @args.type.upcase == 'ACTION'
    action = @search.find_actions_by_name(@args.action).first
    h[:action] = normalize_action action
  end

  h
end

#normalize_action(a) ⇒ Object



30
31
32
33
34
# File 'lib/mio/model/workflow/node.rb', line 30

def normalize_action a
  {id: a['id'],
   name: a['name'],
   pluginClass: a['pluginClass']}
end