You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/refguide/modeling/application-logic/workflows/event-sub-processes.md
+47-45Lines changed: 47 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,25 +6,25 @@ weight: 20
6
6
7
7
## Introduction
8
8
9
-
An event sub-process is a separate execution flow that is not part of the normal sequence flow of its workflow. It resides inside the workflow and starts executing upon receiving a specific trigger.
10
-
It is crucial to understand that an event sub-process is part of the same workflow instance. It is not a "separate" workflow; rather, a single workflow instance can contain multiple concurrent processes.
9
+
An event sub-process is a separate execution flow that is not part of the normal sequence flow of a workflow. It resides inside the workflow and starts executing upon receiving a specific trigger. It is crucial to understand that an event sub-process is part of the same workflow instance. It is not a separate workflow but a single workflow instance that can contain multiple concurrent processes.
11
10
12
-
Below is an example of what an event sub-process looks like:
11
+
Below is an example of an event sub-process, shown inside the dashed rectangle:
An event sub-process is like a boundary event, with the exception that an event sub-process can start at any time, whereas a boundary event can start only while the activity it is attached to is active.
19
-
Choosing between a boundary event and an event sub-process is a common architectural crossroads.
17
+
An event sub-process is similar to a [boundary event](/refguide/workflow-boundary-events/), with the exception that an event sub-process can start at any time, whereas a boundary event can start only while the activity it is attached to is active. Choosing between a boundary event and an event sub-process is a common architectural crossroads.
20
18
21
19
#### Ideal Use Cases
22
20
21
+
Event sub-processes are particularly useful in the following scenarios:
22
+
23
23
***Global exception handling** – Handling errors or cancellations that could occur at any point during the workflow execution.
24
-
***Isolated logic** – Complex steps triggered by a specific event (for example, "Change of Address") without cluttering the main flow.
24
+
***Isolated logic** – Handling complex steps triggered by a specific event (for example, "Change of Address") without cluttering the main flow.
25
25
***Inline updates** – Updating data in a long-running process without interrupting the primary state of the workflow.
26
26
27
-
####When Not to Use Event Sub-Processes
27
+
### When Not to Use Event Sub-Processes
28
28
29
29
***Sequential logic** – If the logic must happen after a specific task, use a standard sequence flow.
30
30
***Conditional logic based on activity state** – You may want to execute a flow only if a certain condition is met while a specific activity is active. A boundary event should be used here because it is triggered only if the activity it is attached to is active.
@@ -34,10 +34,10 @@ Choosing between a boundary event and an event sub-process is a common architect
34
34
35
35
#### Lifecycle
36
36
37
-
The event sub-process is initialized (but not started) as soon as the main process starts and remains in a waiting state until a notification is received.
37
+
An event sub-process is initialized (but not started) as soon as the main process starts and remains in a waiting state until a notification is received.
38
38
39
39
{{% alert color="info" %}}
40
-
A workflow instance remains **In Progress** as long as at least one of the following conditions is met:
40
+
A workflow instance remains **In Progress** as long as at least ONE of the following conditions is met:
41
41
42
42
* The main process path has not yet reached its end event.
43
43
* Any event sub-process that was started has not yet reached its end event.
@@ -47,10 +47,12 @@ The workflow will NOT complete until all active execution paths, both the main f
47
47
48
48
#### Triggers and Notifications
49
49
50
-
Event sub-processes are triggered by a **Notify workflow** microflow activity. When the trigger is received, the sub-process becomes **In Progress**.
50
+
Event sub-processes are triggered by a [Notify workflow](/refguide/notify-workflow/) microflow activity. When the trigger is received, the sub-process becomes **In Progress**.
51
51
52
52
#### Interrupting vs. Non-Interrupting
53
53
54
+
Event sub-processes can be configured as either interrupting or non-interrupting, depending on how they interact with the main process flow.
55
+
54
56
***Interrupting (solid line)** – Immediately cancels the main process flow.
55
57
***Non-Interrupting (dashed line)** – Runs in parallel with the main flow.
56
58
@@ -60,7 +62,7 @@ Currently, Mendix only supports the non-interrupting variant of event sub-proces
60
62
61
63
#### Concurrency Limitation
62
64
63
-
Mendix Workflows currently support a **single concurrent instance** per defined event sub-process. If a non-interrupting event sub-process is already active, subsequent attempts to trigger that same sub-process via the **Notify workflow** activity will return `false`. No new instances will be created for that specific sub-process while one is **In Progress**. A new instance can only be initiated once the active sub-process has completed its execution path.
65
+
Mendix workflows currently support a **single concurrent instance** per defined event sub-process. If a non-interrupting event sub-process is already active, subsequent attempts to trigger that same sub-process via the **Notify workflow** activity will return `false`. No new instances will be created for that specific sub-process while one is **In Progress**. A new instance can only be initiated once the active sub-process has completed its execution path.
64
66
65
67
If your workflow has multiple, distinct event sub-processes defined (for example, one for "Address Change" and one for "Document Upload"), each one can have its own active instance simultaneously. One being active does not prevent a different one from being triggered.
66
68
@@ -91,14 +93,14 @@ An event sub-process is bound to the lifecycle of its parent workflow instance.
91
93
92
94
The following table outlines how top-level workflow operations and system states affect any event sub-process that is currently **In Progress**:
93
95
94
-
| Event or Operation | Effect on Event Sub-Process | System Behavior|
| Abort Workflow | Aborted | The sub-process is permanently stopped and cannot be re-notified.|
97
-
| Restart Workflow | Aborted & Reset | The active sub-process instance is aborted. It returns to a waiting state and can be notified again.|
98
-
| Pause Workflow | Execution Halted | Execution of the sub-process halts immediately. Logic resumes from the same point once the workflow is Unpaused.|
99
-
| Workflow Incompatible | Execution Halted | The sub-process is "frozen" due to a version conflict. Execution resumes from the current point once the conflict is Resolved.|
100
-
| Error Inside Sub-process | Failed | The sub-process activity enters a Failed state. After the issue is fixed and the workflow is Retried, the sub-process resumes from the failed activity.|
101
-
| Error Outside Sub-process | Execution Halted | If a failure occurs elsewhere in the workflow, the healthy sub-process stops processing. It resumes once the error is fixed and the workflow is Retried. |
96
+
| Event or Operation | Effect on Event Sub-Process | System Behavior |
97
+
|---|---|---|
98
+
| Abort Workflow | Aborted | The sub-process is permanently stopped and cannot be re-notified. |
99
+
| Restart Workflow | Aborted and Reset | The active sub-process instance is aborted. It returns to a waiting state and can be notified again. |
100
+
| Pause Workflow | Execution Halted | Execution of the sub-process halts immediately. Logic resumes from the same point once the workflow is Unpaused. |
101
+
| Workflow Incompatible | Execution Halted | The sub-process is "frozen" due to a version conflict. Execution resumes from the current point once the conflict is Resolved. |
102
+
| Error Inside Sub-process | Failed | The sub-process activity enters a Failed state. After the issue is fixed and the workflow is Retried, the sub-process resumes from the failed activity. |
103
+
| Error Outside Sub-process | Execution Halted | If a failure occurs elsewhere in the workflow, the healthy sub-process stops processing. It resumes once the error is fixed and the workflow is Retried. |
102
104
103
105
## Jump Rules
104
106
@@ -128,11 +130,11 @@ The `WorkflowSubProcessDefinition` entity represents the metadata of a sub-proce
|`WorkflowSubProcessDefinition_WorkflowDefinition`|`WorkflowSubProcessDefinition`|Link to the parent workflow definition.|
134
-
|`WorkflowUserTaskDefinition_WorkflowSubProcessDefinition`|`WorkflowUserTaskDefinition`| Links user task definitions to their containing sub-process definition. |
135
-
|`WorkflowActivityRecord_WorkflowSubProcessDefinition`|`WorkflowActivityRecord`| Links historical activity records to the sub-process definition.|
133
+
| Association | Parent Entity | Description |
134
+
|---|---|---|
135
+
|`WorkflowSubProcessDefinition_WorkflowDefinition`|`WorkflowSubProcessDefinition`|Links to the parent workflow definition. |
136
+
|`WorkflowUserTaskDefinition_WorkflowSubProcessDefinition`|`WorkflowUserTaskDefinition`| Links user task definitions to their containing sub-process definition. |
137
+
|`WorkflowActivityRecord_WorkflowSubProcessDefinition`|`WorkflowActivityRecord`| Links historical activity records to the sub-process definition. |
136
138
137
139
### WorkflowSubProcess
138
140
@@ -142,35 +144,35 @@ The `WorkflowSubProcess` entity represents a specific runtime instance of an eve
|`Caption`| String | The caption of the sub-process instance.|
148
-
|`StartTime`| DateTime | The timestamp when execution began. This is set by the engine and is read-only.|
149
-
|`EndTime`| DateTime | The timestamp when execution ended (either through completion or failure). This is set by the engine and is read-only.|
150
-
|`State`| Enumeration| The current lifecycle state of the sub-process instance (see [WorkflowSubProcessState](#workflowsubprocessstate-enumeration)). |
151
-
|`Reason`| String (Unlimited) | A technical description providing context for the current state (e.g., error details).|
147
+
| Attribute | Type | Description |
148
+
|---|---|---|
149
+
|`Caption`| String | The caption of the sub-process instance. |
150
+
|`StartTime`| DateTime | The timestamp when execution begins. This is set by the Engine and is read-only. |
151
+
|`EndTime`| DateTime | The timestamp when execution ends (either through completion or failure). This is set by the Engine and is read-only. |
152
+
|`State`| Enumeration | The current lifecycle state of the sub-process instance (see [WorkflowSubProcessState](#workflowsubprocessstate-enumeration)). |
153
+
|`Reason`| String (Unlimited) | A technical description providing context for the current state (for example, error details). |
|`WorkflowSubProcess_WorkflowSubProcessDefinition`|`WorkflowSubProcess`| The association to the underlying definition for this instance.|
158
-
|`WorkflowSubProcess_Workflow`|`WorkflowSubProcess`| The association to the parent workflow instance.|
159
-
|`WorkflowUserTask_WorkflowSubProcess`|`WorkflowUserTask`| The association to active user tasks within this sub-process instance.|
160
-
|`WorkflowEndedUserTask_WorkflowSubProcess`|`WorkflowEndedUserTask`| The association to completed or ended user tasks within this instance.|
161
-
|`WorkflowActivityRecord_WorkflowSubProcess`|`WorkflowActivityRecord`| The association to the historical execution records for this instance.|
162
-
|`WorkflowCurrentActivity_WorkflowSubProcess`|`WorkflowCurrentActivity`| The association to the activities currently being executed in this sub-process (see [Jump to](/refguide/jump-to/). |
157
+
| Association | Parent Entity | Description |
158
+
|---|---|---|
159
+
|`WorkflowSubProcess_WorkflowSubProcessDefinition`|`WorkflowSubProcess`| The association to the underlying definition for this instance. |
160
+
|`WorkflowSubProcess_Workflow`|`WorkflowSubProcess`| The association to the parent workflow instance. |
161
+
|`WorkflowUserTask_WorkflowSubProcess`|`WorkflowUserTask`| The association to active user tasks within this sub-process instance. |
162
+
|`WorkflowEndedUserTask_WorkflowSubProcess`|`WorkflowEndedUserTask`| The association to completed or ended user tasks within this instance. |
163
+
|`WorkflowActivityRecord_WorkflowSubProcess`|`WorkflowActivityRecord`| The association to the historical execution records for this instance. |
164
+
|`WorkflowCurrentActivity_WorkflowSubProcess`|`WorkflowCurrentActivity`| The association to the activities currently being executed in this sub-process (see [Jump to](/refguide/jump-to/)). |
163
165
164
166
### WorkflowSubProcessState (Enumeration)
165
167
166
168
The `WorkflowSubProcessState` enumeration defines the possible lifecycle phases of a sub-process instance:
0 commit comments