Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

Table of Contents
minLevel1
maxLevel6
outlinefalse
typeflat
separatorpipe
printabletrue

Overview

A Comala Document Management workflow is created using JSON (Javascript Object Notation) code.

There are two places you

...

can create or customize

...

...

a custom workflow template by editing the JSON code:

Excerpt
namecodeeditor_schema
cdmc_codeeditor_createnewworkflowtemplatecode.pngImage Added

The JSON code editor includes

  • color coding to distinguish property names, values, and different data types

  • autocomplete feature for workflow properties and values

  • dropdown selectors for available property names, including workflow triggers, workflow parameters, states, transitions, and approvals

cdmc_codeeditor_trigger_eventname_schema_onchangestate_highlighted.pngImage Added
  • a search tool accessed by the keyboard shortcut CMD+F

Info

The visual editor can also be used to create or edit workflows without the need to add

...

or edit code directly. Changes in one editor are automatically updated when the workflow is viewed in the other

...

...

.

Accessing the code editor

Excerpt
namecodeeditor_access

You can access the code editor for a custom workflow in the space document management dashboard

  • using the </> icon in the Actions options in the space document management dashboard

cdmc_documentmanagmentdashboard_extract_customworkflow_codeeditoricon_highlighted.pngImage Added
  • using the { } toggle button option in the workflow builder visual editor

cdmc_wfbuilder_visualeditor_customworkflow_code_editor_toggle_highlighted.pngImage Added

Using the code editor
Anchor
createworkflowwithjson
createworkflowwithjson

Excerpt
namecodeeditor_use_extract

If you are familiar with JSON

...

, you can use the Comala Document Management code editor to edit an existing workflow or create your own.

...

There are also a variety of widely available JSON tools for editing reformatting, validating, and parsing JSON. These can then be copied and pasted into the Workflow schema dialog box in the Comala Document Management code editor.

The code editor can be accessed for the current workflow in the space document management dashboard

  • using the Use Code Editor option in the Edit workflow dropdown menu

...

...

A simpler way to customize a workflow is to add one or JSON triggers to an existing workflow using the trigger editor in workflow builder visual editor.

...

In the Content Expiry Workflow above, an included JSON trigger can be seen in workflow builder. The trigger listens for the expiry of the final state and sends emails to a number of users and sets a screen message.

The trigger listens for a specific workflow event to occur such as a change of state, and if any set conditions are met, will action a change.

A trigger can be used to action custom email notifications, set an on-screen message notification, transition the workflow to a different state, assign a reviewer, approve or reject an approval

...

cdmc_codeeditor_customworkflow.pngImage Added

Color coding is used to distinguish property names, values, and different data types in the workflow template JSON code:

  • workflow property names in grey

  • string, meta, and regex values in blue

  • boolean values, true or false, in orange

  • numbers and operators are in green

Data is represented within data or name pairs of curly braces { } and square brackets [ ]. Highlight one of the braces or brackets, and the paired brace or bracket is highlighted.

cdmc_codeeditor_highlightedbrace_pair_statedefinition.pngImage Added

When editing in the code editor, adding "" displays JSON schema options to help add workflow properties, values, and data.

cdmc_codeeditor_triggers_selected_initialschema_object.pngImage Added
Info

To activate the JSON schema prompt, click within the "" .

JSON schema is then displayed for the selected workflow object to help add further properties and values.

For example, the value options for the event for a workflow trigger to listen for.

cdmc_codeeditor_trigger_eventname_schema_onchangestate_highlighted.pngImage Added
Info

Scroll with the mouse in the JSON schema box to view additional options. Click the keyboard’s Arrow keys to move up or down and select an option.

A workflow trigger has multiple parameters; a JSON schema dropdown is displayed to help you add these and complete the property definition.

...

States, transitions, and approvals

The code editor also provides a JSON schema dropdown to

  • add a workflow state and its attributes, including colour, description, expiry due date and whether the state is an initial or final state in the workflow

...

  • add state transitions

...

  • add an approval

...

Workflow parameters

The code editor provides a JSON schema dropdown to add workflow parameters.

...

Workflow triggers

The code editor provides JSON schema dropdowns to create and add a workflow trigger. Dropdowns are provided for each of the events, conditions, and actions properties of the trigger.

  • event

...

  • conditions

...

  • actions

...

The actions also have a JSON schema dropdown to support the addition of the code.

...

Search help

The code editor includes a search tool.

  • type CMD+F to display the search help

...

Added search strings found in the code are highlighted. You can filter the search to match case, regexp, and word. A Replace option is also available.

Code validation

At the moment of typing, the code editor validates and highlights JSON syntax errors.

...

This is usually displayed at the point in the code where you add the required elements for a workflow property, such as a trigger.

The dialog box also displays a Syntax error found error message.

...

A complete validation of the JSON as a valid workflow is not done until the save button is clicked. If there are errors, the edited workflow cannot be saved, and an error message is displayed

If you toggle into the visual editor, the JSON template with a syntax code error is not saved.

Examples

Child pages (Children Display)
allChildrentrue

Related pages

...

...