Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Image Removed
Table of Contents
minLevel1
maxLevel6
outlinefalse
typeflat
separatorpipe
printablefalse
Image Added

Overview

Conceptstemplatesmacrosstates

In this lesson, we're going to look at states. States are like milestones in your process.

In our simple content production process, there are just three states:

  • Editing – content is created or edited

  • Review – someone checks the content and decides if it can be published

  • Publish – the final, published state of our content

Let's get started...

Table of Contents

Edit a workflow

The workflow we made in Lesson 1 - Templates had two states – In Progress and Approved – so we're going to have to make some changes to our workflow.

We can do this in two ways

using the visual editing tool editing
.

Editing using

Workflow Builder

workflow builder visual editor

From the page tools menu

,

  • choose Edit with workflow builder

:
Image Removed
Image Added

You'll see the workflow builder visual editor appear, like this

:

.

Image Added

Image Removed

As you can see, there
Info

There are two states – In Progress and Approved – in the flowchart in workflow builder.

The arrow lines between them are transitions, which allow you to select a state to transition to from the current state in the workflow popup. We'll learn about those in the next lesson.

Inspect the states using workflow builder

While we're here, we might as well test out the workflow builder.

Choose the Approved state in the flowchart – you'll see a sidebar appear with some information about it.

Image Removed
Image Added

You can edit the state name and some of the ways it will behave. Here we can see that the Approved state will allow tasks to be added by users - it is taskable.

We

In configuring the workflow Approved state, you can also

:

  • choose the states the Approved state can move to

.
Info

This also allows us to select the types of transition, for example, the transition may occur on a particular day set by an added expiry date.

  • add one or more content reviews to the state

  • add specific tasks to the state so the workflow will add these

.
  • on transition into the state

As we progress through the lessons, you'll see the main flowchart change and more information will appear in the sidebar when you examine a state.

Edit the states using workflow builder

Hover over the Approved state name and choose the pencil tool.

Image Removed
Image Added


Edit the Approved state:

  • change the Approved name to Published as in the workflow we are creating.

  • check the Final checkbox to make the state our final or published workflow state.

Image Removed
Image Added


When you choose a state to be a final state, the identifying color for the

state will change

selected final state, by default, changes to green.

Make sure

Ensure you select Apply to add these changes to your workflow.

The changes you have made are displayed in the visual flowchart in the workflow builder.

Image Removed
Image Added


Use workflow builder to complete the first stage of creating your new workflow

:

  • choose the pencil tool for the In Progress state and change the state name to Editing.

Image Removed
  • Image Added
  • choose + Add state and add a third state named Review.

Image Removed
  • Image Added
  • choose the workflow name Custom States Workflow and change the name to Content Production Process

.

Image Removed
  • Image Added

Your new workflow will be displayed in workflow builder.

Image Removed
Image Added

Make sure you don't lose all these edits to the workflow so far by choosing Save to update the workflow in workflow builder.

To keep your updates and apply these to the page you will need to:

  • choose Save to update your workflow.

  • choose Exit to add the updated workflow to your page.

Tip

You can now test your workflow on the page.

Editing markup
Anchor
tryeditinmarkup
tryeditinmarkup

You can also choose to edit the workflow using the markup editor.

To edit a workflow, choose the Edit with Markup from the page action menu:

Image Removed
Image Added

Or choose the markup icon in the right panel of the workflow builder. This is the "{ }" symbol

Image AddedImage Removed
Info

Both do the same thing - open the markup editor.

In the markup editing window, you'll see the macros that define the workflow, something like this:

Code Block
languagetext
themeRDark
{workflow:name=Custom states workflow}
   {state:In Progress|taskable=true}
   {state}
   {state:Approved|taskable=true}
   {state}
{workflow}

What you're looking at is macro

 notation –

 markup notation – the language of workflows in Comala Document Management.

It should be easy to see what's going on here:

  • there's the workflow, named Custom states workflow

and,
  • inside that workflow, there are two states

 –
    • In Progress and Approved

  • each of the states is taskable

, meaning that

So, let's edit the markup to get our three desired states: Editing, Review, and Published

You should end up with this in the markup window:

Code Block
languagetext
theme
RDark
{workflow:name=Simple Content Production Process}
   {state:Editing|taskable=true}
   {state}
   {state:Review|taskable=true}
   {state}
   {state:Published|final=true|taskable=true}
   {state}
{workflow}

Choose

  • the Save button to save your changes

.
Then choose
  • then Exit to add the edited workflow to your content

.

Now test your workflow.

Test it
Anchor
testmyworkflow
testmyworkflow

You may notice that the workflow status bar shows either Image Modified In Progress or  Image ModifiedApproved.

That's because those states no longer exist in the

workfow

workflow, so it has become confused (hence the grey circle).

Info

When it is in this confused situation, the workflow won't guess at which state it should be in.

To fix that confused state, open the workflow popup and you'll be able to select a state

:

.

Choose
  • choose the Editing state from the list, and then choose Submit

Image Added
Info

You should now

see  

see Editing in the workflow status bar

 with

byline on the page with an orange state indicator circle.

Image Removed

Test out the new workflow, and when you're ready to move on to the next lesson

:

.

On the page, the workflow popup in this example for the current state allows you select any other state to transition to.

This is because we have not added any transitions from any of the states and the default anystate transition allows a user to choose ‘any other state’ in the workflow as the destination state.

We need to constrain our workflow process routes from one state to another by adding transitions.