Events

How to configure a package to be triggered bt the FX Router when a specific type of event is observed on the platform.

FX is an event driven platform wich means that each action generating an event can be reused for further triggering of executions. Also within an executing script, an event can be generated and sent as a message. Each event is defined at least by it’s source, type and payload (data). Event message format is following the cloudevents standard. A list of all event types is maintained so the user can bound package execution to certain event type, which means that each time such an event is received, the package execution will be triggered.

Events

Events are messages passed through the platform which are generated by Services.

Events are in the form of JSON formatted messages which adhere to the CloudEvents format. They carry a Header which indicates the event type and a Payload (or Data section) which contain information about the event.

To have a better detailed understanding of how Events are generated, please refer to the Architecture subcategory in the Overview category.

Events

This use case defines how to configure a package to be triggered bt the FX Router when a specific type of event is observed on the platform.

  1. Click on Events on the left side of the dashboard menu to open drop-down
  2. Click on Event Types
  3. Check the predefined Event Types
    • ferris.apps.modules.approvals.step_approval_completed
    • ferris.apps.modules.minio.file_uploaded

Events can be created within scripts during package execution by sending a message to the Kafka Topic using the ferris_cli python package. For example, a package can be bound to a file_upload event that is triggered every time a file gets uploaded to MinIO using FX file storage module. New event types will be registered as they are sent to the Kafka Topic using the ferris_cli python package.

Further details regarding ferris_cli can be found in the subcategory Development Lifecycle in the Developer Guide.

Executions - Packages -> file upload trigger event

In this use case an existing package will be edited to define the file upload event type.

  1. Click on Executions on the left side of the dashboard menu to open drop-down
  2. Click on Packages
  3. Click on the edit record button to edit the existing package Test Package with Scripts

  1. Delete the CronJob Schedule to allow a Trigger Event Type
  2. Select the Value of the event type (ferris.apps.modules.minio.file_uploaded)
  3. Save the edited package.

File Storage

To finalize the process, a file needs to be uploaded to a MinIO bucket (file storage).

  1. Click on File Storage on the left side of the dashboard menu to open drop-down
  2. Click on List Files
  3. Click on +Add to upload a file to the bucket

  1. Choose file to upload
  2. Choose File Type (CSV Table; Plain Text; JSON)
  3. Select the Bucket Name
  4. Click on Save to save the file

To verify if the package execution has been triggered, go back to the initial, edited package.

  1. Click on Executions on the left side of the dashboard menu to open drop-down
  2. Click on Packages
  3. Click on the magnifying glass to open the details page of the package Test Package with Scripts

It will automatically open the List Package Executions tab.

  1. Check the last Event, date and time to verify it corresponds to the time the file was uploaded
  2. Click on the magnifying glass to open the details page of the triggered execution

  • Check the details page of the event triggered run

Workflow -> approval completed trigger event

To finalize the second trigger event (ferris.apps.modules.approvals.step_approval_completed), an existing Workflow will be used to trigger a Case Management that will need to get approved.

  1. Click on Workflows on the left side of the dashboard menu to open the drop-down
  2. Click on List Workflows
  3. Click on the magnifying glass to show the details page of the workflow

Note that before even getting a closer look at the Workflow details, the Entrypoint Event is displayed -> ferris.apps.modules.minio.file_uploaded

Check the details in the JSON snippet to understand what or which event types will trigger the second event type. The first event type shown in the JSON snippet is: ferris.apps.modules.minio.file_uploaded -> which means that a file will need to get uploaded for the event to get triggered. The second event type shown in the JSON snippet is: ferris.apps.modules.approvals.step_approval_completed -> meaning the uploaded file will need to get approved in the Case Management module before the wanted event gets triggered.

Case Management -> -> approval completed trigger event

  1. Upload a file to a bucket (the process of uploading a file was described in detail on top of this page)
  2. Click on Case Management on the left side of the dashboard menu to open the drop-down
  3. Click on Approvals

Last modified August 23, 2023: docs update (77345ac)