Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

AEM Workflow to return multiple groups and users in a Participant Step Chooser

Avatar

Level 2

Hi,

 

We need to initiate a custom workflow whenever a CF is created or edited. This workflow must undergo review by multiple teams (T1, T2, etc.) before proceeding to approval.

Team T2 has several subgroups (T21, T22, etc.), and when T1 starts the workflow, the T2 groups should be loaded, allowing the selection of either T21 or T22..

Once a subgroup is chosen, the users within that group should be displayed, enabling the initiator to select multiple users for the review process.

 

However, the documentation for ParticipantStepChooser suggests that only individual users or groups can be selected. We are using AEM 6.5.

 

Any help is greatly appreciated.

 

Thanks,

Divya

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

You can't do that. The recommended approach in this situation is to combine multiple users or groups into a super group and then use that super group as a wrapper. This way you use the ootb workflow steps (dynamic step or participant step). 



Esteban Bustamante

View solution in original post

7 Replies

Avatar

Community Advisor

Hi,

 

I recommend using a DialogStep[1] to dynamically present and select the approver-based on your groups. You could implement some JavaScript to load the dropdown dynamically[3]. After that, utilize a DynamicParticipantStep[2] to capture the group or user that the workflow initiator selects from the DialogStep.

 

Here are some resources to help you build this:

[1] https://jpsoares.medium.com/developing-a-custom-workflow-dialog-in-aem-f77219ac96e3

[2] https://medium.com/@toimrank/aem-dynamic-participant-step-1cd58e15f28

[3]. https://medium.com/@arunpatidar26/dynamic-dropdown-in-aem-touch-ui-cc502022da24 

https://medium.com/@toimrank/aem-workflow-2f238742ab4f 

 

Hope this helps

 



 



Esteban Bustamante

Avatar

Level 2

Hi @EstebanBustamante ,

 

I can load groups and users dynamically, but I need to allow multiple users to be selected for content review. Using either the Dynamic Participant step or the Participant step only lets us select one user at a time.

How can I send content review to multiple users?

 

Thanks,

Divya T

Avatar

Correct answer by
Community Advisor

You can't do that. The recommended approach in this situation is to combine multiple users or groups into a super group and then use that super group as a wrapper. This way you use the ootb workflow steps (dynamic step or participant step). 



Esteban Bustamante

Avatar

Level 2

I implemented a dynamic dropdown as described in the article at https://medium.com/@arunpatidar26/dynamic-dropdown-in-aem-touch-ui-cc502022da24 and modified the JavaScript code to allow for selecting multiple values in the dropdown. I aimed to store these selected values as a comma-separated string in a field under the workflow, since using String[] is not permitted.

However, while the values are correctly appending and I can verify this in the console during debugging, the property is not being saved when multiple dropdown values are selected under workflow history.

 

Is there anything I am missing here?

@arunpatidar @EstebanBustamante 

 

Avatar

Community Advisor

Hi @Divya_T13 
Can you share post call payload which are sent when you save the dialog?



Arun Patidar

Avatar

Level 2

Hi @arunpatidar 

As a workaround, I added a text field and filled it with the selected dropdown values as a comma-separated string, which is then saved in the workflow history.

 

Thank you @EstebanBustamante @arunpatidar for all your inputs and help.

 

Thanks,

Divya