diff --git a/drools-ansible-rulebook-integration-api/src/main/java/org/drools/ansible/rulebook/integration/api/LogUtil.java b/drools-ansible-rulebook-integration-api/src/main/java/org/drools/ansible/rulebook/integration/api/LogUtil.java index b83f13b..75a97da 100644 --- a/drools-ansible-rulebook-integration-api/src/main/java/org/drools/ansible/rulebook/integration/api/LogUtil.java +++ b/drools-ansible-rulebook-integration-api/src/main/java/org/drools/ansible/rulebook/integration/api/LogUtil.java @@ -1,7 +1,12 @@ package org.drools.ansible.rulebook.integration.api; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; + public class LogUtil { private LogUtil() { @@ -10,18 +15,26 @@ private LogUtil() { // convert java class to python class private static Map, String> convertMap = Map.of( - java.lang.Integer.class, "int", - java.lang.Boolean.class, "bool", - java.lang.String.class, "str", - java.lang.Double.class, "float", - java.util.List.class, "list", - java.util.ArrayList.class, "list", - java.util.Map.class, "dict", - java.util.LinkedHashMap.class, "dict", - java.util.HashMap.class, "dict" + Integer.class, "int", + Boolean.class, "bool", + String.class, "str", + Double.class, "float", + List.class, "list", + ArrayList.class, "list", + Map.class, "dict", + LinkedHashMap.class, "dict", + HashMap.class, "dict" ); public static String convertJavaClassToPythonClass(Class javaClass) { - return convertMap.getOrDefault(javaClass, javaClass.getSimpleName()); + if (convertMap.containsKey(javaClass)) { + return convertMap.get(javaClass); + } + if (List.class.isAssignableFrom(javaClass)) { + return "list"; + } else if (Map.class.isAssignableFrom(javaClass)) { + return "dict"; + } + return javaClass.getSimpleName(); } } diff --git a/drools-ansible-rulebook-integration-api/src/test/java/org/drools/ansible/rulebook/integration/api/ArrayAccessWithoutIndexTest.java b/drools-ansible-rulebook-integration-api/src/test/java/org/drools/ansible/rulebook/integration/api/ArrayAccessWithoutIndexTest.java new file mode 100644 index 0000000..a54dd92 --- /dev/null +++ b/drools-ansible-rulebook-integration-api/src/test/java/org/drools/ansible/rulebook/integration/api/ArrayAccessWithoutIndexTest.java @@ -0,0 +1,775 @@ +package org.drools.ansible.rulebook.integration.api; + +import java.util.List; + +import org.junit.Ignore; +import org.junit.Test; +import org.kie.api.runtime.rule.Match; + +import static org.junit.Assert.assertEquals; + +public class ArrayAccessWithoutIndexTest { + + @Test + public void testSelectAttrForArrayInArray() { + + String JSON_ARRAY_IN_ARRAY = + """ + { + "rules":[ + { + "Rule":{ + "name":"r1", + "condition":{ + "AllCondition":[ + { + "SelectAttrExpression":{ + "lhs":{ + "Event":"incident.alerts.tags" + }, + "rhs":{ + "key":{ + "String":"value" + }, + "operator":{ + "String":"==" + }, + "value":{ + "String":"DiskUsage" + } + } + } + } + ] + }, + "actions":[ + { + "Action":{ + "action":"debug", + "action_args":{ + "msg":"Found a match with alerts" + } + } + } + ], + "enabled":true + } + } + ] + } + """; + + RulesExecutor rulesExecutor = RulesExecutorFactory.createFromJson(JSON_ARRAY_IN_ARRAY); + + List matchedRules = rulesExecutor.processFacts( """ + { + "incident":{ + "id":"aaa", + "active":false, + "alerts":[ + { + "id":"bbb", + "tags":[ + { + "name":"alertname", + "value":"MariadbDown" + }, + { + "name":"severity", + "value":"critical" + } + ], + "status":"Ok" + }, + { + "id":"ccc", + "tags":[ + { + "name":"severity", + "value":"critical" + }, + { + "name":"alertname", + "value":"DiskUsage" + } + ], + "status":"Ok" + } + ] + } + } + """ ).join(); + assertEquals( 1, matchedRules.size() ); + + rulesExecutor.dispose(); + } + + @Test + public void testSelectAttrForArrayInMapInArray() { + + String JSON_ARRAY_IN_MAP_IN_ARRAY = + """ + { + "rules":[ + { + "Rule":{ + "name":"r1", + "condition":{ + "AllCondition":[ + { + "SelectAttrExpression":{ + "lhs":{ + "Event":"incident.alerts.meta.tags" + }, + "rhs":{ + "key":{ + "String":"value" + }, + "operator":{ + "String":"==" + }, + "value":{ + "String":"DiskUsage" + } + } + } + } + ] + }, + "actions":[ + { + "Action":{ + "action":"debug", + "action_args":{ + "msg":"Found a match with alerts" + } + } + } + ], + "enabled":true + } + } + ] + } + """; + + RulesExecutor rulesExecutor = RulesExecutorFactory.createFromJson(JSON_ARRAY_IN_MAP_IN_ARRAY); + + List matchedRules = rulesExecutor.processFacts( """ + { + "incident":{ + "id":"aaa", + "active":false, + "alerts":[ + { + "id":"bbb", + "meta": { + "tags":[ + { + "name":"alertname", + "value":"MariadbDown" + }, + { + "name":"severity", + "value":"critical" + } + ], + "status":"Ok" + } + }, + { + "id":"ccc", + "meta": { + "tags":[ + { + "name":"severity", + "value":"critical" + }, + { + "name":"alertname", + "value":"DiskUsage" + } + ], + "status":"Ok" + } + } + ] + } + } + """ ).join(); + assertEquals( 1, matchedRules.size() ); + + rulesExecutor.dispose(); + } + + @Test + public void testSelectAttrForArrayInArrayWithIndex() { + + String JSON_ARRAY_IN_ARRAY_WITH_INDEX = + """ + { + "rules":[ + { + "Rule":{ + "name":"r1", + "condition":{ + "AllCondition":[ + { + "SelectAttrExpression":{ + "lhs":{ + "Event":"incident.alerts.tags[1]" + }, + "rhs":{ + "key":{ + "String":"value" + }, + "operator":{ + "String":"==" + }, + "value":{ + "String":"DiskUsage" + } + } + } + } + ] + }, + "actions":[ + { + "Action":{ + "action":"debug", + "action_args":{ + "msg":"Found a match with alerts" + } + } + } + ], + "enabled":true + } + } + ] + } + """; + + RulesExecutor rulesExecutor = RulesExecutorFactory.createFromJson(JSON_ARRAY_IN_ARRAY_WITH_INDEX); + + List matchedRules = rulesExecutor.processFacts( """ + { + "incident":{ + "id":"aaa", + "active":false, + "alerts":[ + { + "id":"bbb", + "tags":[ + { + "name":"alertname", + "value":"MariadbDown" + }, + { + "name":"severity", + "value":"critical" + } + ], + "status":"Ok" + }, + { + "id":"ccc", + "tags":[ + { + "name":"severity", + "value":"critical" + }, + { + "name":"alertname", + "value":"DiskUsage" + } + ], + "status":"Ok" + } + ] + } + } + """ ).join(); + assertEquals( 1, matchedRules.size() ); + + rulesExecutor.dispose(); + } + + @Test + public void testSelectAttrForArrayInArrayInArray() { + + String JSON_ARRAY_IN_ARRAY_IN_ARRAY = + """ + { + "rules":[ + { + "Rule":{ + "name":"r1", + "condition":{ + "AllCondition":[ + { + "SelectAttrExpression":{ + "lhs":{ + "Event":"incident.alerts.tags.messages" + }, + "rhs":{ + "key":{ + "String":"value" + }, + "operator":{ + "String":"==" + }, + "value":{ + "String":"DiskUsage" + } + } + } + } + ] + }, + "actions":[ + { + "Action":{ + "action":"debug", + "action_args":{ + "msg":"Found a match with alerts" + } + } + } + ], + "enabled":true + } + } + ] + } + """; + + RulesExecutor rulesExecutor = RulesExecutorFactory.createFromJson(JSON_ARRAY_IN_ARRAY_IN_ARRAY); + + List matchedRules = rulesExecutor.processFacts( """ + { + "incident":{ + "id":"aaa", + "active":false, + "alerts":[ + { + "id":"bbb", + "tags":[ + { + "messages":[ + { + "name":"alertname", + "value":"MariadbDown" + }, + { + "name":"severity", + "value":"critical" + } + ] + }, + { + "messages":[ + { + "name":"severity", + "value":"low" + }, + { + "name":"notification", + "value":"access" + } + ] + } + ], + "status":"Ok" + }, + { + "id":"ccc", + "tags":[ + { + "messages":[ + { + "name":"severity", + "value":"critical" + }, + { + "name":"alertname", + "value":"DiskUsage" + } + ] + }, + { + "messages":[ + { + "name":"severity", + "value":"low" + }, + { + "name":"notification", + "value":"access" + } + ] + } + ], + "status":"Ok" + } + ] + } + } + """ ).join(); + assertEquals( 1, matchedRules.size() ); + + rulesExecutor.dispose(); + } + + @Ignore("At the moment, non-index-array ('alerts') does not support two-dimensional arrays.") + @Test + public void testSelectAttrForTwoDimensionArray() { + + String JSON_TWO_DIMENSION_ARRAY = + """ + { + "rules":[ + { + "Rule":{ + "name":"r1", + "condition":{ + "AllCondition":[ + { + "SelectAttrExpression":{ + "lhs":{ + "Event":"incident.alerts.tags" + }, + "rhs":{ + "key":{ + "String":"value" + }, + "operator":{ + "String":"==" + }, + "value":{ + "String":"DiskUsage" + } + } + } + } + ] + }, + "actions":[ + { + "Action":{ + "action":"debug", + "action_args":{ + "msg":"Found a match with alerts" + } + } + } + ], + "enabled":true + } + } + ] + } + """; + + RulesExecutor rulesExecutor = RulesExecutorFactory.createFromJson(JSON_TWO_DIMENSION_ARRAY); + + List matchedRules = rulesExecutor.processFacts( """ + { + "incident":{ + "id":"aaa", + "active":false, + "alerts":[ + [ + { + "name":"alertname", + "value":"MariadbDown" + }, + { + "name":"severity", + "value":"critical" + } + ], + [ + { + "name":"severity", + "value":"critical" + }, + { + "name":"alertname", + "value":"DiskUsage" + } + ] + ] + } + } + """ ).join(); + + assertEquals( 1, matchedRules.size() ); + + rulesExecutor.dispose(); + } + + @Test + public void testListContainsForArrayInArray() { + + String JSON_ARRAY_IN_ARRAY = + """ + { + "rules":[ + { + "Rule":{ + "name":"r1", + "condition":{ + "AllCondition":[ + { + "ListContainsItemExpression":{ + "lhs":{ + "Event":"incident.alerts.tags" + }, + "rhs":{ + "String":"DiskUsage" + } + } + } + ] + }, + "actions":[ + { + "Action":{ + "action":"debug", + "action_args":{ + "msg":"Found a match with alerts" + } + } + } + ], + "enabled":true + } + } + ] + } + """; + + RulesExecutor rulesExecutor = RulesExecutorFactory.createFromJson(JSON_ARRAY_IN_ARRAY); + + List matchedRules = rulesExecutor.processFacts( """ + { + "incident":{ + "id":"aaa", + "active":false, + "alerts":[ + { + "id":"bbb", + "tags":[ + "MariadbDown", + "Hello" + ], + "status":"Ok" + }, + { + "id":"ccc", + "tags":[ + "Good Bye", + "DiskUsage" + ], + "status":"Ok" + } + ] + } + } + """ ).join(); + assertEquals( 1, matchedRules.size() ); + + rulesExecutor.dispose(); + } + + @Test + public void testSelectForArrayInArray() { + + String JSON_ARRAY_IN_ARRAY = + """ + { + "rules": [ + { + "Rule": { + "name": "r1", + "condition": { + "AllCondition": [ + { + "SelectExpression": { + "lhs": { + "Event": "persons.levels" + }, + "rhs": { + "operator": { + "String": ">" + }, + "value": { + "Integer": 25 + } + } + } + } + ] + }, + "actions": [ + { + "Action": { + "action": "echo", + "action_args": { + "message": "Hurray" + } + } + } + ], + "enabled": true + } + } + ] + } + """; + + RulesExecutor rulesExecutor = RulesExecutorFactory.createFromJson(JSON_ARRAY_IN_ARRAY); + + List matchedRules = rulesExecutor.processFacts(""" + { + "persons":[ + { + "name":"Fred", + "age":54, + "levels":[ + 10, + 20, + 30 + ] + }, + { + "name":"John", + "age":36, + "levels":[ + 10, + 16 + ] + } + ] + } + """).join(); + assertEquals(1, matchedRules.size()); + + rulesExecutor.dispose(); + } + + @Test + public void testSimpleOperatorWithArrayCollectAsLeafNode_shouldFail() { + String JSON_ARRAY_IN_ARRAY = + """ + { + "rules": [ + { + "Rule": { + "condition": { + "AllCondition": [ + { + "EqualsExpression": { + "lhs": { + "Fact": "os.array[1].versions" + }, + "rhs": { + "String": "Vista" + } + } + } + ] + }, + "enabled": true, + "name": null + } + } + ] + } + """; + + RulesExecutor rulesExecutor = RulesExecutorFactory.createFromJson(JSON_ARRAY_IN_ARRAY); + + List matchedRules = rulesExecutor.processFacts( """ + { + "host":"B", + "os":{ + "array":[ + { + "name":"abc", + "versions":"Unknown" + }, + { + "name":"windows", + "versions":["XP", "Millenium", "Vista"] + } + ] + } + } + """ ).join(); + + // "os.array[1].versions" returns a list, so it hits a type mismatch error "list and str" + assertEquals( 0, matchedRules.size() ); + + rulesExecutor.dispose(); + } + + @Test + public void testSimpleOperatorWithArrayCollectAsIntermediateNode_shouldFail() { + String JSON_ARRAY_IN_ARRAY = + """ + { + "rules": [ + { + "Rule": { + "condition": { + "AllCondition": [ + { + "EqualsExpression": { + "lhs": { + "Fact": "os.array.versions[2]" + }, + "rhs": { + "String": "Vista" + } + } + } + ] + }, + "enabled": true, + "name": null + } + } + ] + } + """; + + RulesExecutor rulesExecutor = RulesExecutorFactory.createFromJson(JSON_ARRAY_IN_ARRAY); + + List matchedRules = rulesExecutor.processFacts( """ + { + "host":"B", + "os":{ + "array":[ + { + "name":"abc", + "versions":"Unknown" + }, + { + "name":"windows", + "versions":["XP", "Millenium", "Vista"] + } + ] + } + } + """ ).join(); + + // "os.array.versions[2]" returns a list, because 'array' means all elements in 'array'. + // So it hits a type mismatch error "list and str" + assertEquals( 0, matchedRules.size() ); + + rulesExecutor.dispose(); + } +} diff --git a/drools-ansible-rulebook-integration-api/src/test/java/org/drools/ansible/rulebook/integration/api/SelectAttrTest.java b/drools-ansible-rulebook-integration-api/src/test/java/org/drools/ansible/rulebook/integration/api/SelectAttrTest.java index 2cfeaae..7cfc3b1 100644 --- a/drools-ansible-rulebook-integration-api/src/test/java/org/drools/ansible/rulebook/integration/api/SelectAttrTest.java +++ b/drools-ansible-rulebook-integration-api/src/test/java/org/drools/ansible/rulebook/integration/api/SelectAttrTest.java @@ -539,416 +539,4 @@ public void testSelectAttrWithScientificNotation() { rulesExecutor.dispose(); } - - @Test - public void testSelectAttrForArrayInArray() { - - String JSON_ARRAY_IN_ARRAY = - """ - { - "rules":[ - { - "Rule":{ - "name":"r1", - "condition":{ - "AllCondition":[ - { - "SelectAttrExpression":{ - "lhs":{ - "Event":"incident.alerts.tags" - }, - "rhs":{ - "key":{ - "String":"value" - }, - "operator":{ - "String":"==" - }, - "value":{ - "String":"DiskUsage" - } - } - } - } - ] - }, - "actions":[ - { - "Action":{ - "action":"debug", - "action_args":{ - "msg":"Found a match with alerts" - } - } - } - ], - "enabled":true - } - } - ] - } - """; - - RulesExecutor rulesExecutor = RulesExecutorFactory.createFromJson(JSON_ARRAY_IN_ARRAY); - - List matchedRules = rulesExecutor.processFacts( """ - { - "incident":{ - "id":"aaa", - "active":false, - "alerts":[ - { - "id":"bbb", - "tags":[ - { - "name":"alertname", - "value":"MariadbDown" - }, - { - "name":"severity", - "value":"critical" - } - ], - "status":"Ok" - }, - { - "id":"ccc", - "tags":[ - { - "name":"severity", - "value":"critical" - }, - { - "name":"alertname", - "value":"DiskUsage" - } - ], - "status":"Ok" - } - ] - } - } - """ ).join(); - assertEquals( 1, matchedRules.size() ); - - rulesExecutor.dispose(); - } - - @Test - public void testSelectAttrForArrayInMapInArray() { - - String JSON_ARRAY_IN_MAP_IN_ARRAY = - """ - { - "rules":[ - { - "Rule":{ - "name":"r1", - "condition":{ - "AllCondition":[ - { - "SelectAttrExpression":{ - "lhs":{ - "Event":"incident.alerts.meta.tags" - }, - "rhs":{ - "key":{ - "String":"value" - }, - "operator":{ - "String":"==" - }, - "value":{ - "String":"DiskUsage" - } - } - } - } - ] - }, - "actions":[ - { - "Action":{ - "action":"debug", - "action_args":{ - "msg":"Found a match with alerts" - } - } - } - ], - "enabled":true - } - } - ] - } - """; - - RulesExecutor rulesExecutor = RulesExecutorFactory.createFromJson(JSON_ARRAY_IN_MAP_IN_ARRAY); - - List matchedRules = rulesExecutor.processFacts( """ - { - "incident":{ - "id":"aaa", - "active":false, - "alerts":[ - { - "id":"bbb", - "meta": { - "tags":[ - { - "name":"alertname", - "value":"MariadbDown" - }, - { - "name":"severity", - "value":"critical" - } - ], - "status":"Ok" - } - }, - { - "id":"ccc", - "meta": { - "tags":[ - { - "name":"severity", - "value":"critical" - }, - { - "name":"alertname", - "value":"DiskUsage" - } - ], - "status":"Ok" - } - } - ] - } - } - """ ).join(); - assertEquals( 1, matchedRules.size() ); - - rulesExecutor.dispose(); - } - - @Test - public void testSelectAttrForArrayInArrayWithIndex() { - - String JSON_ARRAY_IN_ARRAY = - """ - { - "rules":[ - { - "Rule":{ - "name":"r1", - "condition":{ - "AllCondition":[ - { - "SelectAttrExpression":{ - "lhs":{ - "Event":"incident.alerts.tags[1]" - }, - "rhs":{ - "key":{ - "String":"value" - }, - "operator":{ - "String":"==" - }, - "value":{ - "String":"DiskUsage" - } - } - } - } - ] - }, - "actions":[ - { - "Action":{ - "action":"debug", - "action_args":{ - "msg":"Found a match with alerts" - } - } - } - ], - "enabled":true - } - } - ] - } - """; - - RulesExecutor rulesExecutor = RulesExecutorFactory.createFromJson(JSON_ARRAY_IN_ARRAY); - - List matchedRules = rulesExecutor.processFacts( """ - { - "incident":{ - "id":"aaa", - "active":false, - "alerts":[ - { - "id":"bbb", - "tags":[ - { - "name":"alertname", - "value":"MariadbDown" - }, - { - "name":"severity", - "value":"critical" - } - ], - "status":"Ok" - }, - { - "id":"ccc", - "tags":[ - { - "name":"severity", - "value":"critical" - }, - { - "name":"alertname", - "value":"DiskUsage" - } - ], - "status":"Ok" - } - ] - } - } - """ ).join(); - assertEquals( 1, matchedRules.size() ); - - rulesExecutor.dispose(); - } - - @Test - public void testSelectAttrForArrayInArrayInArray() { - - String JSON_ARRAY_IN_ARRAY = - """ - { - "rules":[ - { - "Rule":{ - "name":"r1", - "condition":{ - "AllCondition":[ - { - "SelectAttrExpression":{ - "lhs":{ - "Event":"incident.alerts.tags.messages" - }, - "rhs":{ - "key":{ - "String":"value" - }, - "operator":{ - "String":"==" - }, - "value":{ - "String":"DiskUsage" - } - } - } - } - ] - }, - "actions":[ - { - "Action":{ - "action":"debug", - "action_args":{ - "msg":"Found a match with alerts" - } - } - } - ], - "enabled":true - } - } - ] - } - """; - - RulesExecutor rulesExecutor = RulesExecutorFactory.createFromJson(JSON_ARRAY_IN_ARRAY); - - List matchedRules = rulesExecutor.processFacts( """ - { - "incident":{ - "id":"aaa", - "active":false, - "alerts":[ - { - "id":"bbb", - "tags":[ - { - "messages":[ - { - "name":"alertname", - "value":"MariadbDown" - }, - { - "name":"severity", - "value":"critical" - } - ] - }, - { - "messages":[ - { - "name":"severity", - "value":"low" - }, - { - "name":"notification", - "value":"access" - } - ] - } - ], - "status":"Ok" - }, - { - "id":"ccc", - "tags":[ - { - "messages":[ - { - "name":"severity", - "value":"critical" - }, - { - "name":"alertname", - "value":"DiskUsage" - } - ] - }, - { - "messages":[ - { - "name":"severity", - "value":"low" - }, - { - "name":"notification", - "value":"access" - } - ] - } - ], - "status":"Ok" - } - ] - } - } - """ ).join(); - assertEquals( 1, matchedRules.size() ); - - rulesExecutor.dispose(); - } } diff --git a/drools-ansible-rulebook-integration-protoextractor/src/main/java/org/drools/ansible/rulebook/integration/protoextractor/ExtractorUtils.java b/drools-ansible-rulebook-integration-protoextractor/src/main/java/org/drools/ansible/rulebook/integration/protoextractor/ExtractorUtils.java index 5920b8b..fbbd559 100644 --- a/drools-ansible-rulebook-integration-protoextractor/src/main/java/org/drools/ansible/rulebook/integration/protoextractor/ExtractorUtils.java +++ b/drools-ansible-rulebook-integration-protoextractor/src/main/java/org/drools/ansible/rulebook/integration/protoextractor/ExtractorUtils.java @@ -5,7 +5,6 @@ import org.drools.ansible.rulebook.integration.protoextractor.ast.ExtractorNode; import org.drools.ansible.rulebook.integration.protoextractor.prototype.NormalizedFieldRepresentationVisitor; import org.drools.ansible.rulebook.integration.protoextractor.prototype.ValueCollectVisitor; -import org.drools.ansible.rulebook.integration.protoextractor.prototype.ValueExtractionVisitor; public class ExtractorUtils { private ExtractorUtils() { @@ -17,7 +16,6 @@ public static List getParts(ExtractorNode extractorNode) { } public static Object getValueFrom(ExtractorNode extractorNode, Object readValue) { -// return new ValueExtractionVisitor(readValue).visit(extractorNode); return new ValueCollectVisitor(readValue).visit(extractorNode); } } diff --git a/drools-ansible-rulebook-integration-protoextractor/src/main/java/org/drools/ansible/rulebook/integration/protoextractor/prototype/ValueCollectVisitor.java b/drools-ansible-rulebook-integration-protoextractor/src/main/java/org/drools/ansible/rulebook/integration/protoextractor/prototype/ValueCollectVisitor.java index 81233be..bfddd4c 100644 --- a/drools-ansible-rulebook-integration-protoextractor/src/main/java/org/drools/ansible/rulebook/integration/protoextractor/prototype/ValueCollectVisitor.java +++ b/drools-ansible-rulebook-integration-protoextractor/src/main/java/org/drools/ansible/rulebook/integration/protoextractor/prototype/ValueCollectVisitor.java @@ -12,6 +12,12 @@ import org.drools.ansible.rulebook.integration.protoextractor.ast.SquaredAccessorNode; import org.kie.api.prototype.Prototype; +/** + * ValueCollectVisitor is an improved version of ValueExtractionVisitor. + * This visitor can handle a path expression of an array without an index (e.g. 'alerts' for 'alerts[]'). + * In the case, this visitor evaluates all elements in the array and collects matching children. + * If there is no such a path expression, this works the same as ValueExtractionVisitor. + */ public class ValueCollectVisitor extends DefaultedVisitor { private final Object original; private Object cur; // cur doesn't have to one Node in the event, it can be List of Nodes matching the path diff --git a/drools-ansible-rulebook-integration-protoextractor/src/main/java/org/drools/ansible/rulebook/integration/protoextractor/prototype/ValueExtractionVisitor.java b/drools-ansible-rulebook-integration-protoextractor/src/main/java/org/drools/ansible/rulebook/integration/protoextractor/prototype/ValueExtractionVisitor.java index 8a22989..473b138 100644 --- a/drools-ansible-rulebook-integration-protoextractor/src/main/java/org/drools/ansible/rulebook/integration/protoextractor/prototype/ValueExtractionVisitor.java +++ b/drools-ansible-rulebook-integration-protoextractor/src/main/java/org/drools/ansible/rulebook/integration/protoextractor/prototype/ValueExtractionVisitor.java @@ -11,6 +11,10 @@ import java.util.List; import java.util.Map; +/** + * This visitor is superseded by ValueCollectVisitor. + * This class will be dropped when we are sure that this is no longer needed. + */ public class ValueExtractionVisitor extends DefaultedVisitor { private final Object original; private Object cur;