Execution Mode #
Extension Kit rules can be executed in these modes: EventHandler, Background, and BackgroundTransaction.
EventHandler rules are executed during the event that triggered them, specifically in the BeforeCheckInChangesFinalize event handler. This occurs before an object is checked in but after state transitions and signatures have been finalized. Workflow changes are not allowed in this event handler. If a rule is configured to modify the object’s state, the change will be executed in the background after the event handler has finished. Rules executed in this mode take advantage of M-Files event handlers’ transactionality, meaning any changes they make to the vault are rolled back if an error occurs. However, they are subject to all event handler constraints, most notable being the 90-seconds timeout.
Background rules are executed in the background, after the event that caused them has finished. When Background mode is selected, rules are not transactional. This means that these tasks run independently of any transaction and do not roll back changes if a failure occurs during execution.
To have transactional behavior in the background, the BackgroundTransaction execution mode should be selected in the configuration. This mode ensures that tasks run within the context of a transaction, allowing any changes made by the task to be rolled back if the transaction fails.
In some modules, such as Object Creator, the execution mode can be set in advanced rule configuration. However, for most modules, the execution mode is set to an appropriate version by default and cannot be changed.
Execution Mode Overview by Modules #
Module | Event handler | Background | Background Transaction | Note |
---|---|---|---|---|
Orchestrator | 🗸 | 🗸 | 🗸 | Configurable. |
Property Operations | 🗸 | 🗸 | 🗸 | Rules that modify trigger source object are by default executed in event handler. Rules that modify objects other than trigger source are executed in background by default. This behavior can be changed. |
Property Calculations | 🗸 | 🗸 | Rules that modify trigger source object are executed in event handler. Rules that modify objects other than trigger source are executed in background. | |
Extended Auto Properties | 🗸 | × | × | |
Auto Numbering Properties | 🗸 | × | × | |
Versioning | 🗸 | × | × | |
Extended Permissions | 🗸 | 🗸 | 🗸 | Configurable. |
Extension Methods | 🗸 | × | × | |
Document Processing | × | 🗸 | 🗸 | Configurable. |
Object Creation | 🗸 | 🗸 | 🗸 | Configurable. |
Validation | 🗸 | × | × | |
Property Builder | 🗸 | × | × | |
SQL Integration | 🗸 | 🗸 | 🗸 | Configurable. |
HTTP Integration | 🗸 | 🗸 | 🗸 | Configurable. |
Reporting | × | 🗸 | 🗸 | Configurable. |
E-mail Notifications | × | × | 🗸 | |
Vault to Vault | 🗸 | 🗸 | 🗸 | Configurable. |
Data Transfer | × | × | 🗸 | |
Excel Reader | 🗸 | 🗸 | 🗸 | Configurable. |
Word Reader | 🗸 | 🗸 | 🗸 | Configurable. |
Excel Writer | × | 🗸 | 🗸 | Configurable. |
Word Writer | × | 🗸 | 🗸 | Configurable. |
Extended Assignments | 🗸 | × | × | |
Object Templates | 🗸 | × | × | |
Auto State Transition | × | 🗸 | × |
Execution Order #
When execution mode is event handler, rules are executed by module and in order they are specified in configuration. Modules execution order is as follows:
- Orchestrator
- Property Operations
- Property Calculations
- Extended Auto Properties
- Auto Numbering Properties
- Versioning
- Extended Permissions
- Extension Methods
- Document Processing
- Object Creation
- Validation
- Property Builder
- SQL Integration
- HTTP Integration
- Reporting
- E-mail Notifications
- Vault to Vault
- Data Transfer
- Excel Reader
- Word Reader
- Excel Writer
- Word Writer
- Extended Assignments
- Object Templates
- Auto State Transition