14
14
15
15
package com .ericsson .ei .handlers ;
16
16
17
- import com .ericsson .ei .erqueryservice .ERQueryService ;
18
- import com .ericsson .ei .erqueryservice .SearchOption ;
19
- import com .ericsson .ei .rules .RulesHandler ;
20
- import com .ericsson .ei .rules .RulesObject ;
21
- import com .fasterxml .jackson .databind .JsonNode ;
22
-
23
17
import org .slf4j .Logger ;
24
18
import org .slf4j .LoggerFactory ;
25
19
import org .springframework .beans .factory .annotation .Autowired ;
26
20
import org .springframework .http .ResponseEntity ;
27
21
import org .springframework .stereotype .Component ;
28
22
23
+ import com .ericsson .ei .erqueryservice .ERQueryService ;
24
+ import com .ericsson .ei .erqueryservice .SearchOption ;
25
+ import com .ericsson .ei .rules .RulesHandler ;
26
+ import com .ericsson .ei .rules .RulesObject ;
27
+ import com .fasterxml .jackson .databind .JsonNode ;
28
+
29
29
/**
30
30
* The Class UpStreamEventsHandler.
31
31
*/
@@ -86,13 +86,13 @@ public void runHistoryExtractionRulesOnAllUpstreamEvents(String aggregatedObject
86
86
/**
87
87
* Traverses the tree from ER. The tree is defined as an array of either an
88
88
* event or a list of events. E.g:
89
- *
89
+ *
90
90
* <pre>
91
91
* [A, [B, C, [D, E]], [F, [N, [G, H]]], [I, [J, [K, L, [M]]]]]
92
92
* </pre>
93
- *
93
+ *
94
94
* Where the corresponding tree looks like this:
95
- *
95
+ *
96
96
* <pre>
97
97
* A -> B -> C -> D -> E -> F -> N -> G -> H -> I -> J -> K -> L -> M
98
98
* </pre>
@@ -116,8 +116,9 @@ private void traverseTree(final JsonNode jsonArray, final String aggregatedObjec
116
116
// start collecting history
117
117
RulesObject rules = rulesHandler .getRulesForEvent (parent .toString ());
118
118
119
- np = historyExtractionHandler .runHistoryExtraction (aggregatedObjectId , rules , parent .toString (),
120
- pathInAggregatedObject );
119
+ if (rules != null ) {
120
+ np = historyExtractionHandler .runHistoryExtraction (aggregatedObjectId , rules , parent .toString (), pathInAggregatedObject );
121
+ }
121
122
}
122
123
}
123
124
@@ -126,8 +127,10 @@ private void traverseTree(final JsonNode jsonArray, final String aggregatedObjec
126
127
if (jsonArray .get (i ).isObject ()) {
127
128
String event = jsonArray .get (i ).toString ();
128
129
RulesObject rules = rulesHandler .getRulesForEvent (event );
129
- prevNp = historyExtractionHandler .runHistoryExtraction (aggregatedObjectId , rules , event ,
130
- pathInAggregatedObject );
130
+
131
+ if (rules != null ) {
132
+ np = historyExtractionHandler .runHistoryExtraction (aggregatedObjectId , rules , event , pathInAggregatedObject );
133
+ }
131
134
} else {
132
135
// if we have prevNp then we should use that because it is the
133
136
// "parent" of the list we are now going to
0 commit comments