51Degrees Pipeline Node.js  4.1

51Degrees Pipeline for Node.js

FlowElement Class Reference

Detailed Description

A FlowElement is placed inside a pipeline It receives Evidence via a FlowData object It uses this to optionally create ElementData on the Flowdata It has a unique dataKey which is used to extract data from the FlowData Any errors in processing are caught in the FlowData's errors object.

Inheritance diagram for FlowElement:

[legend]

Public Member Functions

 constructor ({ processInternal, dataKey, properties={}, evidenceKeyFilter }={})
Constructor for flowElement class. More...
 onRegistration (pipeline, flowElement)
Internal function to be called when a FlowElement is added to pipeline, runs through any registrationCallbacks on the FlowElement. More...
 ready ()
Function called to check if a FlowElement is ready Used when there are asynchronous initialisation steps. More...
 processInternal (flowData)
Internal process function for a particular flowElement called (via the flowElement.process() method) when flowData generated by a pipleline is processsed. More...
 process (flowData)
To allow actions to take place before and after a FlowElement's processInternal function runs, a process wrapper is run first. More...
 updateProperties ()
Call this function to update the properties meta database in all the pipelines this flowElement has been added to. More...
 getProperties ()
Get a flowElement's properties. More...

Member Function Documentation

◆ constructor()

FlowElement::constructor (   { processInternal, dataKey, properties={}, evidenceKeyFilter } = {} )
inline

Constructor for flowElement class.

Parameters
{object} - options options for the FlowElement
{string} - options.dataKey the dataKey the flowElement's elementData will be stored under
{Function} - options.processInternal callback to act on flowData
{object} - options.properties list of properties including metadata
{{EvidenceKeyFilter}} - options.evidenceKeyFilter an instance of an EvidenceKeyFilter to filter evidence added to the Pipeline

◆ getProperties()

FlowElement::getProperties ( )
inline

Get a flowElement's properties.

By default returns a promise wrapped version of the object's properties list Can return standard value or promise

Returns
{object} dictionary of properties

◆ onRegistration()

FlowElement::onRegistration (   pipeline,
  flowElement  
)
inline

Internal function to be called when a FlowElement is added to pipeline, runs through any registrationCallbacks on the FlowElement.

Parameters
{Pipeline} - pipeline the Pipeline the FlowElement is registered with
{FlowElement} - flowElement The FlowElement the registration callback is called on

◆ process()

FlowElement::process (   flowData )
inline

To allow actions to take place before and after a FlowElement's processInternal function runs, a process wrapper is run first.

Parameters
{FlowData} - flowData FlowData being processed
Returns
{Promise} FlowData after processing

◆ processInternal()

FlowElement::processInternal (   flowData )
inline

Internal process function for a particular flowElement called (via the flowElement.process() method) when flowData generated by a pipleline is processsed.

Overriden by instances of this base class

Parameters
{FlowData} - flowData FlowData being processed
Returns
{Mixed} result of processing

◆ ready()

FlowElement::ready ( )
inline

Function called to check if a FlowElement is ready Used when there are asynchronous initialisation steps.

Returns
{Promise}

◆ updateProperties()

FlowElement::updateProperties ( )
inline

Call this function to update the properties meta database in all the pipelines this flowElement has been added to.

Returns
{Promise} notification of complete updates