Complext event structure in FIWARE Generic Enabler CEP - Proton

烂漫一生 提交于 2020-01-06 14:05:52

问题


I'd like to use Proton as CEP GE in my FI-WARE architecture.

I ask your help because I have an event that has a complex structure and I would like to understand how can I define it and the EPA that should use it.

I check in documents you provide in this wiki https://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/CEP_GE_-_IBM_Proactive_Technology_Online_User_and_Programmer_Guide and then forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/Complex_Event_Processing_Open_RESTful_API_Specification and http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/FIWARE.ArchitectureDescription.Data.CEP

but I don't find anything about attributes of type object in event configuration or EPA (Event Process Agent) configuration or how set up the event description using REST api.

the json structure of incoming event is this (I know that name attribute here is missing)

{"contextElements":[
    {"type":"ADD",
    "isPattern":false,
    "id":"ADD_MESSAGE_com.liferay.portlet.messageboards.model.MBMessage_111516",
    "attributes":[
        {"name":"id_","type":"long","value":"32302"},
        {"name":"companyId","type":"long","value":"10157"},
        {"name":"groupId","type":"long","value":"10184"},
        {"name":"userId","type":"long","value":"10201"},
        {"name":"date","type":"date","value":"12-mar-2015"},
        {"name":"type","type":"string","value":"ADD_MESSAGE"},
        {"name":"className","type":"string","value":"com.liferay.portlet.messageboards.model.MBMessage"},
        {"name":"classPK","type":"string","value":"111516"},
        {"name":"classUuid","type":"string","value":"9cd599c5-e01e-417d-9118-a636beed7145"},
        {"name":"model","type":"string","value":"{32302}"}
        ]}
    ],
"updateAction":"APPEND"}

The EPA should then check the "value" of "name":"groupId" "attributes" field. I don't think is easy to do it using Proton UI (http://130.206.81.23:8080/AuthoringTool/Main.html). I created there a new project named is3_like_eng_test.

Could you address me to a resource that deeply explain how create the proton project json file I need also.

Thank you in advance


回答1:


To define an event, you need to create a new Event in the UI, and add to it a list of attributes, each has a name and a type.
In this tutorial you can see an example of event definition.

This event can be used as input event for EPAs. In the tutorial mentioned above, you can see complete CEP application definition, and runtime examples.

Later, at runtime, you can send the CEP input events using REST api. There are three supported formats:

  • Flat JSON. Example:

    {"Name":"TrafficReport", "volume":"1000"}

  • Tag delimited format. Example:

    Name=TrafficReport;volume=1000;

  • NGSI XML - see example in the above link.



来源:https://stackoverflow.com/questions/29234792/complext-event-structure-in-fiware-generic-enabler-cep-proton

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!