2016-06-28 8 views
1

I 오리온 1.2.1에서 다음 구독이 :왜이 orion 가입이 내가 원하는대로 작동하지 않습니까?

curl --include \ 
     --header 'Content-Type: application/json' \ 
     --request POST \ 
     --data-binary '{ 
         "description": "subscription", 
         "subject": { 
         "entities": [ 
          { 
          "idPattern": "event-.*", 
          "type": "Event" 
          } 
         ], 
         "condition": { 
          "attrs": [ 
           "IdEvent", 
           "mFlag" 
          ], 
          "expression": { 
          "q": "mFlag>0" 
          } 
         } 
         }, 
         "notification": { 
         "attrsFormat":"legacy", 
         "http": { 
          "url" : "http://localhost:5050/notify" 
         }, 
         "attrs": [ 
          "IdEvent" 
         ] 
         } 
        }' \ 
     'http://localhost:1026/v2/subscriptions' 

나는이 같은 엔티티 업데이트를 보낼 때 :

curl --include \ 
    --request PATCH \ 
    --header "Content-Type: application/json" \ 
    --data-binary '{ 
         "mFlag":{ 
          "value":"5", 
          "type":"int" 
         } 
        }' \ 
        'http://localhost:1026/v2/entities/event-2/attrs' 

오리온 notifiying되지 않고는 나를 미치게 만드는하지 않습니다를 무엇이 잘못되었는지 알아라. 어떤 생각?

나는 가입이 부분을 제거하면 :

"expression": { 
    "q": "mFlag>0" 
} 

작동하지만 난 어떤 속성이 변경 될 때 통지해야하는 조건이 만족된다.

+1

시도 업데이트! (5''' "'없이 주변 즉)가 작동 – fgalan

+0

을 5'하지만, cepheus가 orion에이 값을 보내는 사용 시나리오에서는 문제를 해결할 생각이 전혀 없습니다. (항상이 값을 모든 configs에서 int로 선언합니다.) 도움을 많이 주셔서 감사합니다. –

+0

cepheus cep 개발자는 그것을보고 우리에게 그의 포인트를 줄 수 있습니다. http://stackoverflow.com/questions/38100704/why-cepheus-dont-send-int-without-quotes-to-orion –

답변

1

NGSIv2에서 "5"은 문자열이 아니라 숫자입니다. 따라서, 예상대로 다음 업데이트 사용 작동 "q": "mFlag>0" 필터하기 위해에서 : "값"`와

curl --include \ 
    --request PATCH \ 
    --header "Content-Type: application/json" \ 
    --data-binary '{ 
         "mFlag":{ 
          "value":5, 
          "type":"int" 
         } 
        }' \ 
        'http://localhost:1026/v2/entities/event-2/attrs'