Module: UU::OS::Script Deprecated

Extended by:
Script
Included in:
Script
Defined in:
uu_os-0.29.16/lib/uu/os/script.rb,
uu_os-0.29.16/lib/uu/os/script/script_exec.rb,
uu_os-0.29.16/lib/uu/os/script/script_exec_options.rb

Overview

Deprecated.

Use Macro instead.

Script is representation of executable code in Unicorn Universe.

Defined Under Namespace

Classes: ScriptExec, ScriptExecOptions

Constant Summary

PATH =

Service path

'ues/core/script/UESScript'

Instance Method Summary (collapse)

Instance Method Details

- (UU::OS::UESURI) exec(main_entity_uri, parameters)

Executes script based on main entity UESURI.

Parameters:

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

    UESURI of main entity (either artifact or any aggregated object)

  • parameters (ScriptExec)

    DTO containing script execution parameters

Returns:

  • (UU::OS::UESURI)

    UESURI of process in which the script is executed



24
25
26
27
28
29
30
31
32
# File 'uu_os-0.29.16/lib/uu/os/script.rb', line 24

def exec(main_entity_uri, parameters)
  svc = UU::OS::REST::RemoteClient.new(Script)
  # Request is send as form data (server has problems with deserialization of DTO with object attributes)
  payload = UU::OS::Script::ScriptExec.new(parameters).to_hash
  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.post('exec', main_entity_uri, payload)
    return UU::OS::UESURI.new(res)
  end
end