eiffel-community/eiffel-intelligence

Query to find test aggregations is broken

Closed this issue · 2 comments

Description

When using TestExecutionObjectRules-Eiffel-Agen-Version.json rules in the endpoint /rule-test/run-full-aggregation they fail to show the generated aggregation in the GUI.

This is because Eiffel Intelligence doesn't find the resulting aggregation from the database. It has aggregated the events according to the rules. But these rules does not define an "id" to be at the root of the agrgegated object, causing the query to retrieve the test aggregation to fail.

Motivation

Hard coded values that expect the rules to be defined a certain way is not a good idea. If the rules are updated in the future (or custom rules are tested) we can not expect users to have defined the aggregation structure. The only thing we can expect is that Eiffel Intelligence has stored the aggregation with an "_id".

Exemplification

Method getAggregatedObjctByTemplateName in ProcessAggregatedObject.java contains a query that needs to be updated.

The key to search for should be "_id" not "id" - since we can't expect all and every custom rule set to put an "id" in the root of the aggregation.

Benefits

Being able to test the TestExecution rules in the /rule-test/ endpoint.

Possible Drawbacks

None.

Closing this issue since the code changes have been merged.

Sorry, wrong issue 😄 Reopening this