This tutorial shows how a sample invoice process can be configured.
At the end of this tutorial, you should be able
To create a new invoice process
Import Emails into the workflow
Scan or use Mobile Capture to start a workflow
Use Email to inform vendors about expections in the invoice process
Perform Optical Character Recognition (OCR)
Extract Key Invoice Metadata, such as PO Number, Invoice Number
Perform a Database Lookup & Other business rules
Provide an email with a link to a document so vendors can update missing metadata directly in the process
Use Timer functions to reject invoices if the vendor doesn't respond in a given timeframe
Export Documents with Zapier to Google Drive
Create Business Rules for Web Validation
Process Overview
Prerequisites
This section details the Admin Panel Organisation setup necessary prior to setting up the workflow. If the organisation is already setup you can skip this section.
Open your organisation you want to create the workflow
Click on 'Workflows'
Click on the 'Create Workflow Configuration' tile
Name the new 'Invoice Tutorial' and then click on the tile
Watch this video on how to create a workflow:
2. Adding Index Fields
In this step, we will add some index fields. The index fields created here are only available in the workflow and are separate to the index fields you may have created on your Document Types.
If you want the index field values from your Document Types in the Scan or Mobile clients to be passed to your Workflow, create an index field in the workflow with the same name as you created them in the Document Type.
Click on the + next to the Index Fields
A new field 'NewField1' has been created.
Click on the index field
Change the field display name, Field name and Datatype according to the table below.
Repeat step 1 to 4 for the remaining fields.
Name
Display Name
Datatype
InvoiceNumber
Invoice Number
string
InvoiceDate
Invoice Date
date
PONumber
PO Number
string
TaxPoint
Tax Point
string
NetTotal
Net Total
amount
TaxTotal
Tax Total
amount
GrossTotal
Gross Total
amount
Currency
Currency
string
DocumentType
Document Type
string
SupplierCompanyName
Supplier Company Name
string
SupplierTaxID
Supplier Tax ID
string
RejectURL
RejectURL
string
EmailFrom
EmailFrom
string
StartEvent - Scan/Mobile/Email Import
In this section we create a start event that gets documents from one of our own apps, such as Scan+ProcessLite, Scan+Express, Mobile Capture or from any iConnector compatible application.
Creating the flow - StartEvent
Click on the Design Process Button
This will open an empty process designer. On the left side, you find the steps that can be added to the process. We start by adding a StartEvent.
A StartEvent is the beginning of a workflow. This is where documents from Scan+ProcessLite, Scan+Express and Mobile Capture enter the workflow. Additionally, email and FTP import can as well be configured at a start event and third party integrations such as Zapier can use a start event to send documents to CumulusPro.
A processflow can have multiple StartEvent, one for each document type if necessary.
Click on the StartEvent icon and drag it onto the design canvas:
Your screen should now look like this:
To edit the properties of the StartEvent, click ont the Settings icon:
This opens a pop up showing the settings for the StartEvent
Select the Document Type from the Dropdown. In the screenshot above, the document type 'Invoices' has been selected. However, the names available depend on the names give in the section 'Pre-Requisits'.
Start Event for Email Import
Create a second start event
Click on the Settings
Leave the document type empty
Open the +Mail Polling
Complete the settings.
The IMAP Server, Port and Username/Password depends on your server. If you do not have an email account, you can skip the email import part.
Select 'Active' to ON, this will enabel the email import.
Map the email fields to the index fields, for example 'From' choose 'EmailFrom' from the dropdown list.
In case of an error, the Mail Pooler Error Message will display what has gone wrong.
Create an OCR Task
In this section, we create a Task that performs Optical Character Recognition (OCR) from the two Start Events.
Drag the 'Service Task' onto the canvas
Name the Task 'OCR'
Click on the Task Tile
Select Settings
Select 'Abbyy OCR Searchable PDF'' from the 'Action' dropdown
Close the OCR dialog by pressing the x on the top right.
Now, connect the start event to the OCR task
Click on the top start event, then click on the arrows
Drag the arrow on top of the OCR tile
Repeat the above for the second Start Event
Your diagram should look like this:
To make the diagram easier to read, we now adjust and label the arrows.
In the diagram above, we would like to adjust the arrow from the top start event to enter the OCR box from the top. In oder to do this, click on the arrow. The arrow is shown in a red-dashed line and the corners are marked in yellow.
Click on the connector and move it to until the arrows align.
The result should look like this.
Now that the lines are drawn, we label them to indicate the input.
Doubleclick on the line from the top start event
Enter the name 'Email Import'
Drag the Label near the start event
Repeat the above steps for the second arrow and label it 'Scan/Mobile'
Your process should look like this:
Metadata Extraction
The next step we add is to extract Metadata. While we could follow similar steps to adding the OCR Task, we explore an alternative here.
Click on the OCR tile and select the Service Task
Place the service task onto the canvas next to the OCR
Name the service task 'Metadata Extraction'
Note: The arrow to the service task was automatically added
Click on Settings of the 'Metadata Extraction'
Select 'FocalPoint Invoice Extraction' from the 'Action' Dropdown List
Now, the country settings are visible. Settings for the different Actions appear after the action is selected.
From the 'Country' dropdown list select 'UK'.
Close the service task settings by pressing the x on the top right.
Note: The list contains supported and preconfigured Invoice Processing settings.
The process should look like this:
Scripting Business Rules with Java Script
The ScriptTask allows you to define Java Scripts that are executed on the server side. In this tutorial step, we will use the ScriptTask to do a DB Lookup where we retrieve the SupplierCompanyName from teh TaxID we found on the invoice.
Add a ScriptTask (either by drag and dropping the script task from the left menu or by clicking on the Metadata Extraction step and adding the script task.
This script queries the database with the TaxID and from the returned records, it selects the first and populates the value into the SupplierCompanyName index fields. In case of an error, the error message is assigned to the _errorMessage variable and the document stays in this workflow step.
The process flow should now look like this:
User Task - Validation
Now that we have the metadata extracted and the business rules executed, we want a user to validate the invoice. The user should have the option to edit the index field and if the document is correct to complete the document. If the document has to be sent to the vendor, the user will reject the document for the vendor to update.
Add a UserTask to the workflow
Name the UserTask 'Validation'
Draw an arrow from the 'DB Lookup & Busines Rules' to the Validation
Click on the Settings of 'Validation'
In Application Configuration select 'Web Validation (MyHome) from the drop down list
Under 'Validation Buttons enable the 'Complete' and the 'Reject' button
Close 'Validation Settings' by clicking the top right x of the dialog
Note: As Validation requires users to access documents, we will create users and roles. However, we will do that later when we created a few more steps that require user interaction.
The workflow should look like this:
Exclusive Gateway
In Validation, we have given the user the chance to either Complete the invoice (and move to the next step) or to reject the invoice. Hence in this next step, we want to route the document to different steps in the workflow.
1) If the document is completed, then it should move on to the Approval stage
2) If the document is rejected, we want to inform the vendor and give the vendor a chance to correct the invoice
An Exclusive gateway is added in the same way as a process step
Drag and Drop the Exclusive gateway onto the canvas
Draw an arrow from Validation to the exclusive gateway
Note: The routing definition from the exclusive gateway is defined in the outgoing arrow. We will cover this in the next step.
Script Task - Web Validation URL for Supplier
If we reject the document to the vendor, we want to inform the vendor by email that the invoice has been rejected. As part of the email, we want to include a link to the webvalidation module (and document) where the vendor can update the document.
Drag and Drop a ScriptTask onto the canvas
Name the ScriptTask to 'Create Web Validation URL for Supplier'
Opent the settings for the ScriptTask
Copy/Past the following code into the script task:
The script creates a URL that points to the document with an access token. The URL is then assigned to the index field RejectURL.
Important: The step ID (in the sample code 979) needs to match the step ID of the web validation module. The step ID for webvalidation is the ID that is in the pop up of the UserTask. This has not yet been created and needs to be updated in the script later.
Now that the ScriptTask has been created, we can draw the conditional routing to that script task.
Click on the Exclusive gateway
Click on the arrow
Draw the line to the 'Create Web Validation URL for Supplier'
Click on the arrow
Click on the Settings icon
For the Condition Field select '_status' from the dropdown list
For the 'Equals' enter 'reject'
Note: The _status variable is assigned the value of the button clicked by the user in Web Validation. the button 'Reject' assigns the value 'reject'
Close the Arrow Dialog
Double Click the arrow
Enter a Label description 'Reject to Supplier' and position this next to the arrow
The workflow should now look like this:
Email to Supplier
In the next step, we want to send the vendor an email with a link to the invoice. The vendor can then click on the link in the email to update the details to the invoice.
Add an ServiceTask
Name the task 'Email to Supplier'
Draw an arrow from 'Create WEb Validation URL for Supplier' to 'Email to Supplier'
Click on the Settings of the 'Email to Supplier' service task
From the Action, select 'SendGrid Send Email'
Enter teh details of the email. Note, To Email address can be taken from the Index field or can be a fixed email address
For the body, you can either use a Text Body or HTML Body. For HTML, copy this sample HTML email:
<body>
<p>Dear Sir/Madam,</p>
<p>An invoice that we have received from you needs your attention. Please click on the link below to review the invoice and the respective comments/questions.</p>
<p>{RejectURL}</p>
<p>Regards,
<br>The CumulusPro Team</br></p>
</body>
Note: The {RejectURL} is the index field value we enter here.
Note: If you have your own SendGrid account, you can enter the API Key in the settings. Then we will use your account. Otherwise the CumulusPro account will be used and the outgoing email will be from CumulusPro.
Supplier Validation and Timer
Once the email has been sent to the supplier the system will wait for the supplier to update the invoice. There are two potential outcomes.
1) The supplier does update the invoice and 'Completes' the assigned task.
2) Supplier does not take any action and hence after a certain waiting period, the invoice should be processed as an exception (Email to Supplier that the invoice has been rejected)
Add a UserTask and name it 'Supplier'
Draw an arrow from 'Email to Supplier' to 'Supplier'
Draw an arrow from 'Supplier' to 'Validation'
Click on the 'Supplier' UserTask Settings
For 'Application Configuration' select 'Web Validation (MyHome)'
For 'Validation Buttons' select 'Complete'
Close the 'Supplier Settings' by clicking ont he top right x
Now, we add a timer function (Boundary event)
Drag and Drop the Boundary event onto the Supplier UserTask on the bottom right
click on the Boundary Event
Click on Settings
Enter '3' in the 'Days' section
This means that a task will wait for 3 days until action is taken. If no action is taken, the task is routed to another step.
Update the 'Create Web Validation URL for Supplier' with the correct ID of the 'Supplier' user task.
Email to Supplier - Invoice Reject
In case the supplier does not take action on the invoice within 3 days, we want to send an email to the Supplier informing the supplier about the rejection of the invoice.
Add a ServiceTask onto the canvas next to the Boundary Event
Name the ServiceTask 'Email to Supplier - Invoice Reject'
Draw an arrow from the BoundaryEvent to the new ServiceTask
Double Click on the Arrow and create a label 'No response within 3 days
Click 'Settings' on the 'Email to Supplier - Invoice Reject' and complete the email settings similar to the previous 'Email to Supplier' task.
In 'Add Attachment' select 'Original Email (EML) as the first attachment
In the second 'Add Attachment' select 'Original Document'
The workflow should now look like this:
End Event
To complete the workflow, we add an end event. This are where documents are completed and after a configured time are deleted from the Straatos Platform.
Add an EndEvent to the process next to 'Email to Supplier - Invoice Reject'
Draw a line to the End Event.
The workflow should now look like this:
Approval
Having complete the exception handling where we need suppliers to update the invoice, we now need to complete the standart (default) process. For this tutorial, we would like to route the document to an approver. The approver will have the option to Complete the document.
Add a UserTask 'Approver
Draw an arrow from the Exclusive Gateway to 'Approver'
For 'Approver' settings, enable the button 'Complete'
For 'Application Configuration' select 'Web Validation (MyHome)'
The workflow should now look like this:
Commenting
Comment fields are an easy way to add notes to the workflow so it makes it easier to understand. For this tutorial, we add a note to the Supplier step to give an example of why a document is sent to the supplier.
Click on Supplier
Click on the notes icon
Place the note box onto the canvas
Enter a description, such as 'Missing PO Number'
Export to Google Drive via Zapier
In the last step, we want to export the documetns and metadata to a backend system. For this tutorial we use Zapier to export the documents to Google Drive. Zapier (www.zapier.com) provides integrations into more than 500 applications. Hence the Google Drive example is just one of many.
Add a ServiceTask next to the 'Approver'
Name the ServiceTask 'Export to Google Drive
Draw an arrow from 'Approver' to the 'Export to Google Drive'
Draw an arrow from 'Export to Google Drive' to the EndEvent
Click on Settings on 'Export to Google Drive' and select 'Zapier Integration' from the 'Action' Dropdown
The remaining configuration is done within Zapier. We first complete the user and role setup and route a document past the all the steps so Zapier can automatically pick up the values to link to Google Drive.
User and Roles Setup
We need to create a user for each Validation step as well as a user to work with Zapier.
Select 'Invoice Processing Tutorial' from the menu navigation:
Select Authentication
Select Roles
Each UserTask workflow step has already a role. However, we need to create a role for 'MyHome' and 'Zapier'
Click on 'Create Role'
Name the role 'Zapier'
Click on the tile 'Zapier'
Under Functions, select 'Zapier'
Click on 'Back' in the browser
Click on 'Create Role'
Name the Role 'MyHome'
Under Functions, select 'MyHome'
Lastly, lets set up a scan role
Click on 'Back' in the browser
Click on 'Create Role'
Name the Role 'Scan'
Now we have created the roles, lets create the users
Go back up to 'Authentication'
Click on 'Accounts'
Click on 'Create Account'
Name the user 'Supplier@InvTutorial.com'
click on the Tile
Enter an easy to remember password
Select 'Supplier' from the 'Add Role'
Repeat steps 3-7 for the following users/roles:
Approver@InvTutorial.com - Approver
Validation@InvTutorial.com - Validation
Tutorial-Zapier - Zapier
Scan@InvTutorial.com - Scan
Now the roles have been setup
Testing the workflow
Publishing the workflow
Before using the workflow, we need to publish it.
Goto Workflow Configuration - Invoice Process Tutorial - Design Process
Click on 'Publish Workflow'
Upload a Document
Use either the mobile app or Scan+ProcessLite to scan and upload a document
Monitor the Documents
Goto Workflow Configuration - Invoice Process Tutorial - Monitor Process
Processing Documents
Use one of the CumulusPro Clients to capture a number of invoices. In this example we use Scan+ProcessLite.
Goto the Link tile:
Open the Scan+ProcessLite link:
If you haven't used the scan client on the machine before, you will need to install Scan+. Otherwise, you will be prompted to log in.
Login with the Scan Operator credentials (alternatively, if you have configured 'Anonymous login', you will skip this step.
Scan documents and upload documents:
Note: I have included an index field 'FromEmail' where I can enter the email address. This makes it possible to test the email notification.
Monitoring the Process
Now that the documents are uploaded, we want to monitor the progress in the Process Monitor.
Open admin.cumuluspro.net
Log in
Goto the workflow
Next to the 'Design' Button there is a 'Monitor' button. Click on the button.
The process Monitor opens and displayes the same representation as the Design Process.
If the documents are sucessfully imported, they are displayed as a number below the workflow step they are currently in:
In the above screenshot, 1 document is visible.
If not all document are visible, this might be that the counters have not been refreshed. The counters refresh every minute automatically. If you want to refresh the counters manually, you can do this by preccing the 'update counters' button:
To see more details of the documents in a particular step, click on the step tile. A table opens showing the details of the documents as well as actions that can be taken for those documents:
If you would like to see a preview of the documents, click onto the document line (not the checkbox in front) and a preview opens:
To hide the preview, click on the line again.
Continue to process all the documents and check the outcome in each particular step until the 'Export to Google Drive' step. Next, we will setup Zapier.
Zapier Configuration for Google Drive Export
For this tutorial, we going to setup zapier as an export for Google Drive.
Goto www.zapier.com
If you don't have already a login, create a new login
One setup, goto 'My Zaps' and click on 'Make a New Zap'
Your screen should look like this:
in 'Choose a Trigger App' enter CumulusPro
Select CumulusPro
Then in 'Choose Trigger' click on Save+Continue'
Select (or create) and account. Note, if you haven't used Zapier with this workflow yet, create a new account and log in with your organisation level account that has rights to zapier
Click on Test Account and once 'Account is working' is displayed, click on 'Save+Continue'
On the Set Up Options, choose the workflow and the workflow step. Note: Only workflow steps which are 'ServiceTasks' and where the Action is 'Zapier Integration' are shown.
On 'Test this Step' click 'Fetch & Continue'. Important is that a document is currently in the 'Export to Google Drive' step
If the test is successful, click on continue.
Now we setup the Action (Google Drive)
Search and select 'Google Drive'
Choose 'Create File from Trigger' and click Save+Continue
Select your Google account or add a new one, then click Save & Continue
Select the Folder (optional)
In 'File', click on the list icon at the end and then select the document you want to export. In this case it is the 'Abbyy OCR searchable PDF'
Click Continue
Click 'Create & Continue on the 'Test Google Drive'
When the 'Test Successful' appears, click on 'Finish'
Create a Name for your Zap and switch it on.
Now the zapier setup is complete. To process the document in Admin Panel Process Monitor
Select the document
click on Retry selected
The document now gets exported to Google Drive
Check Google Drive if the documents are there
Business Rules in Web Validation
So far, we have setup business rules in Java Script as part of a process step. However, we may want to validate index information in the Validation screen. For this tutorial we add a check if the GrossTotal is equal to the NetTotal + Tax.
Go to the Workflow setup
Click on the index field 'GrossTotal'
Scroll down to the 'Validation Expression Message'
Add the message 'Net Total + Tax Total is not equal to Gross Total'
In 'Validation Expression (boolean) enter the JavaScript:
Now, to test, open the fly-out on the right hand side.
This opens the Web Validation Simulator. The Web Validation Simulator displays all the fields and rules as the web validation module. Each change that is made in the rules will immediately reflect in the simulator. Also, the index field values can be entered and tested if they fit the rules.