null


Skip to end of banner
Go to start of banner

Editing and customizing workflows using the code editor

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

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:

cdmc_codeeditor_createnewworkflowtemplatecode.png

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

cdmc_codeeditor_trigger_eventname_schema_onchangestate_highlighted.png

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

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.png
  • using the { } toggle button option in the workflow builder visual editor

cdmc_wfbuilder_visualeditor_customworkflow_code_editor_toggle_highlighted.png

Using the code editor

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

cdmc_codeeditor_customworkflow.png

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

  • workflow property names in grey

  • property and array values in blue

  • boolean values, true or false, in red

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.png

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.png

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.png

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 is displayed to help you add these and complete the property definition.

cdmc_codeeditor_triggers_event_eventtype_conditions_schema.png

The code editor validates any changes and displays a syntax error if a JSON code error is found.

cdmc_code_editor_syntaxerror.png

The code editor does not allow you to save a template with a validation error, and when you toggle into the visual editor, the JSON template with a code error is not saved.

Examples

Related pages


  • No labels