简体   繁体   中英

Fiware's CEP and arrays within JSON objects

I'm trying to integrate CEP with a mailing service (Mandrill) that has specific requisits in terms of how variables are structured within the JSON object that is sent through http, requiring a complex structure.

I've read that Fiware's CEP only takes flat JSONs as inputs. But maybe it's possible to create complex outputs. I've read elsewhere that CEP used to support array inputs, so it still supports arrays.

On Proton User Guide (pdf) I've read that "array of arrays are supported" and that you need to specify the Dimension attribute of a variable to do so, within Events.

So I'd like ask: What exactly are the arrays mentioned on the manual, if the inputs are only flat? What is the 'Dimension' attribute responsible for? And why is it's value limited to 0, 1 or 2 ? Maybe it's the depth of the array.

I only ask such a vague question here because I wasn't able to find more info or examples on arrays in CEP elsewhere. Maybe there is an information source I'm missing.

Thank you

Dimension is the dimension of the array, so you can have matrices (dimension = 2) and a cube (dimension = 3)

You can write an array like this:

"employees":[
    {"firstName":"John", "lastName":"Doe"},
    {"firstName":"Anna", "lastName":"Smith"},
    {"firstName":"Peter","lastName":"Jones"}
]

The object "employees" is an array containing three objects. Each object is a record of a person (with a first name and a last name).

I hope it helps :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM