On the Trigger tab, you can define a trigger to automatically start a state transition when certain conditions are fulfilled. For example, you can define a state transition to occur when all the assignments of the current workflow state are completed or approved.

An automatic state transition for an object can occur for example on the basis of the property values of the object.

The server does automatic state transitions. User permissions are ignored. This means that you can use permissions to prevent users from manually starting a state transition. M-Files Server does the state transition when all the assignees have completed the task.

Using various criteria for the automatic transition

You can define an automatic state transition to occur when an object fulfills certain conditions. You can configure, for example,that the object is moved to the next state when a user gives it a certain property or certain property value. For example, in the message process workflow, you can define that when a user adds a date to the Sent field for the document, the document will automatically be moved to the Sent state.

You can also define that the state is changed after users have completed, approved, or rejected all separate assignments. As an alternative, you can specify custom criteria for the state change. For more information about filter settings, see Status-Based Conditions, Property-Based Conditions, File Information Based Conditions, and Permissions-Based Conditions.

Using a user-defined script for the automatic transition

You can also write a script that makes the state transitions occur. This allows you to specify the transition conditions in more detail with 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.

In this script, you can use these M-Files variables: StateID, StateTransitionID, AllowStateTransition, NextStateID, ObjVer, DisplayID, Vault, CurrentUserID, CurrentUserSessionInfo, PropertyValues, VaultSharedVariables, SavepointVariables, TransactionCache, MFScriptCancel, GetExtensionObject, MasterTransactionID, CurrentTransactionID, ParentTransactionID. For more information about variables, see Available VBScript Variables.

Note: The M-Files API documentation is available online: M-Files API. For more information about using VBScript in M-Files, see the How do I write VBScript code for M-Files purposes? tutorial.

Evaluation priority

With the evaluation priority, you can define the priority of parallel state transitions on M-Files Server. The priority is sorted from the lowest to the highest number. Zero (0) represents the highest priority.

Defining vaults for state transitions

You can define in which vaults the state transition occur. Enter the vault GUIDs separated by semicolons (;).

Evaluation of the triggering criteria

M-Files evaluates the state transition trigger every 60 minutes and every time the object is changed.