Event Gate

Block Group: Logic
Icon:Event Gate block icon

The Event Gate block listens for changes to its input properties and fires a new event when all of the input properties have changed.

A change occurs when the property's value becomes different from its initial value when the page is first loaded, or when the value changes after a reset is triggered. An initial output of a Script block that is set to autorun is an initial value of the property and is not considered a change.

Optionally, this block can also log the order of the changes it listens for.

A common use of the Event Gate block is to make sure all relevant strings are loaded before beginning data analysis.

Note

Make sure to remove any unused input properties, to ensure that the block fires an event when finished.

For information on using dataflow blocks, see Dataflow.


Input/Output Properties

The following properties of the Event Gate block can take input and give output.

  • reset (trigger)
  • logOrder (enum or string)
  • input n

reset resets the listener.

logOrder specifies whether and how events are logged. Logging begins with a reset and ends when all fields have been updated at least once. The value of the logOrder property can be one of the following:

  • none: Events are not logged.
  • firstOccurance: The block logs the order in which each input received its first update. For example, if the order of changes is input 0, input 2, input 0, input 1, the logged order is 0,2,1.
  • lastOccurance: The block logs the order in which each input received its most recent update. For example, if the order of changes is input 0, input 2, input 0, input 1, the logged order is 2,0,1.
  • all: The block logs the order of all input changes, stopping when all fields have been updated at least once. For example, if the order of changes is input 0, input 2, input 0, input 1, the logged order is 0,2,0,1.

input n specifies one of the values that this block listens to.


Output Properties

The following properties of the Event Gate block can give output but cannot take input.

  • onFinish (event)
  • order (string)

onFinish fires when all of the inputs have been updated at least once.

order returns the logged order, as dictated by the logOrder property, as a comma-separated list of input indexes.


Example

The following image shows an Event Gate block. In this example, it is evident that the three strings have been loaded and that the event has fired, because the logOrder property is populated.

Event Gate dataflow model