Machines.runInstantiatedMachine()

Run a machine which is already instantiated using the provided input values.

Usage

Hover over inputs/exits for more info.

var Machines = require('machinepack-machines');


// Run a machine which is already instantiated using the provided input values.

Machines.runInstantiatedMachine({

machineInstance: '===',

inputValues: [ { name: 'someInput', value: '===' } ],

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// A configured input value does not correspond with a real input in this machine.

unknownInput: function () {

 

},

// The return value could not be stringified into JSON - perhaps it contains circular references?

cantStringifyOutput: function (result) {

 

},

// OK.

success: function (whatHappened) {

 

},

});

Inputs

machineInstance required

The already-instantiated machine instance.

'==='
inputValues

A set of input name/value pairs.

[ { name: 'someInput', value: '===' } ]

Exits

error

An unexpected error occurred.

unknownInput

A configured input value does not correspond with a real input in this machine.

cantStringifyOutput

The return value could not be stringified into JSON - perhaps it contains circular references?

{ outcome: 'success',
  output: '===',
  inspectedOutput: '{ stuff: "things" }',
  duration: 2948 }
success

OK.

{ outcome: 'success',
  output: '===',
  jsonStringifiedOutput: '{"stuff": "things"}',
  inspectedOutput: '{ stuff: "things" }',
  duration: 2948 }