Trigger

You can define a trigger to automatically initiate a state transition when certain conditions are fulfilled. For example, you can set a state transition to take place when all the assignments of the current workflow state are completed or approved.

Video: Automatic State Transitions

Automatic state transitions are executed by the server, ignoring user permissions. This means that permissions can be used to prevent users from manually initiating a state transition, ultimately executed by M-Files Server when all the assignees have completed the task.

Triggers can be used for automating workflow phases.

Using various criteria for the automatic transition

An automatic state transition can be configured to take place when an object fulfills certain conditions. You can configure, for example, the object to be moved to the next state when it is given a certain property or certain property value. For example, in the message process workflow, you can define that when a date is added to the Sent field for the document, the document will automatically be changed to the Sent state.

You can also set the state to be changed after all separate assignments are completed, approved, or rejected. Alternatively, you can specify custom criteria for the state change. For more information about filter settings, refer to Filter Settings.

Using a user-defined script for the automatic transition

The state transition can also be triggerd via a user-defined script. This allows you to specify the transition conditions in more detail by using variables, generic features of VBScript and M-Files API. For example, you can define several state transitions related to the properties and property values at the same time.

The following M-Files variables can be used in this script: StateID, StateTransitionID, AllowStateTransition, NextStateID, ObjVer, DisplayID, Vault, CurrentUserID, CurrentUserSessionInfo, PropertyValues, VaultSharedVariables, SavepointVariables, TransactionCache, MFScriptCancel, GetExtensionObject, MasterTransactionID, CurrentTransactionID, ParentTransactionID. For more information about variables, refer to VBScript Variables Explained.

Note: The documentation for the M-Files API is located in Start > Programs > M-Files > Documentation > M-Files API. For more information about VBScript code and M-Files API, go to www.m-files.com/api. Instructions on writing VBScript code and working with the M-Files API are available for a separate fee from M-Files customer support ([email protected]).

Evaluation priority

The evaluation priority enables you to define the priority in which parallel state transitions are evaluated on M-Files Server. The priority is sorted from the lowest to the highest number, zero (0) representing the highest priority.