\r\n

51Degrees Pipeline Node.js  4.4

51Degrees Pipeline for Node.js

FlowData Class Reference

Detailed Description

FlowData is created by a specific pipeline It collects evidence set by the user It passes evidence to flowElements in the pipeline These elements can return ElementData or populate an errors object.

Public Member Functions

 constructor (pipeline)
constructor for flowData created by a pipeline. More...
 getEvidenceDataKey ()
Get back an object that lists all evidence that will be used by any flowElements in the flowData's parent pipeline. More...
 stop ()
Stop a flowData from processing any further flowElements.
 setError (error, flowElement)
Set an error on the flowData (usually triggered by something going wrong in a flowElement's process function) More...
 process ()
Processes the flowData (running the process methods on all connected) More...
 setElementData (data)
Add to the flowData object with a class derived from ElementData. More...
 get (flowElementDataKey)
Get ElementData by a flowElement's data key. More...
 getFromElement (flowElement)
 getWhere (metaKey, metaValueorFuncton)
get an object ({key:value} store) of elementData based on a metadata key and value, alternatively pass in a filtering function to manually filter available propeties More...

Member Function Documentation

◆ constructor()

FlowData::constructor (   pipeline )
inline

constructor for flowData created by a pipeline.

Called by a pipeline's createFlowData() method

Parameters
{Pipeline} - pipeline the pipeline to add the FlowData to

◆ getEvidenceDataKey()

FlowData::getEvidenceDataKey ( )
inline

Get back an object that lists all evidence that will be used by any flowElements in the flowData's parent pipeline.

Returns
{object} Evidence that is requested by flowElements

◆ getWhere()

FlowData::getWhere (   metaKey,
  metaValueorFuncton  
)
inline

get an object ({key:value} store) of elementData based on a metadata key and value, alternatively pass in a filtering function to manually filter available propeties

Parameters
{string} - metaKey a metakey such as "category"
{string|Function} - metaValueorFuncton value or a filter function which receives the value of the metaKey and returns a boolean
Returns
{object} key value pair of matching properties and values

◆ process()

FlowData::process ( )
inline

Processes the flowData (running the process methods on all connected)

Returns
{Promise} result of processing

◆ setError()

FlowData::setError (   error,
  flowElement  
)
inline

Set an error on the flowData (usually triggered by something going wrong in a flowElement's process function)

Parameters
{*} - error the error to throw
{FlowElement} - flowElement the FlowElement the error is thrown on