eiffel-community/eiffel-intelligence

Add support for upstream event aggregation from non start events

Opened this issue · 0 comments

Description

In issue #360 we discovered that HistoryRules are currently only supported for the start event of an aggregation. Eiffel Intelligence will not search for (and aggregate) upstream events which are linked from Eiffel events coming after the start event.

Current behavior, somewhat simplified:

  • Eiffel Intelligence receives an Eiffel event which is defined in the rules as a start event.
  • Eiffel Intelligence makes a query to ER to find all upstream events linked from the start event.
  • Eiffel Intelligence traverses the list of Eiffel events (if any) and extracts data from those to include in the existing aggregation.
  • A second event is received.
  • Eiffel Intelligence extracts data according to the rules definition and inserts updates into the existing aggregation.

In some cases however, we might want to include a linked upstream event of a specific type and include it in the aggregation. For example if the second event has a linked upstream event which is not directly related to the start event, we might want to search ER anyway for that specific upstream event and include it in the aggregation.

Use cases:

  • We've so far seen one use case for this with the FlowContextDefined event. See details in issue #360 . These events are linked with FLOW_CONTEXT, and it could be possible to limit this upstream search based on link types (see described drawbacks below)

Question: Could another possible candidate for upstream searches be links of type CONTEXT?

Motivation

Exemplification

Wanted behavior: (in comparison to the above described current behavior)

  • Eiffel Intelligence receives an Eiffel event which is defined in the rules as a start event, (type A).
  • Eiffel Intelligence makes a query to ER to find all upstream events linked from the start event.
  • Eiffel Intelligence traverses the list of Eiffel events (if any) and extracts data from those to include in the existing aggregation.
  • A second event of type B is received, which links to the start event.
  • Eiffel Intelligence extracts data according to the rules definition and inserts updates into the existing aggregation.
  • Since HistoryRules for link of types FLOW_CONTEXT is defined for event type B, Eiffel Intelligence searches ER for any links of that type from the type B event.
  • If any upstream event is found linked with FLOW_CONTEXT from even type B this is included in the aggregation

Benefits

It becomes possible to link valuable information extracted from events which are not directly linked to the start event but rather a second or third event in the chain.

Possible Drawbacks

The aggregation could potentially become very large if we include several linked upstream events for, not just the start event, but also following upstream links from the second and third events coming in.

To avoid the aggregation growing too large we want to limit this feature for non start events to only search ER:

  • when we find a specific link type of interest, e.g. we search upstream links of type FLOW_CONTEXT but not links of type CAUSE.
    And it would also be prudent to only perform an upstream link search with 1 level limit from non-start events.

This would mean that when a non-start event (e.g. ConfidenceLevelModified) comes in, Eiffel Intelligence would search upstream only for the links of interest and only 1 level. If the only links of interest defined in the ruleset is FLOW_CONTEXT Eiffel Intelligence would only search ER for the directly linked FlowContextDefined event from the ConfidenceLevelModified event, and not any further up in the chain.