Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Workflow that spans author and publish

Avatar

Level 2

On docs.adobe.com there is a forms based workflow sample (https://docs.adobe.com/docs/en/aem/6-0/develop/extending/workflows/wf-models.html).
What would have one to do if the workflow gets kicked on the Publish instance, will then continue on the Author environment and update the page finally on the publish instance.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

You can have either Servlet or Workflow on Publisher, still you will need to do the following:

  1. Reverse Replicate the content with a custom property set
    • This custom property should be the identifier that the node has been reverse replicated from Publisher to Author.
  2. Have an event listener to listen to node events on Author and see if the listener has got triggered because of node modification having the custom prop as set in step 1.
    1. Remove the prop from the node so as not to get the event from re-triggering when node goes under some modification.
    2. Next step in the same listener can be programmatically triggering the workflow that you wish to trigger on author.

Don't miss out on step 2.1 else the workflow will keep triggering whenever the node with custom prop goes under some sort of modification.

Hope it helps

- Runal

View solution in original post

6 Replies

Avatar

Level 10

Typically when you create a workflow model - its on Author. See:

http://docs.adobe.com/docs/en/cq/5-6-1/workflows/create-models.html

I  have not seen any documentation or anything to suggest that a process can work across Author and Publish AEM instances. I have asked Eng to look at this thread to confirm.  

Avatar

Level 3

what is your use case? I am not sure if one workflow can run on two instances - most probably no. but if you are looking to get some kind of feedback from one instance to another; that can be achieved. e.g. you can have a servlet on author instance that does what you want, then have a workflow on publish that makes a call to this servlet and continues further on publish.

Avatar

Level 10

As suspected - eng stated:

You cannot use a single workflow across Pub and Auth. It wouldn’t be one workflow, it would be different workflows running on author and publish…  It would use replication and reverse replication and then have launchers setup to notice the content that has been replicated, and start a new workflow on the publish/author to finish it.  

By the way - it is recommended that you watch this Workflow session of Ask the AEM Communtiy Experts - see the link in the table summary at start:

https://helpx.adobe.com/experience-manager/using/Workflows.html

 

Hope this helps....

Avatar

Level 2

Thanks - summarizing it may be a little bit too complex thing to have two workflows. I think the idea to have a servlet that gets triggered from the publish instance and just kicks off a workflow would be the most straightforward approach. By the way what I had in mind is a scenario where a user should be serviced in different ways i.e. when opening an account, when requesting materials or subscribing to content. The idea is that this is monitored and that the service staff of a company is able to kick of an approval process which ends with a changed user status which will in the end influence what pages and components will be visible to him depending on the status her reached. So a generic servlet which passes action parameters would be ideal to my impression and the workflow could react to it and e.g. send updated profile information (containing the achieved status) to the publish instance. These properties would then be read by the components or would trigger a acl change workflow task to provide access to more pages on the instance. Understood? Makes sense?

Avatar

Correct answer by
Community Advisor

You can have either Servlet or Workflow on Publisher, still you will need to do the following:

  1. Reverse Replicate the content with a custom property set
    • This custom property should be the identifier that the node has been reverse replicated from Publisher to Author.
  2. Have an event listener to listen to node events on Author and see if the listener has got triggered because of node modification having the custom prop as set in step 1.
    1. Remove the prop from the node so as not to get the event from re-triggering when node goes under some modification.
    2. Next step in the same listener can be programmatically triggering the workflow that you wish to trigger on author.

Don't miss out on step 2.1 else the workflow will keep triggering whenever the node with custom prop goes under some sort of modification.

Hope it helps

- Runal

Avatar

Level 2

Thanks! Updating the property will be a requirement in this workflow cause the user will trigger different actions in the customer livecycle and the workflow has to be started again then. In fact the property set to a new value will be the indicator so the workflow would have to take care of checking if the node has just changed and stop or if the change was the result of the servlet action and run it again.