Expand my Community achievements bar.

SOLVED

File upload option as part of "Dialog participant step" dialog

Avatar

Level 2

Hi Team,

We are trying to develop a workflow for page activation where user can have option to select values from multi-select and file upload field at the time of triggering the workflow.

Purpose of Multi-select and File upload:
1)Multi-select options is fixed list of items describing type of change. i.e. change in header, footer, body, experience fragment or particular component etc.,
2)File upload - author will attach mail item which contains approval for doing this particular activation.

In this page(https://stackoverflow.com/questions/59987056/aem-workflow-custom-input-data) - we found that custom fields(multi-select and file upload) can be added as part of "Dialog Participant Step" and keep this as first step of the workflow.

We are able to see multi-select value getting saved at the node(/var/workflow/instances/server0/2020-10-15_1/test-wf-model_8/history/1602768572342/workItem/metaData) but file upload is not happening and thus the property is not getting saved at this node.

We have tried (granite/ui/components/coral/foundation/form/fileupload) and (cq/gui/components/authoring/dialog/fileupload) as resourceType for fileupload. But it is not working.

Please let us know how can we upload an email attachment as part of dialog participant step.

NOTE : Values from multi-select is getting saved but file uploaded using file upload option is failing. 


Dialog details about file upload fields:

<oldfile
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/fileupload"
fieldLabel="File Upload"
name="./oldfile"/>
<file
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/authoring/dialog/fileupload"
autoStart="{Boolean}false"
class="cq-droptarget"
fileNameParameter="./fileName"
fileReferenceParameter="./fileReference"
multiple="{Boolean}false"
name="./file"
title="Upload Image Asset"
uploadUrl="${suffix.path}"
useHTML5="{Boolean}true"/>

 

1 Accepted Solution

Avatar

Correct answer by
Level 4

1. Create a component which has file upload field. You can write all your logic here on what to do with uploaded file.

2. Create a dialog. Create a node items node. sling:resourceType for this node will be the path of component that you created in step 1

3. Create a dialog participant step. In the dialog, give the path of the dialog created in step 2.

Capture.PNG

View solution in original post

5 Replies

Avatar

Community Advisor

Hi @prathik-sm 

 

Which version of AEM are you using?

Can you try without coral /libs/granite/ui/components/foundation/form/fileupload

Workflow step ref: https://helpx.adobe.com/in/experience-manager/6-2/sites/developing/using/wf-step-ref.html

 

Regards,

Santosh

 

Avatar

Correct answer by
Level 4

1. Create a component which has file upload field. You can write all your logic here on what to do with uploaded file.

2. Create a dialog. Create a node items node. sling:resourceType for this node will be the path of component that you created in step 1

3. Create a dialog participant step. In the dialog, give the path of the dialog created in step 2.

Capture.PNG

Avatar

Administrator
Wonderful and verbose reply. Thanks a lot for sharing this.


Kautuk Sahni

Avatar

Level 2
The query has been misinterpreted. We have used the component which has file upload field and configured dialog path in dialog participant step. This didn't work - so created custom dialog - Even there field upload field was not working but other fields like text and dropdown was working. i.e. value entered in the dialog for text and dropdown was saving on the node but not for file upload. Adobe has accepted this as product defect and is working on it(reference number : CQ-4307716). Will post the fix once Adobe provides the package.