Advanced topics

Workflows

Introduction

Workflows provide a structured method for storing a sequence of states over which the a document will progress. Workflows keep track how a document has been processed so far.

Workflows work by storing a series of states to help you know the “status” of a document. To move a workflow from one state to another, transitions are used.

Transitions connect two different states and help provide context to know which state is possible to transition to, from a previous state. Transitions provide and order for the sequence of possible states changes.

Transitions can be executed manually by users if they have the required access level as configure by the system administrator.

blockdiag submitted approved rejected archived approve reject re-open

Example workflow. Circles represent states, rectangles represent transitions.

Workflows in Mayan EDMS are implemented as finite state machines (https://en.wikipedia.org/wiki/Finite-state_machine).

Workflows are mainly used to represent business processes. But they can also be used an automation system to customized Mayan EDMS and have it perform some tasks automatically.

Automation

Besides being able to be executed manually by users, transitions can also be programmed execute automatically based on system events. This is called in Mayan EDMS transition triggering and is one of the tools available to automate business processes.

For example:

  • Move a document from a “scanned” state to a “billed” state when a tag is attached to the document.
  • Move a document from a “uploaded” state to a “OCR ready” state when the OCR engine finishes processing the document.

The other tool provided for process automation is being able to execute an action when a workflow state is reached or leaved. These are called state events.

Some examples of state actions currently provided are:

  • Attach a tag to a document
  • Remove a tag from a document
  • Do an HTTP POST request to an external IP address
  • Edit the label or the description of a document.

Other time more state actions are being added. Some state actions like the one that creates an HTTP POST request allow Mayan EDMS to trigger processes in external systems based on the state of a document. One example of this is triggering the billing process of an accounting system when an invoice is scanned in Mayan EDMS.

Workflow state actions and transitions triggers are new features and are still evolving.

Workflows allow translating business logic into a series of states. With the addition of state actions and transition triggers, the workflows in Mayan EDMS are no longer just informative but can be part of your actual business automation process.

Implementation

Internally, workflows are implemented as a finite state machines (https://en.wikipedia.org/wiki/Finite-state_machine). To make them simpler to use, workflow have been designed so that only one state can be the current active state for a workflow being executed. Another design decision is that every workflow needs at least one state marked as the initial state.

Visualizations

The graphical representation of a workflow is similar to a flowchart. The states are represented with circles. The transitions are represented with arrows. Circle with a double border represent the initial state of the workflow.

To view the graphical representations of workflow use Preview button of the workflow in the setup view.

Document signatures

Mayan EDMS supports two types of document signatures: embedded and detached signatures. When a document with an embedded signature is uploaded, this signature is readily detected as part of the document inspection step. The status of the signature can be verified by accessing the signatures sections of a document.

blockdiag user Key Document Signed Document

Signed documents are tamper-proof. That means that if any part of the document’s file is edited (even just one character or one pixel), the document’s signature becomes invalid alerting that an unauthorized change has occurred.

Existing non signed documents can be signed in one of two ways: by downloading the document, signing it, and uploading the signed document as a new version of the existing one or by creating a detached signature for the non signed document and uploading such detached signature file.

Maintenance of the public keyring can be done using the Key management functionality in the Setup menu.

From this menu, key servers can be queried and the results imported. Public keys no longer needed can also be deleted from this menu.

Only GNU Privacy Guard signatures are support at the moment.

Only version 1 of GNU Privacy Guard is supported at the moment.

Metadata

Metadata is the name of the attribute of a document. The concept of metadata is divided in two: metadata types (size, color, distance) and metadata values for those types. Metadata types are defined in the setup menu and associated with document types. Then when a document is uploaded, a value for that metadata can be entered. There are two kinds of metadata type to document type relations: optional and required. When a metadata type is optional for a document type, it can be left blank for a document being uploaded and the upload will still be successful. On the other hand required metadata type must be given a value or it will not be possible to upload the document at hand.

Examples of metadata type: Invoice number, color, employee id.

The data entry of metadata types can be set to allow any value to be provided (the default) or a list of possible values can be entered in the Lookup configuration option and users will be presented with a drop down list of options instead of the default text entry box.

If metadata types are setup to allow any value to be entered a validation option can be chosen to block the entry of invalid data. Metadata types also provide parsers which will not block the entry of data but are able to interpret and modify the value provided by the user to a conform to a specific format. An example of a provided parser is the date parser which will interpret and correct dates provided by users regardless of the format in which they are entered.

Creating metadata types

Permissions required

The “Create new metadata types” permission is required for this action.

  1. Go to the System ‣ Setup ‣ Metadata types menu.
  2. From the Actions dropdown select Create new.
  3. Provide a name to reference this metadata type in other parts of the system.
  4. Enter a label to be shown to users when using this metadata type.
  5. Optional: Enter a default value for the metadata type.
  6. Optional: Provide a comma separated list of options to restrict the data entry when using this metadata type.
  7. Optional: Select a validator and a parser to validate and cleanup the data entry when not using a predetermined list of values.
  8. Press Submit.

Assigning a metadata type to a document type

Permissions required

  • The “Edit metadata types” permission is required for this action, globally or via an ACL for a metadata type.
  • Also the “Edit document type” permission is required, globally or via an ACL for a document type.

This action can be performed in two ways.

Option 1: Via the metadata type view

  1. Go to the System ‣ Setup ‣ Metadata types menu.
  2. Click on the button Document types of the metadata type you which to associate.
  3. From the list of existing document types press either:
    • None if this metadata type will not be available for documents of the type.
    • Optional if this metadata type will be available and is optional to provide a value for documents of the type.
    • Required if this metadata type will be available and is required to provide a value for documents of the type.
  4. Press Save.

Option 2: Via the document type view

  1. Go to the System ‣ Setup ‣ Document types menu.
  2. Click on the button Metadata types of the metadata type you which to associate.
  3. From the list of existing metadata types press either:
    • None if this metadata type will not be available for documents of the type.
    • Optional if this metadata type will be available and is optional to provide a value for documents of the type.
    • Required if this metadata type will be available and is required to provide a value for documents of the type.
  4. Press Save.

Transformations

Transformations are persistent manipulations to the previews of the stored documents. For example: a scanning equipment may only produce landscape PDFs. In this case a useful transformation for that document source would be to rotate all scanned documents by 270 degrees after being uploaded. By adding this transformation to the Mayan EDMS source that is connected to the scanner, all pages scanned via that source will inherit the transformation as they are created. The result is that whenever a document is uploaded from that scanner, it will appear in portrait orientation, instead of landscape orientation.

Transformations can also be added to existing documents by clicking on a document’s page and then clicking on “transformations”. In this view the Actions menu will have a new option that reads “Create new transformation”. Currently, the available transformations are: rotation, zoom, crop, and resize. Once the document image has been corrected, resubmit it for OCR for improved results.

Transformations are not destructive and do not physically modify the document file, they just modify the document’s graphical representation.

Document versioning

Mayan EDMS has the ability to store different versions of the same document. A comment field is provided to allow users to summarize the new version changes in comparison with the previous one. If a new version was uploaded by mistake or such new version is no longer necessary the option to revert to a previous version of the document is provided.

blockdiag Version 1 Version 2 payroll_report.pdf payroll_report_fixed.pdf payroll_report.pdf payroll_report_fixed.pdf

Only the interactive document sources (Sources) (Web and Staging folders) are available to upload new document versions.

There is no limit to the number of versions a document can have.

blockdiag payroll_report.pdf Versions

By default, the last version will be showed when working with the document but any of the versions can be inspected and viewed.

View a document version list

Permissions required

The “View documents’ versions list” permission is required for this action, either globally or via an ACL for a document or document type.

  1. Navigate to the select document’s preview view.
  2. Click on the sibebar’s Versions button.

Uploading a new document version

Permissions required

The “Create new document versions” permission is required for this action, either globally or via an ACL for a document or document type.

  1. Navigate to the select document’s versions list view.
  2. From the Actions dropdown select Upload new version.
  3. Optionally type a comment explaining the changes in the new version.
  4. Press the Browse button and select a new file.
  5. Press Save upload the new version.

Quick labels

Quick labels are predetermined filenames that allow the quick renaming of documents as they are uploaded or after they have been uploaded.

Quick labels are added and associated to a document type.

Example of quick label: Invoice, Receipt from X store, Purchase order.

It is possible to preserve the file extension when using quick labels. Extensions are required for some operating system to be able to detect the correct file type to access the content.

For example if a document file is named “file0001.pdf” and the quick label “Receipt from X store” is applied, the resulting document label will be “Receipt from X store.pdf”.

Creating quick labels

Permissions required

The “Edit document types” permission is required for this action, either globally or via an ACL for a document type.

Since quick labels are associated with document types, creating quick labels must be done from the document type view.

  1. Go to the System ‣ Setup ‣ Document types menu.
  2. In the document type list, click on the Quick labels button of the document type for which you wish to create a quick label.
  3. In the view titled “Quick labels for document type: <your document type>”, from the Actions dropdown select Add quick label to document type.
  4. At the quick label creation form enter the desired label and press Save.

Using quick labels during upload

  1. Use the new document upload wizard from Documents ‣ New document.
  2. Select a document type and navigate to the penultimate step, where you have the option to drag and drop files to upload.
  3. Select a an option from the Quick document rename dropdown.
  4. Optionally select the Preserve extension checkbox to keep the file extension.
  5. Upload your documents.

Using quick labels for existing documents

Permissions required

The “Edit document properties” permission is required for this action, either globally or via an ACL for a document or document type.

  1. Navigate to the document preview view of the document to rename. Make sure quick labels for the document type of the document select have been created.
  2. From the Actions dropdown select Edit Properties.
  3. Select a an option from the Quick document rename dropdown.
  4. Optionally select the Preserve extension checkbox to keep the file extension.
  5. Press Save to rename the document.