[Fiware-tech-help] Regarding CEP input event json format

Tali Yatzkar-Haham TALI at il.ibm.com
Thu May 7 05:53:50 CEST 2015


Dear Ahmed,

The CEP supports getting input events from Orion CB (using Orion XML 
output format). In your CEP consumer definition you need to specify that 
the contentType is: application/xml and the formatter is xml. 

You can see example for such consumer definition in the FIWARE livedemo 
CEP application (attached. you can import it to your CEP web UI), and 
explanations in the CEP user guide (appendix A)



Best regards,
Tali

Tali Yatzkar Haham
Smart Decision Solutions
IBM Haifa Research Lab, Israel
tali at il.ibm.com 972-4-8296320
 



From:   Ahmed Sadek <don1559 at gmail.com>
To:     Tali Yatzkar-Haham/Haifa/IBM at IBMIL, "fiware-tech-he." 
<fiware-tech-help at lists.fi-ware.org>
Date:   07/05/2015 12:41 AM
Subject:        Regarding CEP input event json format



Dear Tali,

A quick question regarding posting events to CEP, I know that the format 
for input events is :

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

But, the Orion context broker do generate JSON objects in this format:

{
  "subscriptionId" : "51c04a21d714fb3b37d7d5a7",
  "originator" : "localhost",
  "contextResponses" : [
    {
      "contextElement" : {
        "attributes" : [
          {
            "name" : "temperature",
            "type" : "float",
            "value" : "26.5"
          }
        ],
        "type" : "Room",
        "isPattern" : "false",
        "id" : "Room1"
      },
      "statusCode" : {
        "code" : "200",
        "reasonPhrase" : "OK"
      }
    }
  ]
}

So is there a way to make CEP accept this input event and check that the 
temperature value is between certain threshold this condition:
TR1.value>0 AND TR1.value<30

Currently, I am getting this error :

Could not parse json event org.apache.wink.json4j.JSONException: The key 
[Name] was not in the map, reason: The key [Name] was not in the map

Since there is no Name of course. 

Please let me know if you have a solution or suggestions.

Best,
Ahmed Sadek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fiware.org/private/fiware-tech-help/attachments/20150507/3c7bb5f9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LiveDemo.json
Type: application/octet-stream
Size: 37568 bytes
Desc: not available
URL: <https://lists.fiware.org/private/fiware-tech-help/attachments/20150507/3c7bb5f9/attachment.obj>


More information about the Fiware-tech-help mailing list

You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy   Cookies policy