Configuring an M-Files workflow
To configure unattended processing of documents in FC, complete steps 1 and 2 described in the “M-Files workflow activity: installation and use” section and then:
- In the M-Files Admin application, navigate to Connections to M-Files Server → Local Computer → Document Vaults → <Vault_Name> → Workflows and create a workflow by clicking the New Workflow… button. Alternatively, you can modify your current workflow.
- Select the workflow that you just set up and create a state by clicking the New State button.
- In the Name field, type a name for the state (e.g. “In Processing by FlexiCapture”).
- On the Actions tab of the State Properties window, select the Run script option and click Edit Code….
For further information regarding workflow state actions, please see the M-Files User Guide.
- Paste the following script into the Edit VBScript Code window and provide your ABBYY FlexiCapture connection settings, the project name, and the batch type that you are going to use. When executed, this script will send a document from M-Files to FC for further processing. The script will stop once the file has been sent.
' FlexiCapture connection settings.
szFCServerUrl = "http://FlexiCapture"
'szCompany = "Company" '(Optional) Tenant name.
szFCUsername = "Username"
szFCPassword = "Password"
szFCProject = "Project"
szFCBatchType = "BatchType"
' Creates FlexiCapture client. The assembly Abbyy.MFiles.FlexiCapture.Activity.dll must be registered before.
Set oClient = CreateObject("Abbyy.MFiles.FlexiCapture.Activity.FlexiCaptureWebClient")
' Sets the target document context.
oClient.TargetContext.Vault = Vault
oClient.TargetContext.ObjVer = ObjVer
oClient.TargetContext.PropertyValues = PropertyValues
' Sets FlexiCapture connection settings.
oClient.ConnectionSettings.ServerUrl = szFCServerUrl
'oClient.ConnectionSettings.Company = szCompany '(Optional) Set tenant name.
oClient.ConnectionSettings.Username = szFCUsername
oClient.ConnectionSettings.Password = szFCPassword
' Sends the target document to FlexiCapture.
iBatchId = oClient.SendTarget(szFCProject, szFCBatchType)
The FC user whose credentials will be specified in the script must have either the Scanning Operator role for the project and batch type specified in the script or the Administrator role.
This script sends documents to ABBYY FlexiCapture using the M-Files Workflow Activity library. The script code is provided in the M-Files Workflow Activity folder in the connector distribution package (M-Files workflow – Send to FlexiCapture.vbs). Please be sure to specify the correct ABBYY FlexiCapture connection settings, project name, and batch type. For further instructions on creating VBScript code in M-Files, please see the “Available VBScript Variables” and “How do I write VBScript code for M-Files purposes” sections from the M-Files User Guide.
- Close the Edit VBScript Code window and click OK.
- Create a new state and give it a name (e.g. “Waiting for approval”) by repeating steps 1 through 3. This state will indicate that the document is ready for approval.
Below we provide a sample workflow for unattended processing of documents in FC.
Configuring an ABBYY FlexiCapture project
Make sure that Unattended is selected as the schema for the workflow in the FlexiCapture project. This mode is used for processing documents without operator involvement. To select this mode in FC, click Batch Type Properties → Workflow (or Project → Project properties for the “Default” batch type) and select Schema: Unattended.