Expand my Community achievements bar.

SOLVED

How to start a workflow on publish instance with a workflow launcher?

Avatar

Level 2

What I want to do is a workflow for approval of Events in a Calendar created on publish instance by our users. So, there is a calendar. Some user adds new event there. I want the event not to appear in the calendar immediately, but only after admin approval. How I want to achieve it:

1) Create a workflow which starts on AddEvent event. This workflow: reverse-replicates the event (now we have this event on author), deactivates page (now we don't have this event on publish), waits for admin approval. If positive ->activates page (now we have this event on publish again). 

2) Create a workflow launcher which launches the workflow on AddEvent event on publish.

The problem which I face is that my workflow doesn't start when I create an Event on publish instance. It starts without any problems on author instance though.

question 1: is it possible to approve user-generated content using above listed workflow?

question 2: how to make my workflow start when event was created on publish instance? Should I create the workflow on publish or on author? Should I replicate it? Should I replicate the launcher of this workflow?

 

Update: actually, I am not able to launch any workflow with a launcher on publish instance. I have no messages in log about the workflow. But I can see the workflow I am trying to start both on author and publish instances here /libs/cq/workflow/content/console.html. Also I see the launcher both on author and publish instances. Both of the launchers have runmode publish&author.

1 Accepted Solution

Avatar

Correct answer by
Level 9

Hi,

There are couple of things that you have to confirm before launch the workflow on publish environment

1. After creating the model and launcher in Author server you have to publish them to publish instance from

http://<host>:<port>/miscadmin#/etc/workflow

    a. Go to "model" and "launcher" folder and publish them respectively.

so that the same workflow will exist on publish environment.

2. Now trigger the event on publish server

If you still not able to see, i suggest you to first try with very simple workflow let say modification on page (just create model/launcher publish them and then modify a page and republish them, you see a running instance on publish node)

I think you have chosen second option to implement the workflow in that case you also have to figure out where and how the changes are flowing (same i mentioned in my earlier mail as the replication floats from /var/replication/outbox from publish instance - just check that too)

 

Thanks,

Pawan 

View solution in original post

4 Replies

Avatar

Level 9

Hi,

Your first option of doing replication of content is correct because 

1. Managing user generated content is easy and handles by replication agents OOTB

2. You can easily write a simple workflow to activate those content from author (you only have to careful when you have clustered environment)

Now to answer the question about triggering workflow on publish is possible. While configuring the launcher in "Run Modes" you have to select the "Publish" as run mode value. But you may face other challenges with this approach

1. Tracking the user generated content because by default it goes to replication outbox which is /var/replication/outbox

2. Managing the user generated content and its default flow to author

As far as its user generated content better to manage it with your first option so that your author and publish will always be in sync and straight forward.

Let me know for more information.

Thanks,

Pawan

Avatar

Level 2

Hi Pawan,

Thank you for you response. I have created a workflow launcher with runmode "Publish". But the problem is it doesn't work. The workflow doesn't start. 

Do you have any ideas what could be the problem? There are no errors in the log.

When I use runmode author, it works. But that's not what I need.

Thanks

Ievgen

Avatar

Correct answer by
Level 9

Hi,

There are couple of things that you have to confirm before launch the workflow on publish environment

1. After creating the model and launcher in Author server you have to publish them to publish instance from

http://<host>:<port>/miscadmin#/etc/workflow

    a. Go to "model" and "launcher" folder and publish them respectively.

so that the same workflow will exist on publish environment.

2. Now trigger the event on publish server

If you still not able to see, i suggest you to first try with very simple workflow let say modification on page (just create model/launcher publish them and then modify a page and republish them, you see a running instance on publish node)

I think you have chosen second option to implement the workflow in that case you also have to figure out where and how the changes are flowing (same i mentioned in my earlier mail as the replication floats from /var/replication/outbox from publish instance - just check that too)

 

Thanks,

Pawan 

Avatar

Level 2

Hi,

Sorry for the confusion, I didn't make myself clear, there are no two options:) There are just two steps: first - create workflow, second - create launcher.

Now my workflow works. It was just my mistake. I was not sure if I should create the launcher on publish or author environment. Now I realized that for my purpose I had to create two worflows+two launchers.

 

Worflow 1, publish

Action: reverse replication of events. Runmode: publish

 

Workflow 2, author

Action: custom workflow which - undoes reverse replication, waits for moderation. If moderation is successful, replicate data.

Runmode: author

Thanks,

Ievgen