\r\n

51Degrees Pipeline Python  4.4

51Degrees Pipeline for Python

fiftyone_pipeline_core.flowdata.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

def  __init__ (self, pipeline)
FlowData constructor. More...
def  process (self)
Runs the process function on every attached flowElement allowing data to be changed based on evidence. More...
def  get_from_element (self, flow_element)
Retrieve data by FlowElement object. More...
def  get (self, flow_element_key)
Retrieve data by flowElement key. More...
def  __getattr__ (self, flow_element_key)
Magic getter to allow retrieval of data from FlowData.data[flowElementKey] by flowElement name. More...
def  __getitem__ (self, flow_element_key)
Magic method in Python, which when used in a class, allows its instances to use the [] (indexer) operators. More...
def  set_element_data (self, element_data)
Set data (used by flowElement) within FlowData.data. More...
def  set_error (self, flow_error)
Set error (should be keyed by flowElement datakey) More...
def  get_evidence_datakey (self)
Get a list of evidence stored in the flowdata, filtered by its flowElements' evidenceKeyFilters. More...
def  stop (self)
Stop processing any subsequent flowElements. More...
def  get_where (self, metakey, metavalue)
Get data from flowElement based on property meta data. More...

Public Attributes

 data
 errors
 pipeline
 processed
 stopped
 evidence

Constructor & Destructor Documentation

◆ __init__()

def fiftyone_pipeline_core.flowdata.FlowData.__init__ (   self,
  pipeline  
)

FlowData constructor.

@type pipeline: Pipeline

Parameters
pipeline - parent pipeline

Member Function Documentation

◆ __getattr__()

def fiftyone_pipeline_core.flowdata.FlowData.__getattr__ (   self,
  flow_element_key  
)

Magic getter to allow retrieval of data from FlowData.data[flowElementKey] by flowElement name.

For example, instead of flowdata.get("device") you can use flowdata.device

@type flow_element_key: string

Parameters
flow_element_key - datakey of the FlowElement that created the data of interest

@rtype: ElementData

◆ __getitem__()

def fiftyone_pipeline_core.flowdata.FlowData.__getitem__ (   self,
  flow_element_key  
)

Magic method in Python, which when used in a class, allows its instances to use the [] (indexer) operators.

For example, instead of flowdata.get("device") you can use flowdata["device"]

@type flow_element_key: string

Parameters
flow_element_key - datakey of the FlowElement that created the data of interest

@rtype: ElementData

◆ get()

def fiftyone_pipeline_core.flowdata.FlowData.get (   self,
  flow_element_key  
)

Retrieve data by flowElement key.

Called by FlowData.get_from_element method.

@type flow_element_key: string

Parameters
flow_element_key - FlowElement.datakey of the FlowElement that created the data of interest

@rtype: ElementData

Returns
: Returns data in the FlowData instance that is under the specified key

◆ get_evidence_datakey()

def fiftyone_pipeline_core.flowdata.FlowData.get_evidence_datakey (   self )

Get a list of evidence stored in the flowdata, filtered by its flowElements' evidenceKeyFilters.

@rtype: list

Returns
: Returns filtered evidence

◆ get_from_element()

def fiftyone_pipeline_core.flowdata.FlowData.get_from_element (   self,
  flow_element  
)

Retrieve data by FlowElement object.

@type flow_element: FlowElement

Parameters
flow_element - FlowElement that created the data of interest

@rtype: ElementData

Returns
: Returns data that was created by the flowElement held in the FlowData

◆ get_where()

def fiftyone_pipeline_core.flowdata.FlowData.get_where (   self,
  metakey,
  metavalue  
)

Get data from flowElement based on property meta data.

@type metakey: str

Parameters
metakey - metakey shared by all data of interest

@type metavalue: mixed

Parameters
metavalue - meta value shared by all data of interest

@rtype: dict

Returns
: Returns dictionary of data created by the flowElement that have the specified meta property

◆ process()

def fiftyone_pipeline_core.flowdata.FlowData.process (   self )

Runs the process function on every attached flowElement allowing data to be changed based on evidence.

This can only be run once per FlowData instance.

@rtype: FlowData

Returns
: Returns flowdata

◆ set_element_data()

def fiftyone_pipeline_core.flowdata.FlowData.set_element_data (   self,
  element_data  
)

Set data (used by flowElement) within FlowData.data.

@type element_data: ElementData

Parameters
element_data - elementData to be added to flowdata

◆ set_error()

def fiftyone_pipeline_core.flowdata.FlowData.set_error (   self,
  flow_error  
)

Set error (should be keyed by flowElement datakey)

@type error: FlowError

Parameters
error - Flow Error

◆ stop()

def fiftyone_pipeline_core.flowdata.FlowData.stop (   self )

Stop processing any subsequent flowElements.

Returns
void

Member Data Documentation

◆ data

fiftyone_pipeline_core.flowdata.FlowData.data

◆ errors

fiftyone_pipeline_core.flowdata.FlowData.errors

◆ evidence

fiftyone_pipeline_core.flowdata.FlowData.evidence

◆ pipeline

fiftyone_pipeline_core.flowdata.FlowData.pipeline

◆ processed

fiftyone_pipeline_core.flowdata.FlowData.processed

◆ stopped

fiftyone_pipeline_core.flowdata.FlowData.stopped
On This Page