Skip to content

Posts tagged ‘Tutorial’


CQ Workflow Tutorial: Export Workflow Models Quickly

Update (5/17/2013):

There is a bug in the script when there are more than 10 files. This part will fix it:

# Do not change any of these
for f in $FILES
    echo File Name: $f
    NTEMP=`echo ${FILE##*-}|cut -d . -f1`
    echo NTEMP: $NTEMP
    if [ "$NTEMP" -gt "$INDEX" ];

So far I did not discuss how to manage the project even though if you look at the final project files I posted at the end of the Post you will see that it contains the Workflow Models as well.
In General I always keep the Workflow Models in my VCS (often my personal GIT as well as the Client’s VCS) just to make sure I have a track record of all the changes and can see how it evolves over time but also to have a way to easily undo a problematic current version. Because Workflow Models can only be edited inside the CQ Workflow Model Editor we need to find a way to export them quickly, easily and fast otherwise we might loose changes. That said I never to export the workflows directly into the VCS but rather export them into a temporary folder and then use a DIFF tool like Delta Walker for the Mac to move them over even if I just copy them without ever merging. Read more »


CQ Workflow Tutorial: Extending CQ Workflows with Workflow Porcess

There are a few useful Workflow Steps available that enables you create nice Workflow Models. That said many features are not provided or are implemented badly. This is a list of features that are missing out of the box:

  • Logging of the Payload, Meta Data etc
  • Replication using a Particular Replication Agent
  • Sending Email Notifications using a Particular Template
  • Conditional Jumps
  • etc

When building a CQ Workflow Models you are adding / configuring Steps which you select on the Sidekick:

Process Step Select Step In Sidekick

Read more »


CQ Workflow Tutorial

Last weekend I started to write down some articles about CQ’s Workflows. Initially I thought this will be composed of a few articles and that’s it. But then I remembered what I learned about Workflows since last year and even today I am still learning how CQ Workflow works and how to tweak them to make them do what I want / need them to do.

As of now I am thinking that I need to move these articles into a series of pages so that it will remain intact and in order of the Tutorial. This way it will be easier for readers to follow.

So what do I plan to add to the tutorial? This is a short list of what I plan to do in the future but I am pretty sure there will be more:

  • Workflow Process and how to add custom functionality
  • Workflow Step Dialogs to make Workflow Processes easier to use
  • Dialog Participant Step Revision 3: how to use the selected data
  • Making Workflows more Transparent with Logging
  • (Conditional) Jumps inside a Workflow
  • Workflow Vows and how to Handle Them
  • Workflow Process / OSGi Service Configuration with Rumodes
  • Where did my Comments Go?

There is way more but I am not sure how many readers will actually use them so we will see.

Cheers – Andy


CQ Workflow Tutorial: Basic Project Setup

As already mentioned in the previous article developing CQ Workflows is not easy due to many parts that need to play together and because most of the action is happening behind the scene. Therefore it will be time-consuming and frustrating from time to time. There are a few things that I learned over the past year and a half that will make your life easier. One of the most important tips to consider is to clamped down on the number of moving parts and to be able to review and undo changes if necessary. That is why I have all code and configuration related to a CQ Workflow inside a VCS tool and use Maven to install the Workflows in CQ.

Attention: Even though I use a VCS tool and Maven to manage a Workflow the actual Workflow Model is edited inside CQ Workflow Model Editor. I tried to edit workflows within a Code Editor (IntelliJ IDEA) but beside simple changes in text properties I failed to make it work. The Workflow Model Editor will not bring up the Model if there is a slight inconsistency and so you might loose your work.

Creating a Workflow Models

As said above you cannot edit Workflow Models by hand. This means you need to open the Workflow Model inside the Workflow Editor by double-clicking on the Workflow Model and then change the Model in its Editor. Now this is a problem if you have the Workflow in VCS because when you would reinstall the Workflow Model you would loose your changes. This is my process on how to edit Workflows inside CQ and still keep the golden copy in a VCS:

  1. Create a Workflow inside the Workflow Editor by clicking on the New button. Give it a Title (displayed name). Here we use Basic Workflow

CQ Workflow Tutorial Basic Create Workflow

Read more »