Skip to content

DOC-293-message-events #123

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/building-blocks/actions/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ sidebar_position: 3

The FLOWX.AI platform handles the following **types of actions**:

* [Business Rule](./business-rule-action)
* [Business rule](./business-rule-action)
* Save Data
* [Kafka Send](../node/message-send-received-task-node.md)
* [Kafka send](../node/message-send-received-task-node.md)
* [Send data to user interface](./send-data-to-user-interface.md)
* [Upload File](./upload-file-action)
* [Start Subprocess](./start-subprocess-action)
* [Append Params to Parent Process](./append-params-to-parent-process)
* [Upload file](./upload-file-action)
* [Start subprocess](./start-subprocess-action)
* [Append params to parent process](./append-params-to-parent-process)

:::info
You can only define and add actions on the following types of [**nodes**](../../terms/flowx-node): [**Message send task**](../node/message-send-received-task-node.md#message-send-task), [**Task**](../node/task-node.md) and [**User task**](../node/user-task-node.md).
You can only define and add actions on the following types of [**nodes**](../../terms/flowx-node): [**send message task**](../node/message-send-received-task-node.md#message-send-task), [**task**](../node/task-node.md) and [**user task**](../node/user-task-node.md).
:::

### Action rules
Expand Down
Original file line number Diff line number Diff line change
@@ -1,73 +1,90 @@
---
sidebar_position: 2
sidebar_position: 4
---

# Message Catch Boundary events
# Message catch boundary events

:::info quick intro
**What is it?** A Message Catch Boundary Event is a special [**event**](../../../terms/events) that can be attached to a user task in a [**process**](../../../terms/flowx-process-definition).
**What is it?** Boundary [**events**](../../../terms/events) are integral components linked to **user tasks** within a process flow. Specifically, Message Catch Boundary Events are triggered by incoming messages and can be configured as either interrupting or non-interrupting based on your requirements.

**Why it is important?** It allows the process to listen for and capture specific messages during the execution of the associated user task.
**Why is it important?** It empowers processes to actively listen for and capture designated messages during the execution of associated user tasks.
:::

When used as a boundary event on a [**user task**](../user-task-node.md), message catch boundary event nodes behave similar to an [**exclusive gateway**](../exclusive-gateway-node.md), but they are activated upon receiving an event. This means you can proceed in the process without receiving an event and continue through the sequence initiated from the user task.
When an event is received, it progresses through the sequence from the intermediate [**node**](../../../terms/flowx-node). Multiple intermediate boundary events can exist on the same user task, but only one can be activated at a time.

If an event is received, it advances through the sequence from the intermediate [**node**](../../../terms/flowx-node). You can have multiple intermediate boundary events on the same user task, but only one can be activated at a time.
![](https://s3.eu-west-1.amazonaws.com/docx.flowx.ai/release34/message_catch_boundary_multiple.png)

![](https://s3.eu-west-1.amazonaws.com/docx.flowx.ai/building-blocks/node/message_events_boundaries.png)

There are two types of Message Catch Boundary Events:
Message Catch Boundary Events can be categorized by their behavior, resulting in two main classifications:

* [**Interrupting**](#message-catch-interrupting-event)
* [**Non-Interrupting**](#message-catch-non-interrupting-event)
* [**Non-interrupting**](#message-catch-non-interrupting-event)

## Message Catch Interrupting event
## Message catch interrupting event

<div className = "image-scaled">

![](https://s3.eu-west-1.amazonaws.com/docx.flowx.ai/building-blocks/node/message_catch_interrupting_event.png#center)

</div>

When an Interrupting Message Catch Boundary Event is triggered by receiving a message, it interrupts the associated task that is being performed. The task is immediately finished, and the [**process flow**](../../../terms/flowx-process) continues to advance based on the received message.
In the case of an Interrupting Message Catch Boundary Event triggered by a received message, it immediately interrupts the ongoing task. The associated task concludes, and the [**process flow**](../../../terms/flowx-process) advances based on the received message.

It can also be used as a standalone node, see more information on the following section:
- **Use Cases:**
- Suitable for scenarios where the receipt of a specific message requires an immediate interruption of the current activity.
- Often used when the received message signifies a critical event that demands prompt attention.

[Message Catch Intermediate Event](message-catch-intermediate-event.md)

## Message Catch Non-Interrupting event
- **Example:**
- A user task is interrupted as soon as a high-priority message is received, and the process flow moves forward to handle the critical event.

It is used only as a boundary event and is placed only on a user task. If your process is in that user task and receives [**events**](../../../terms/events), the event is activated, and a new token is created that advances independently. Sections with non-interrupting events should not contain user tasks. You can have multiple non-interrupting events on the same user task, and all of them can be activated simultaneously.

## Message catch non-interrupting event

<div className = "image-scaled">

![](https://s3.eu-west-1.amazonaws.com/docx.flowx.ai/building-blocks/node/%20message_catch_non_interrupting.png)
![](https://s3.eu-west-1.amazonaws.com/docx.flowx.ai/building-blocks/node/%20message_catch_non_interrupting.png#center)

</div>

A Non-Interrupting Message Catch Boundary Event also listens for messages while the associated task is being performed. However, in this case, the task is not immediately finished when messages are received. The event captures the messages, allowing the task to continue its execution. Multiple non-interrupting events can be received while the task is still active, and the task will continue until its completion.
Contrastingly, a Non-Interrupting Message Catch Boundary Event continues to listen for messages during the execution of the associated task without immediate interruption. The task persists in its execution even upon receiving messages. Multiple non-interrupting events can be activated concurrently while the task is still active, allowing the task to continue until its natural completion.

- **Use Cases:**
- Appropriate for scenarios where multiple messages need to be captured during the execution of a user task without disrupting its flow.
- Useful when the received messages are important but do not require an immediate interruption of the ongoing activity.

- **Example:**
- A user task continues its execution while simultaneously capturing and processing non-critical messages.

## Configuring a Message Catch Interrupting/Non-Interrupting event
## Configuring a message catch interrupting/non-interrupting event

#### General config

* **Correlate with throwing events** - the dropdown contains all throw events from the process definitions accessible to the user
* **Correlate with Throwing Events** - the dropdown lists all throw events from accessible process definitions

:::info
It is used to establish the correlation between the catch event and the corresponding throw event.
By selecting the appropriate throw event, the catch event will be triggered when a message is thrown from that event.
Establishes correlation between the catch event and the corresponding throw event. Selection of the relevant throw event triggers the catch event upon message propagation.
:::

* **Correlation key** - process key used to establish a correlation between the received message and a specific process instance
* **Correlation Key** - process key used to correlate received messages with specific process instances

:::info
Correlation key serves as a means to correlate the incoming message with the specific process instance it belongs to.
When a message is received with a matching correlation key, the catch event will be triggered.
The correlation key associates incoming messages with specific process instances. Upon receiving a message with a matching correlation key, the catch event is triggered.
:::

* **Receive data (process key)** - the catch event can receive data associated with the message and store it in a process variable with the specified process key
* **Receive Data (Process Key)** - the catch event can receive and store data associated with the message in a process variable with the specified process key


:::info
This data can then be used within the process instance for further processing or decision-making.
This received data becomes available within the process instance, facilitating further processing or decision-making.
:::


## Illustrating boundary events (interrupting and non-interrupting)

![](https://s3.eu-west-1.amazonaws.com/docx.flowx.ai/release34/boundary_multiple.png)

**Business Scenario:**

A customer initiates the account opening process. Identity verification occurs, and after successful verification, a message is thrown to signal that the account is ready for activation.

Simultaneously, the account activation process begins. If there are issues during activation, they are handled through the interruption process. The overall process ensures a streamlined account opening experience while handling potential interruptions during activation, and also addresses exceptions through the third lane.
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# Message Catch Start event
---
sidebar_position: 1
---

# Message catch start event

:::info quick intro
**What is it?** It represents the starting point for a process instance based on the receipt of a specific message. When this event is triggered by receiving the designated message, it initiates the execution of the associated process.

**Why it is important?** The Message Catch Start Event is important because it allows a process to be triggered and initiated based on the reception of a specific message.
:::

## Configuring a Message Catch Start event
## Configuring a message catch start event

A Message Catch Start Event is a special event in a process that initiates the start of a process instance upon receiving a specific message. It acts as the trigger for the process, waiting for the designated message to arrive. Once the message is received, the process instance is created and begins its execution, following the defined process flow from that point onwards. The Message Catch Start Event serves as the entry point for the process, enabling it to start based on the occurrence of the expected message.

:::caution
It is mandatory that in order to use this type of node together with task management plugin, to have a service account defined in your identity solution. For more information, check our documentation in how to create service accounts using Keycloak, [**here**](../../../platform-setup-guides/access-management/configuring-an-iam-solution.md#adding-service-accounts)
It is mandatory that in order to use this type of node together with task management plugin, to have a service account defined in your identity solution. For more information, check our documentation in how to create service accounts using Keycloak, [<u>**here**</u>](../../../platform-setup-guides/access-management/configuring-an-iam-solution.md#process-engine-service-account).
:::

![](https://s3.eu-west-1.amazonaws.com/docx.flowx.ai/release34/start_catch_message_event.png#center)
Expand All @@ -21,11 +25,48 @@ It is mandatory that in order to use this type of node together with task manage
* **Can go back?** - setting this to true will allow users to return to this step after completing it, when encountering a step with `canGoBack` false, all steps found behind it will become unavailable
* **Correlate with catch events** - the dropdown contains all catch messages from the process definitions accessible to the user
* **Correlation key** - is a process key that uniquely identifies the instance to which the message is sent
* **The data field** - allows the user to define a JSON structure with the data to be sent along with the message
* **Stage** - assign a stage to the node
* **Send data** - allows the user to define a JSON structure with the data to be sent along with the message
* **Stage** - assign a stage to the node, if needed

![](https://s3.eu-west-1.amazonaws.com/docx.flowx.ai/building-blocks/node/message_catch_start_config.png)


## Interprocess communication with throw and message catch start events

### Throw process

![](https://s3.eu-west-1.amazonaws.com/docx.flowx.ai/release34/throw_for_start.png)


#### Configuring the throw intermediate event

##### General config

* **Can go back?** - Setting this to true allows users to return to this step after completion. When encountering a step with canGoBack set to false, all steps found behind it become unavailable.
* **Correlate with catch events** - Should match the configuration in the message catch start event.
* **Correlation key** - A process key that uniquely identifies the instance to which the message is sent.
* **Send data** - Define a JSON structure with the data to be sent along with the message. In our example, we will send a test object:

```json
{"test": "docs"}
```
* **Stage** - Assign a stage to the node if needed.


![](https://s3.eu-west-1.amazonaws.com/docx.flowx.ai/release34/throw_for_start_config.png)

### Start with catch process

![](https://s3.eu-west-1.amazonaws.com/docx.flowx.ai/release34/start_catch_message_proc.png)

#### Configuring the message catch start event

:::info
Remember, it's mandatory to have a service account defined in your identity solution to have the necessary rights to start a process using the message catch start event. Refer to our documentation on how to create service accounts using Keycloak, [<u>**here**</u>](../../../platform-setup-guides/access-management/configuring-an-iam-solution.md#process-engine-service-account).
:::

![](https://s3.eu-west-1.amazonaws.com/docx.flowx.ai/release34/catch_start_event_config.png)

After running the throw process, the process containing the start catch message event will be triggered. The data is also sent:

![](https://s3.eu-west-1.amazonaws.com/docx.flowx.ai/release34/start_catch_event_response.png)
Loading