Details
-
Type: Monitor
-
Status: Closed
-
Priority: Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: 2021
-
Component/s: FIWARE-TECH-HELP
-
HD-Chapter:Data
-
HD-Enabler:CEP
Description
Created question in FIWARE Q/A platform on 29-09-2016 at 17:09
Please, ANSWER this question AT http://stackoverflow.com/questions/39774810/array-condition-within-epa-cep-proton
Question:
Array Condition within EPA CEP PROTON
Description:
Using CEP Proton I want to check if, for the events received in a time interval, the id of the second and following events is contained in an attribute of type array coming in the first event. Let's say the first event is coming with the attribute called group that is an array of integers (10, 20, 30). The following events will come with an id, ex 20, 25 and so on. I want to check if the id of those events is included in the attribute group included in the first event.
For that I have created a condition in EPA
ArrayContains(ArrayGet(myevent.group,0),ArrayGet(myevent.id,ArraySize(myevent.id)-1))
However I'm getting an error when I click on verify
Error Error in EPA: expression error of undefined myepa
Am I doing anything wrong?
Cannot I access to the attribute array using ArrayGet? Or maybe ArrayContains cannot work with the result of ArrayGet?
2016-09-29 18:05|CREATED monitor | # answers= 0, accepted answer= False