Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The rule is not triggered with "http" action , GET or DELETE methods and without json or templates #207

Closed
iariasleon opened this issue Oct 13, 2016 · 3 comments · Fixed by #209
Assignees
Labels
Milestone

Comments

@iariasleon
Copy link
Contributor

The rule is not triggered with "http" action , GET or DELETE methods and without json or template fields. A notification is received and this error message is displayed in the log:

time=2016-10-13T10:12:10.994Z | lvl=INFO | corr=81370a0a-912d-11e6-a910-fa163e433687 | trans=a062cbd8-0c5d-4840-aabd-d92e53cc8a4a | op=/actions/do | path=/actions/do | comp=perseo-fe | srv=cb001cep | subsrv=/sscb001cep | msg=rulesStore.Find {"_id":"57ff5dfa04fd7a311281dcb5","action":{"type":"post","parameters":{"url":"http://localhost:9998/send/get/type/${typ [...]
time=2016-10-13T10:12:10.999Z | lvl=ERROR | corr=81370a0a-912d-11e6-a910-fa163e433687 | trans=a062cbd8-0c5d-4840-aabd-d92e53cc8a4a | op=/actions/do | path=/actions/do | comp=perseo-fe | srv=cb001cep | subsrv=/sscb001cep | msg=TypeError: Cannot call method 'replace' of undefined
time=2016-10-13T10:12:10.999Z | lvl=DEBUG | corr=81370a0a-912d-11e6-a910-fa163e433687 | trans=a062cbd8-0c5d-4840-aabd-d92e53cc8a4a | op=/actions/do | path=/actions/do | comp=perseo-fe | srv=cb001cep | subsrv=/sscb001cep | msg=response-time: 12

rule request

http://localhost:8090/rules
Fiware-Service: cb001cep
Content-Type: application/json
Fiware-ServicePath: /sscb001cep
Accept: application/json
X-Auth-Token: 7e7c649e28cf4c8f87c8269bbc25e4ea
{"action": {"type": "post", "parameters": {"url": "http://localhost:9998/send/get/type/${type}", "headers": {"Content-type": "text/plain", "X-${type}-temperature": "${temperature}"}, "qs": {"id": "${id}"}, "method": "GET"}}, "text": "select *, \"iot_rule_test_1\" as ruleName, *, ev.temperature? as temperature, ev.id? as id from pattern [every ev=iotEvent( cast(cast(temperature?,String),Float)>1.5 and type=\"entity\")]", "name": "iot_rule_test_1"}

rule response

code: 200
{"error":null,"data":[false,[{"code":200,"body":{"text":"create context ctxt$cb001cep$sscb001cep partition by service from iotEvent(service=\"cb001cep\" and subservice=\"/sscb001cep\")","timeLastStateChange":1476353501720,"name":"ctxt$cb001cep$sscb001cep","state":"STARTED"}},{"code":200,"body":{"text":"context ctxt$cb001cep$sscb001cep select *, \"iot_rule_test_1\" as ruleName, *, ev.temperature? as temperature, ev.id? as id from pattern [every ev=iotEvent( cast(cast(temperature?,String),Float)>1.5 and type=\"entity\")]","timeLastStateChange":1476353530616,"name":"iot_rule_test_1@cb001cep/sscb001cep","state":"STARTED"}},null],{"action":{"type":"post","parameters":{"url":"http://localhost:9998/send/get/type/${type}","headers":"{\"Content-type\":\"text/plain\",\"X-${type}-temperature\":\"${temperature}\"}","qs":"{\"id\":\"${id}\"}","method":"GET"}},"text":"select *, \"iot_rule_test_1\" as ruleName, *, ev.temperature? as temperature, ev.id? as id from pattern [every ev=iotEvent( cast(cast(temperature?,String),Float)>1.5 and type=\"entity\")]","name":"iot_rule_test_1","subservice":"/sscb001cep","service":"cb001cep","_id":"57ff5dfa04fd7a311281dcb5"},null]}

mongo doc

{ "_id" : ObjectId("57ff5dfa04fd7a311281dcb5"), "action" : { "type" : "post", "parameters" : { "url" : "http://localhost:9998/send/get/type/${type}", "headers" : "{\"Content-type\":\"text/plain\",\"X-${type}-temperature\":\"${temperature}\"}", "qs" : "{\"id\":\"${id}\"}", "method" : "GET" } }, "text" : "select *, \"iot_rule_test_1\" as ruleName, *, ev.temperature? as temperature, ev.id? as id from pattern [every ev=iotEvent( cast(cast(temperature?,String),Float)>1.5 and type=\"entity\")]", "name" : "iot_rule_test_1", "subservice" : "/sscb001cep", "service" : "cb001cep" }
@crbrox
Copy link
Member

crbrox commented Oct 13, 2016

Until solved, a workaround could be using "" (empty string) as template

@fgalan
Copy link
Member

fgalan commented Oct 13, 2016

Fixed in PR #209. Ready for @iariasleon to check and close it definitively.

@fgalan fgalan reopened this Oct 13, 2016
@fgalan fgalan added this to the 1.3.0 milestone Oct 13, 2016
@iariasleon
Copy link
Contributor Author

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants