Fiware Orion Context Broker-Abonnement-Bedingung funktioniert nicht

Ich verwende Orion Context Broker Version 1.1.0

Ich hatte die einzige Entität in meiner DB:

{
  "id"=>"Room1",
  "type"=>"Room",
  "temperature"=>{"type"=>"none", "value"=>10, "metadata"=>{}}
}

Ich hatte keinesubscription.

Dann habe ich 3 erstelltsubscriptions:

[
{
  "subject"=>{"entities"=>[{"id"=>"Room1", "idPattern"=>"", "type"=>""}],
  "condition"=>{"attrs"=>["temperature"], "expression"=>{"q"=>"temperature>10"}}}
},
 {
  "subject"=>{"entities"=>[{"id"=>"Room1", "idPattern"=>"", "type"=>""}],
  "condition"=>{"attrs"=>["temperature"], "expression"=>{"q"=>"temperature<10"}}}
},
 {
  "subject"=>{"entities"=>[{"id"=>"Room1", "idPattern"=>"", "type"=>""}],
  "condition"=>{"attrs"=>["temperature"], "expression"=>{"q"=>"temperature==10"}}}
}
]

Wie Sie sehen können, liegt der Unterschied nur in den Ausdrücken: Temperatur> 10, Temperatur <10, temperatur == 10.

So dass jedes Mal, wenn ich das @ ändeRaum Temperatu Ich sollte nur ein @ habsubscription Auslösen der Benachrichtigung.

Aber es funktioniert nicht so wie es sollte !!!

Jedes Mal ändere ich dasTemperatu, Ich habe alle 3 Benachrichtigungen.

Jedoch wannsubscriptions erstellt wurden, löste nur einer von ihnen eine Benachrichtigung aus, abhängig vomtemperature Wert von Room1. Es hat wie erwartet funktioniert.

Aber wennRoom1 temperature wird geändert, funktioniert nicht richtig und löst alle 3 Benachrichtigungen aus.

Bearbeiten Volle Ausgabe der Operation GET / v2 / subscriptions:

[
  {
    "id"=>"574716a22fe8cdc00a696a94",
    "expires"=>"2017-04-05T14:00:00.00Z",
    "status"=>"active",
    "subject"=>{
      "entities"=>[{"id"=>"Room1", "idPattern"=>"", "type"=>""}],    
      "condition"=>{"attrs"=>["temperature"], 
      "expression"=>{"q"=>"temperature>10"}}
    }, 
    "notification"=>{"attrs"=>["temperature"], "http"=>{"url"=>"http://localhost:1028/accumulate"}},
    "throttling"=>5
  },
  {
    "id"=>"574716a22fe8cdc00a696a95",
    "expires"=>"2017-04-05T14:00:00.00Z",
    "status"=>"active",
    "subject"=>{
      "entities"=>[{"id"=>"Room1", "idPattern"=>"", "type"=>""}],  
      "condition"=>{"attrs"=>["temperature"], 
      "expression"=>{"q"=>"temperature<10"}}
    },
    "notification"=>{"attrs"=>["temperature"], "http"=>{"url"=>"http://localhost:1028/accumulate"}},
    "throttling"=>5},
  {
    "id"=>"574716a22fe8cdc00a696a96",
    "expires"=>"2017-04-05T14:00:00.00Z",
    "status"=>"active",
    "subject"=>{
      "entities"=>[{"id"=>"Room1", "idPattern"=>"", "type"=>""}], 
      "condition"=>{"attrs"=>["temperature"], 
      "expression"=>{"q"=>"temperature==10"}}
    },
    "notification"=>{"timesSent"=>2, "lastNotification"=>"2016-05-26T15:30:42.00Z", "attrs"=>["temperature"], "http"=>{"url"=>"http://localhost:1028/accumulate"}},
    "throttling"=>5
  }
]

Edit2: Füge ein Szenario hinzu:

GeändertRoom1 temperature bis 11 Hatte die gleiche Ausgabe, aber[...{"timesSent"=>1}..., ...{"timesSent"=>1}..., ...{"timesSent"=>3}...]GeändertRoom1 temperature bis 10 Hatte die gleiche Ausgabe, aber[...{"timesSent"=>2}..., ...{"timesSent"=>2}..., ...{"timesSent"=>4}...]GeändertRoom1 temperature bis 9 Hatte die gleiche Ausgabe, aber[...{"timesSent"=>3}..., ...{"timesSent"=>3}..., ...{"timesSent"=>5}...]

Antworten auf die Frage(2)

Ihre Antwort auf die Frage