Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To specify the enrich operator, you can use the simplest form in PQL:

enriching = ENRICHCONTEXTENRICH({store = 'door5'}, inputoperator)

As the definition of the store-operator, you only have to define the store you want to read from. In this case, the complete tuple from the store is attached to the current tuple in the context-enrich-operator. Thus, the resulting outputschema is the concatenation of the input-schema of the enrich (or rather the stream that should be enriched by the operator) plus the outputschema of the context store.

Since, the tuple in the context store could have a lot of attributes and you only want to use a subset of them, you can also (optional) specify a list of attributes that are used for the enrichment:

enriching = ENRICHCONTEXTENRICH({store = 'door5', attributes=['state']}, inputoperator)

...

As mentioned before, the enrich only produces results if there is at least one context state in the context store that temporally correlates with the incoming event (which means: they have overlapping timeintervals). In this case, it may happen that the event that has to be enrich is to old and there is no suitable context state, e.g.: the event a is valid at [100;120) and the context state c is valid at [200;oo). Thus, the event a cannot be enriched because it is too old. If you still want to use such a event but without an enriched context state, you can use the outer-option:

enriching = ENRICHCONTEXTENRICH({store = 'door5', attributes=['state'], outer='true'}, inputoperator)

...