This site has moved to the integrated Appfire documentation and information site for our apps.

From February 2024 this site is no longer updated.

Take a look here! If you have any questions please email support@appfire.com

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 7 Next »

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

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 workflow builder

  • editing markup in the markup editor.

Editing using Workflow Builder

From the page tools menu, choose Edit with workflow builder:

You'll see the workflow builder 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 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.

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.
    You can now test your workflow on the 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

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:

{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

    • meaning that users can 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 choose 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 workfow, so it has become confused (hence the grey circle).

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 the Editing state from the list, and then choose Submit

You should now see Editing in the workflow status bar with an orange state indicator circle.

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

On the page, the workflow popup 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 transition allows a user to choose ‘any other state’ in the workflow.

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




  • No labels