Lesson 2 - States
Overview
Concepts: templates, macros, states
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...
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
edit the workflow markup in the markup editor
Editing using workflow builder visual editor
From the page tools menu
choose Edit with workflow builder
You'll see the workflow builder visual editor appear, like this.
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.
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.
In configuring the workflow Approved state, you can also
choose the states the Approved state can move to
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.
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.
When you choose a state to be a final state, the identifying color for the selected final state, by default, changes to green.
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.
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.
choose + Add state and add a third state named Review.
choose the workflow name Custom States Workflow and change the name to Content Production Process
Your new workflow will be displayed 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.
Editing markup
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:
Or choose the markup icon in the right panel of the workflow builder. This is the "{ }" symbol
In the markup editing window, you'll see the macros that define the workflow, something like this:
{workflow:name=Custom states workflow}
{state:In Progress|taskable=true}
{state}
{state:Approved|taskable=true}
{state}
{workflow}
What you're looking at is macro 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
inside that workflow, there are two states
In Progress and Approved
each of the states is taskable
users can manually create a task if the workflow is in one of those states
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:
{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 Exit to add the edited workflow to your content
Now test your workflow.
Test it
You may notice that the workflow status bar shows either In Progress or Approved.
That's because those states no longer exist in the workflow, so it has become confused (hence the grey circle).
To fix that confused state, open the workflow popup and you'll be able to select a state.
choose the Editing state from the list, and then choose Submit
Test out the new workflow, and when you're ready to move on to the next lesson.