Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

An event message key (also known as topic) is a routing key pattern of an event message which is sent after a known event in PIPEFORCE happened and . This key always starts with prefix pipeforce.event, followed by the concrete event type.

It can be used to listen and send push notifications every time such an event happens or to register a pipeline listener and listen for such an event to a trigger a pipeline execution.

Here is an example how to add such an event message listener to a pipeline. As soon as the pipeline got saved in the property store, the listener is activated:

Code Block
languageyaml
pipeline:
  - message.listen:
      key: pipeforce.event.workflow.#
      
  - mail.send:
      to: admin@company.tld
      subject: A workflow event happened.

When registering a listener for an event key, also patterns pattern matching can be used in the event key:

  • * = Stands for a single word up to the next period .

  • # = Stands for multiple words with multiple periods in between.

For example : the event key from above pipeforce.event.workflow.# matches all workflow event messages while pipeforce.event.workflow.*.my.app matches only workflow event messages inside the app my.app.

...

Every property topic key can additionally contain dynamic variables which will be replaced at runtime such as:

  • {appName}

...


  • Will be replaced by the name of the app

...

  • , the related property is stored inside

...

  • . For example

...

  • io.pipeforce.myapp

...

  • .

  • {path}

...


  • The path of the related property whereas slashes in path of property will become dots. Dots and special chars in origin path will be replaced by underscores. Everything in path is lower-cased.

...

.created

This event message is send after a new property was created.

...

  • For example global.app.com.mycompany.myapp.data.
    This way also pattern matching filtering can be applied on the path level. In order to listen on any property event on any property inside the data folder of your app you could use a key like this:

    Code Block
    pipeforce.event.property.

...

.deleted

This event message is send after a property was deleted.

...

  • *.global.app.com.mycompany.myapp.data.*

The body of each such event message has a structure like this:

Code Block
pipeforce.event.property.deleted.{path}

.updated

This event message is send after a property was updated.

The full structure of the event message routing key is like this:

pipeforce.event.property.updated.{path}
Code Block
languageyaml
{
  "timestamp": integer,
  "correlationdId": string,
  "namespace": "string",
  "payload": {
    "origin": {
      "uuid": "string",
      "path": "string",
      "type": "string",
      "value": "string",
      "created": timestamp,
      "updated": timestamp
    },
    "target": {
      "uuid": "string",
      "path": "string",
      "type": "string",
      "value": "string",
      "created": timestamp,
      "updated": timestamp
    }
}

Wheras:

  • timestamp = The unix timestamp in milliseconds when this event happened.

  • correlationId = In case this event is part of an async execution, this is the id of the execution.

  • namespace = The namespace this event happened inside.

  • payload = A JSON which contains more information about the related properties whereas origin and target can also be null depending on the event type. Their attributes are:

    • uuid = The uuid of the related property.

    • path = The path of the related property.

    • type = The content type of the related property.

    • value = The value of the related property.

    • created = The unix timestamp in ms when this related property was created.

    • updated = The unix timestamp in ms when this related property was updated last time.

.created

This event message is send after a new property was created.

The full structure of the event message routing key is like this:

Code Block
pipeforce.event.property.created.{path}

The structure of the message body:

Code Block
languagejson
{
    "timestamp": integer,
    "correlationId": "string",
    "namespace": "string",
    "payload": {
        "origin": null,
        "target": {
          "uuid": "string",
          "path": "string",
          "type": "string",
          "value": "string",
          "created": timestamp,
          "updated": timestamp
        }
    }
}

The field target contains information about the created property.

.copied

This event message is send after a new property was copied.

The full structure of the event message routing key is like this:

Code Block
pipeforce.event.property.copied.{path}

The structure of the message body:

Code Block
languagejson
{
    "timestamp": integer,
    "correlationId": "string",
    "namespace": "string",
    "payload": {
        "origin": {
          "uuid": "string",
          "path": "string",
          "type": "string",
          "value": "string",
          "created": timestamp,
          "updated": timestamp
        },
        "target": {
          "uuid": "string",
          "path": "string",
          "type": "string",
          "value": "string",
          "created": timestamp,
          "updated": timestamp
        }
    }
}

The field origin contains information about the property it was copied from. The field target contains information about the property it was copied to.

.deleted

This event message is send after a property was deleted.

The full structure of the event message routing key is like this:

Code Block
pipeforce.event.property.deleted.{path}

The structure of the message body:

Code Block
languagejson
{
    "timestamp": integer,
    "correlationId": "string",
    "namespace": "string",
    "payload": {
        "origin": {
          "uuid": "string",
          "path": "string",
          "type": "string",
          "value": "string",
          "created": timestamp,
          "updated": timestamp
        },
        "target": null
    }
}

The field origin contains information about the deleted property.

.updated

This event message is send after a property was updated.

The full structure of the event message routing key is like this:

Code Block
pipeforce.event.property.updated.{path}

The structure of the message body:

Code Block
languagejson
{
    "timestamp": integer,
    "correlationId": "string",
    "namespace": "string",
    "payload": {
        "origin": {
          "uuid": "string",
          "path": "string",
          "type": "string",
          "value": "string",
          "created": timestamp,
          "updated": timestamp
        },
        "target": {
          "uuid": "string",
          "path": "string",
          "type": "string",
          "value": "string",
          "created": timestamp,
          "updated": timestamp
        }
    }
}

The field origin contains information about the property before it was updated. The field target contains information about the property after it was upated.

.comment.created

This event message is send after a comment was added to a property.

...