Skip to content

Process types

Bartosz Balis edited this page Jul 30, 2019 · 12 revisions

Dataflow

This is the default process behavior: (i) wait for all data input signals; (ii) invoke the task function passing the inputs; (iii) emits all output signals (which are supposed to be returned by the function).

Inputs:

  • Zero or more data inputs
  • In the case there are zero data inputs, there should be defined the firingInterval attribute which specifies (in miliseconds) the interval rate at which the function of the process should be invoked.

Outputs:

  • At least one data output

Function:

  • ins and outs arrays contain, respectively, all data inputs and information on all data outputs (ins[0] contains in1, outs[0] contains out1, etc.).

Choice

A choice process behaves similarly to dataflow but in each firing it may emit only some or none of its output signals. To this end, the function of the choice task must explicitly set a flag to denote which of the outputs should be emitted. This behavior is very useful for such patterns as conditional execution, data filtering or data routing

Inputs:

  • Zero or more data inputs
  • Optional "next" signal
  • Optional "done" signal

Outputs:

  • Zero or more data outputs
  • Optional "next" signal
  • Optional "done" signal

Function:

  • ins and outs arrays contain, respectively, all data inputs and information on all data outputs (ins[0] contains in1, outs[0] contains out1, etc.).
  • The function should set flag "condition": "true" in all elements of the outs array that should be emitted.

Join

A join process joins/merges parallel branches of execution represented by its input signals. The behavior of a join process is governed by two parameters:

  • Nb ('active branches count'): how many input branches out of total N (Nb <= N) are active?
  • Nj ('join count'): how many branches to wait for before firing? (Nj <= Nb)

For example, if N=4, Nb=3 and Nj=1, the join process will work according to the following steps:

  • wait for one (Nj) signal on any input, and fire (invoke the function).
  • wait for the signals on the two remaining active branches (Nb total), and discard these signals.
  • 'reset', i.e. go back to waiting for input signals.

The join process enables the implementation of various workflow control patterns (http://www.workflowpatterns.com):

  • Structured discriminator
  • Blocking discriminator
  • Structured partial join
  • Blocking partial join
  • Local synchronizing merge

Inputs:

  • One or more data inputs
  • Optional "next" signal
  • Optional "done" signal

Outputs:

  • Zero or more data outputs
  • Optional "next" signal
  • Optional "done" signal

Function:

  • In a given firing, the function is passed only Nj signals (ones that arrived first). Consequently, the signals should be recognized in the function by their name, not by index, as it is not known which Nj (out of Nb) signals actually caused the firing.
Clone this wiki locally