Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-20619

[fiware-stackoverflow] Orion Subscription to update entity attributes from CrateDB, on value changes

    Details

      Description

      Created question in FIWARE Q/A platform on 30-01-2023 at 08:01
      Please, ANSWER this question AT https://stackoverflow.com/questions/75281590/orion-subscription-to-update-entity-attributes-from-cratedb-on-value-changes

      Question:
      Orion Subscription to update entity attributes from CrateDB, on value changes

      Description:
      Is there a convenient way to subscribe to update an attribute, each time another attribute changes?
      I have this entity on Orion:
      {
      "id": "Asset:001",
      "type": "SomeType",
      "Input": {
      "type": "Text",
      "value": "State",
      "metadata": {}
      },
      "Output": {
      "type": "Float",
      "value": null,
      "metadata": {}
      }
      }

      I subscribe to notify value changes to Quantumleap:
      curl -s -o /dev/null -X POST \
      'http://orion:1026/v2/subscriptions/' \
      -H 'Content-Type: application/json' \
      -d '{
      "description": "Orion notify Quantumleap on State changhes",
      "subject": {
      "entities": [

      { "idPattern": ".*", "type": "Sometype" }

      ],
      "condition":

      { "attrs": [ "state" ] }

      },
      "notification": {
      "http":

      { "url": "http://quantumleap:8668/v2/notify" }

      ,
      "attrs": [
      "State"
      ],
      "metadata": []
      }
      }'

      And I got my data on CrateDB where I made some calculation.
      Then I would like to get the results of this computing, and put back as an attribute to the entity Asset:001.
      Now I get this done by a script, but it would be nice to achieve the same result with a subscription, is this possible?
      Thanks!!

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2023-01-31 05:31|CREATED monitor | # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2023-01-31 05:31|CREATED monitor | # answers= 1, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2023-02-01 05:31|UPDATED status: transition Answer| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2023-02-01 05:31|UPDATED status: transition Answer| # answers= 1, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2023-02-02 05:31|UPDATED status: transition Answered| # answers= 1, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2023-02-02 05:31|UPDATED status: transition Answered| # answers= 1, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2023-02-03 05:31|UPDATED status: transition Finish| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2023-02-03 05:31|UPDATED status: transition Finish| # answers= 1, accepted answer= True

          People

          • Assignee:
            Unassigned
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: