Highlighted

[Q&A | February 2018] Ask the AEM Community Expert: Working with AEM Workflows and Workflow API's

Avatar

Avatar

kautuk_sahni

Community Manager

Total Posts

5.5K

Likes

955

Correct Answer

1.1K

Avatar

kautuk_sahni

Community Manager

Total Posts

5.5K

Likes

955

Correct Answer

1.1K
kautuk_sahni
Community Manager

27-02-2018

qa.jpg

Hi Community

Please find below the Questions asked in Ask the AEM Community Experts for Feb 2018

Recording of the session: http://bit.ly/ATACE218

Answered Questions

----------------------------

1. rahul: How to pass a string from a WorkflowSession back to a SlingServlet?

* AEM Workflow Engineering(privately): Hi Rahul, can you clarify your use case here?  We don't quite understand the question.

2. rahul: I have facility in my AEM code to import an comma-delimited file and turn that into pages (cq:page type) within AEM. The flow goes like this: browser => AJAX call => SlingServlet => Workflow => SlingServer => browser I want to pass a string from the Workflow back to my SlingServlet.

* Will McGauley: Hi Rahul.  If I understand correctly you are hoping to capture the result of executing the workflow in the servlet that started the workflow.  In order for this to work the workflow would need to be executed synchronously, but that won't work with the AEM workflow engine because all workflows are executed asynchronously.  In order to make this work the sling servlet (or UI) would need to poll for the workflow to be complete, or poll for some change that the workflow is expected to make in the repository.

I hope this answers the question.

3. munu: Can the custom Publish workflow be invoked on a page, while clicking Activation button?

* AEM Workflow Engineering(privately): Hi Munu.  This would require customization. There is a very detailed information here if you would like more information https://forums.adobe.com/thread/2322825

4. Guillaume Clement - AFTIA: @Will McGauley Is this also true for workflows that are not transient? I believe the API to start a workflow returns a Workflow object that contains a status flag. Perhaps the object only reads from the workflow instances in the current state and does not maintain a relative state?

* Will McGauley: This is also the same for transient workflows - when you start a transient workflow the workflow is still processed asynchronously (a sling job is created when you start the workflow and the workflow is executed when that job is processed).

The main difference between a transient workflow and non-transient workflow is that there will be no history stored for the transient workflow.  So for this use-case it would not be possible to poll for the completion of the workflow instance to get results from the workflow execution, instead it would be better to look for some status on the payload itself.

5. Shubha Kirani: Problem with this workflow, it piles up under adminb workflow

* Zyg: @Shubha Kirani  Can you please clarify.  What is the workflow and what does piling up mean?

6. Shakil Ahmed: How can we ensure that same user cant publish own contents? ie is author is also member of publisher group?

* Will McGauley: Although we are workflow experts we are not sites experts but I will try to answer your question as best as I can.  I would expect that the best way to handle this would be for that user to not be in the publisher group.  I am not aware of any functionality that prevents a user from publishing their own edits without an approval step.  It might be worth contacting support with your feature request as it sounds interesting.

7. Jae Jeon: What are some of the necessary changes that needs to be made when creating your own workflow for models like "Request for Activation"?

* Will McGauley: Hi Jae - I think this is covered in depth in this forum conversation have a look!  https://forums.adobe.com/thread/2322825

8. (Deleted) Shubha Kirani: In our space, admin should not approve content activation. We have 100+ sites and each site has diff approver group. To address this we have create 100 diff workflows. But 'Request for Activation' gets kicked off when they click 'Activate Page' from sidekick. Workflow instance piles up under admin. Manually cleaning up frequently.

* Flo Wandeler: Shubha Kirani You could use a Dynamic Participant Step for your approver, and pick the approver group based on the workflow payload to pick the correct approver group. This way you only need one workflow model. Have a look at https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/workflows-customizing-extendin... 'Developing Participant Choosers'

9. Benny | Axis41: The workflow could save status under /etc/reports in the JCR which could be viewed  by another browser window as a custom report ....

* AEM Workflow Engineering(privately): Hi Benny, lost the context of this . Not clear if there is a question here, or a comment.

10. Yang Li: Is it possible to schedule a configMgr change via a workflow? The reason why I am asking this is because we have some config changes that have to be alive only from a specific date at midnight. If there's such schedule feature then we can save our deployment team from staying up late.

* AEM Workflow Engineering: You can use a participant step with a timeout that expires at a certain time, and run the workflow.  When the timeout expires, it will move on to the next step in the workflow, which would be custom step to write your changes.  You can look at scheduled activation workflow that is OOTB for example

11. Sumit: How to customise the ootb workflows like DAM Update ?

* Will McGauley: Hi Sumit -

The good news is there are improvements to this exact use-case coming in AEM 6.4!  The UI will help you override models and launchers.

In the meantime the recommended approach is to copy the relevant workflows and launchers that you wish to modify to create your own version that you can modify.  This is probably best handled with CRX/DE

12. Shubha Kirani: Sorry Zyg. 'Request for Activation' instances pile up under admin queue ad authors do not have replication access and authors click 'Activate Page' on sidekick all the time. There is no easy way to hide menu on sidekick. How do I avoid this pile up.

* Will McGauley: Hi Shubha - are you saying you want the activate page option to be removed when there is  a pending request for activation?  Sorry if I'm not answering the question you are asking

13. Anudeep Noble: What happens to the workflows when we migrate from AEM 6.1 SP2 to AEM 6.3 ?

* AEM Workflow Engineering: For custom workflows you've created, there will be no change.  For workflows that are OOTB and have been modified, you will need to restore your changes after upgrade.  This is the reason it is recommended to "copy" OOTB workflows and modify them rather than customizing the OOTB workflows, so they do not get overridden.  Note: Improvements in this area are coming in AEM 6.4

14. Guillaume Clement - AFTIA: Can/Have transient workflows been used successfully in large volume workflows, i.e. batch processing? Seems as though standard workflows will either polute the JCR with metadata (also reducing performance), or in the case of transient workflows, make monitoring of workflow completion cumbersome.

* Will McGauley: Hi Guillaume -

yes we recommend using the transient option on workflows such as DAM Update Asset which run in high volume in order to reduce the number of writes to the repository.  At this time the best place to monitor the progress of the transient workflow activity is from the sling event page in the OSGI System Console

15. Shipra: Is it possible to trigger the same workflow on same page which is already subjected to workflow? In touch ui we are able to trigger n number of workflows, n number of times on same page but in classic UI when we try to trigger the workflow on a page which is already subjected workflow we are getting alert box like page is  subjected  to a workflow. Is this the bug from adobe or something else?

* Will McGauley: Hi Shipra -

The workflow engine does not restrict running workflow instances simultaneously with the same model and payload.  The Sites component has typically enforced this restriction - if there is a difference between the classic UI and touch UI I would contact support, sounds like either a bug or a change in how the feature is implemented.

16. Nicki Tatalovich: With multiple projects running on the same AEM instance, How do you recommend handling the Dam Update Asset workflow when you need to add custom steps to it so those steps will only run for a specific project?

* AEM Workflow Engineering: It depends on how your DAM is structured, and how many different "projects you are referring to.  You could update your launchers to leverage different WF depending on the path in DAM, or if there is alot of projects, you could have OR/AND splits to deal with different use case requirements inside the DAM Update Asset workflow

17. Jae Jeon: I noticed that some of the features on AEM workflows only work when it is named in a specific way. How can I have my custom workflow trigger those? Or do I have to customize every file?

* Zyg: @Jae Jeon  Can you clarify what you are trying to do?  What things have to be named in specific way?

18. roumen: is this demo in AEM 6.3 or 6.4?

* Will McGauley: Hi Roumen -

This is a 6.3 demo, none of the upcoming 6.4 changes are being shown or discussed here.  This might be a good reason to hold another session once AEM 6.4 is go live!

thanks

19. Nicki Tatalovich: I’ve made a copy of the original workflow and modified it for that project and update the launchers but that means that I have to update the launcher for the DAM Update Asset workflow as well and for each of the projects which makes it hard to perform automated deployment of a project because each project then requires knowledge about all the other projects that are running on the system in order to set the globbing expression correctly. Any thoughts on this?

* Will McGauley: Hi Nicki - If you have many different projects with different requirements it may be too cumbersome to have multiple launchers that react correctly from the Glob.  I wonder if it would be possible to have one master DAM Update Asset workflow that is run for all projects, but have individual steps coded in a way where they are aware of which types of payloads they should operate on.  This could be configurable with OSGI configuration or Process Step Parameters.  This of course is just an idea, there are many ways to solve this problem, but it really comes down to what is the easiest for you to implement and manage.

20. Jae Jeon: For example, the default scheduled publish shows a countdown to publish on the touch UI view. If I create my own scheduled publish workflow, it doesn't show it anymore.

* Zyg: I'm not familiar with how the scheduled publish is implemented.  Not sure what it queries or other sheme it uses to get the countdown time.

21. John: can we have access the recorded session or this presentation material ?

* Will McGauley: Hi John.  The recording and presentation material will be made available later today in the communities page.

22. Shipra: is it possible to push the launcher configuration instead of configuring it on the instance?

* Zyg: You can create a package with the configuration that you can install.