Global observation messages

As data changes in the Haplo application, messages are added to the Global observation queue.

See note about message ordering.

Common message format

Messages have a common format, and include all the standard top level properties for message queues.

property action

The action property specifies the action which caused the message to be added to the queue. Your consumer should filter messages based on this property.

Example

This is an example message sent when a workflow changes state. It includes the attributes of the object, workflow information, and any forms attached.

{
  "id": 5,
  "datetime": "2020-02-26T10:22:34Z",
  "action": "workflow:transition",
  "object": {
    "kind": "haplo:object:0",
    "sources": [
      "std:workunit",
      "std:workflow",
      "std:workflow:documents",
      // ...
    ],
    // ...
    "attributes": {
      // ...
    },
    "workflows": [
      {
        "workType": "example:approval",
        "createdAt": "2020-02-24T17:10:51.947Z",
        "openedAt": "2020-02-24T17:10:51Z",
        "deadline": null,
        "closed": true,
        "data": {},
        "tags": {
          "state": "review"
        },
        "state": "review",
        "url": "https://app.example.org/80q22/book-one",
        "documents": {
          "review": {
            "comments": "This book ...",
            // ...
          }
        }
      }
    ]
  }
}

Message actions

The following message actions are implemented by the core Global Observer plugin. Other plugins may add additional actions.

object:change
workflow:transition