Comments (2)
I understand you are trying to serialize a Tracker
type to a Text
type.
This was not anticipated, so you found an edge case.
Sadly, Cepheus CEP does not handle nesting of types (it would be nice to be able to just define the nested
attribute is a Tracker
(e.g { "name":"nested", "type":"Tracker" }
in the out
configuration).
For reference, others projects having the same problem with serializing a JTS Point
geometry which seem related to your issue: bedatadriven/jackson-datatype-jts#8 and bedatadriven/jackson-datatype-jts#15.
What is unclear for me, is why you would like to serialize the whole Tracker
event to Text
when you already asked to match all its fields to the Alert
type. The time
and location
from an Alert are taken from the Tracker
, so why not add additional attributes if you need more info from the Tracker
type in your Alert
type.
If this is because you simplified the statement to demonstrate the problem compared to the original Geofencing example, maybe a solution in the mean time would be transpose each of the properties from the Tracker
you want in the Alert
like this:
{
"service": "test",
"servicePath": "/tracker",
"host": "http://172.17.0.1:8080",
"reset": true,
"statements": [
"INSERT INTO Alert SELECT *,
t.id as nestedAlertId,
t.location as nestedAlertLocation,
t.time as nestedAlertTime
FROM Tracker t WHERE NOT polygon({point(0, 0), point(0,50), point(50,50), point(50, 0), point(0, 0)}).contains(t.location)"
],
"in": [
{
"id": ".*",
"type": "Tracker",
"isPattern": true,
"attributes": [
{
"name": "time",
"type": "date"
},
{
"name": "location",
"type": "geo:point"
}
],
"providers": [
{
"url": "http://172.17.0.1:1026",
"service": "test",
"servicePath": "/tracker"
}
]
}
],
"out": [
{
"id": "Fence1",
"type": "Alert",
"attributes": [
{
"name": "time",
"type": "date"
},
{
"name": "location",
"type": "geo:point"
},
{
"name": "inside",
"type": "boolean"
},
{
"name": "nestedAlertId",
"type": "string"
},
{
"name": "nestedAlertLocation",
"type": "geo:point"
},
{
"name": "nestedAlertTime",
"type": "date"
}
],
"brokers": [
{
"url": "http://172.17.0.1:1026",
"serviceName": "test",
"servicePath": "/tracker",
"authToken": null
}
]
}
]
}
from fiware-cepheus.
The reason why I am trying to serialize the whole Tracker as "text" (could be even java.util.Map) is because Cepheus is part of a much more complex architecture of an IoT application where I have multiples types of context entities and each one generates Alerts. Then I am working on a integration component that takes each Alert and for example send it to a third party system (could be fire an Email, etc).
Since each context entity have a different schema (entity type) I want to define something like an "Envelope" entity type for all the alerts in order to get a common set of attributes, most of them for internal use. That's the reason why I am putting the whole Tracker info into a single attribute in my example. Just to clarify, I am not serializing Tracker as "text", in fact I am using type "java.util.Map". I put it as "text" in the issue just to make it simple.
In the meantime I can "flat" the whole context as you suggests at the cost of losing the "common" envelope.
Thank you and I hope you can incorporate this issue as a future bug fixes.
Best Regards.
from fiware-cepheus.
Related Issues (20)
- Add guaranteed delivery to Cepheus Broker HOT 5
- Adding persistance to Cepheus HOT 1
- Compatibility with Orion 1.X.X
- Error with cepheus Broker 0.1.7 HOT 1
- run cep condition every X minutes? HOT 7
- Use Docker parameters for Cepheus configuration HOT 2
- Exception logging HOT 1
- Example mocks crash on updateContextResponse HOT 1
- Improve documentation for exampel 3_CepAndBroker HOT 1
- Cepheus CEP in a multi-tenancy way HOT 8
- Cepheus multiple statements HOT 1
- change remote.url in docker container HOT 8
- Cepheus-CEP multitenancy issue on filtering requests HOT 6
- Cepheus does not send subscribeContext request on changing ServiceName and ServicePath HOT 2
- Incorrect processing for notification about changes in multiple context entities. HOT 4
- Cepheus-CEP multitenancy issue for multi-tenant provider HOT 5
- Cepheus-CEP multitenancy issue for multiple subscription HOT 1
- Cepheus CEP DELETE request doesn't unsubscribe Provider
- Cepheus-CEP does not hold multiple subscription in multi-tenant mode
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fiware-cepheus.