eiffel-community/eiffel-intelligence

Testing new rules should not result in queries to ER

Opened this issue · 0 comments

Description

The TestRules feature sends a real request to ER to find upstream events, and completely ignores the provided set of Eiffel events provided by the user. Only the start event and downstream events are taken into account in the TestRules engine, and if the user included any upstream historical events these are ignored.

https://github.com/eiffel-community/eiffel-intelligence/blob/0b865120ca16a36c121e35b557b7903ce2769039/wiki/running-rules-on-objects.md

The query to ER is also faulty, because all of the provided test events are suffixed with the rules 'TemplateName' field to the UUID - so the request will always fail because no such events exist in ER.

private void addTemplateNameToIds(JSONObject jsonObject, final String suffix) throws JSONException {

Motivation

The purpose of TestRules is to test a new ruleset, to see if they aggregate event data in the expected format. A real query to ER should not be performed. Instead all of the test events provided by the user should be used, and only those events. The user is expected to provide all necessary Eiffel events for the Testrules.

Exemplification

If the provided Eiffel events are used for the test rules engine, all the data should already be present for the rules engine to generate an aggregation.

Benefits

Without an upstream search to ER for historical events, the resulting aggregation should be be visible for the user quickly, so they can make adjustments to the ruleset if needed.

Possible Drawbacks

The provided Eiffel events from the user might need to be validated to ensure the links are set up properly between the events.