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

How to add dynamic values to CQ5 Workflow Dialog

Avatar

Level 3

Hi All,

I have created one custom workflow dialog by using xtype "multifield", but I have to setup dynamic values to the widget before dialog activate, i am making ajax call through listeners and getting values but, not able to set the values to the field. When i try to add with listeners the field object is coming but the setvalue() and getValue() methods are not working.

And I am not able to getting the dialog path i tried "dialog.responseScope.path" but the value is coming as "undefined".

I tried with the loadcontent and beforeshow listeners but these are not calling only beforerender listener is working.

1. How to set the values to workflow custom dialog field

2. How to get the payload path in the workflow custom dialog

I am using AEM5.6.1

could you please help me, how to proceed.

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 10
You can watch the work flow webinair  by viewing the article in my first reply. Open the article. The link to the webinair is in the article summary at the beginning.        

View solution in original post

6 Replies

Avatar

Level 10

A dialog for a workflow step is similiar to a dialog for a component. They both use xtypes that can be used in code.  You can set the values during design time and read values that were entered into the dialog fields during run-time.

Consider this dialog:

[img]DialogVals.png[/img]

You can read values using a custom workflow step implemented as Java. For example - to read these fields - you use this code:

public void execute(WorkItem item, WorkflowSession session, MetaDataMap args) throws WorkflowException {
        String singleValue = args.get("argSingle", "not set"); // read text field
        String[] multiValue = args.get("argMulti", new String[]{"not set"}); //get multifields values

Read this commuty article - it will walk you through creating a custom dialog for a workflow step and how to get values. It also covers how to setup the dialog using JCR nodes, map it to a custom workflow step and use it in a custom step:

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

Also - watch this Workflow webinar that covers Workflow concepts such as how to pass data from 1 step to another, and other workflow concepts:

https://helpx.adobe.com/experience-manager/using/Workflows.html (see the link in the table at the start of the article).

Avatar

Level 10
Have you tried writing a custom xtype and reference that xtype from your dialog used in the work flow.  To me, this requirement sounds like it will require you to code using the AEM widget api . You will have to update the author list at run time.      

Avatar

Correct answer by
Level 10
You can watch the work flow webinair  by viewing the article in my first reply. Open the article. The link to the webinair is in the article summary at the beginning.        

Avatar

Level 3

Thanks smacdonald2008  for your reply.

Actually my requirement is, I have a page, in my page i have one component called "page-authors" and in the component i am adding some authors.These authors list is not same for all pages. In my workflow i have to show " page authors which are stored in page-authors component for particular page"  to the workflow owner in the page and he wants the feature like add and remove authors. I am using Initiator Dialog Step for this and giving the custom dialog path to "Dialog path" field. The dialog is displaying but i have to add the authors to this before it render.

And i want to enable or disable the dialog based on some condition, How to add property to the multifield widget, based on the condition.I think the multifield xtype have the property to disable , but how to set the property in the dialog.

One more question, If the workflow dialog and normal dialog works as same , why the listeners like loadcontent and beforeshow not working in the workflow dialog which are working for normal component dialog.

It's urgent, please help me to achieve this.

How to access the Workflow webinar video?

Thanks

Avatar

Level 3

Thanks smacdonald2008  for your reply.

Actually my requirement is, I have a page, in my page i have one component called "page-authors" and in the component i am adding some authors.These authors list is not same for all pages. In my workflow i have to show " page authors which are stored in page-authors component for particular page"  to the workflow owner in the page and he wants the feature like add and remove authors. I am using Initiator Dialog Step for this and giving the custom dialog path to "Dialog path" field. The dialog is displaying but i have to add the authors to this before it render.

And i want to enable or disable the dialog based on some condition, How to add property to the multifield widget, based on the condition.I think the multifield xtype have the property to disable , but how to set the property in the dialog.

One more question, If the workflow dialog and normal dialog works as same , why the listeners like loadcontent and beforeshow not working in the workflow dialog which are working for normal component dialog.

It's urgent, please help me to achieve this.

How to access the Workflow webinar video?

Thanks

Avatar

Level 3

No, I haven't tried any custom xtype, am using multifield xtype only.

But if i create a custom xtype how to set the author values at run time, We can't show them as drop down. we have them individually similar to  multifield.

Thanks