Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Dialog Paticipant Step doesn't store dialog data

Avatar

Level 2

I need to do that an user can choose between two options in a workflow, I was thinking in use a selection field in a dialog participant step. But I did some test...

I was trying to do it using dialog participant step. -> https://docs.adobe.com/docs/en/aem/6-3/develop/extending/workflows/step-ref.html#Dialog Participant Step

I’m trying to follow the adobe documentation example but is not working.

I did a dialog under /etc/workflow/dialogs

<?xml version="1.0" encoding="UTF-8"?>
<
jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:unstructured"
jcr:title="Test"
sling:resourceType="cq/gui/components/authoring/dialog"
width="50rem"
height="30rem">
<content
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/container">
<layout
jcr:primaryType="nt:unstructured"
 
margin="false"
 
sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"
/>
<items
jcr:primaryType="nt:unstructured">
<column
jcr:primaryType="nt:unstructured"
 
sling:resourceType="granite/ui/components/foundation/container">
  <items
jcr:primaryType="nt:unstructured">
  <title
jcr:primaryType="nt:unstructured"
 
fieldLabel="Notification Email Address"
 
name="./jcr:content/watchEmails"
 
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
 
/>
  <title2
jcr:primaryType="nt:unstructured"
 
fieldLabel="Notification Email Address"
 
name="watchEmails"
 
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
 
/>
  </items>
</column>
</items>
</content>
</
jcr:root>

We can see that I added two different textfields, to test both ways to store the info under jcr:content and in the workitem metadatas.

I use a custom process step after dialog participant step to debug if the info is stored.

I’m checking the working item and it hasn’t watchEmails property and also I’m checking that I haven’t this data under jcr:content (in this case a keyword hasn´t jrc:content but adobe says that if doesn´t exist will be created).

Also I checked the network in the browser console and I can see the post call to add this properties to the payload resource with a 200 OK, but never is stored.

10 Replies

Avatar

Level 10

Hi,

Adobe documentation is not clear for this topic.

See the HELPX articles of which smacdonald2008  pointed you.

~Ratna.

Avatar

Level 2

But my problem is something different because the user need to choose between two options, and the next process step need to get this data and execute the code.

Actually my problem is not get the info from working item. The problem is how can I store the info, I was checking the helpx(Creating an Adobe Experience Manager Custom Worflow Step with a dialog) but in the dialog are using ./metadata/property

when I use this name I have an javax.jcr.nodetype.ConstraintViolationException: No default node type available for /apps/myproject/i18n/dictionary1/en/first-title/metaData

I'm using Touch UI in AEM 6.3

Avatar

Level 10

You cannot use Touch UI to edit workflow models. ie:

http://localhost:4502/cf#/etc/workflow/models/screens-update-asset.html

This is Classic UI. Typically when you see cf# in the URL - you know its classic.

I assume here "How can I store the info" - you mean to store it in one step and use it in a following step?

If so -- to pass a value from one workflow step to the next - you have to use a MAP instance - as discussed here:

Scott's Digital Community: Passing Values between AEM Workflow Steps

Avatar

Level 2

I'm using  classic ui to edit the model.

Yes my problem is not getting the value. The problem is when I try to put the dialog value in the metadatamap

Dialog Participant Step - Storing Data in the Payload

You can store widget data in the workflow payload or in the work item metadata. The format of the name property of the widget node determines where the data is stored.

  • Store Data with the Payload
    • To store widget data as a property of the workflow payload, use the following format for the value of the name property of the widget node:
          ./jcr:content/nodename
    • The data is stored in the nodename property of the payload node. If the node does not contain that property, the property is created.
    • When stored with the payload, subsequent uses of the dialog with the same payload overwrites the value of the property.
  • Store Data with the Work Item
    • To store widget data as a property of the work item metadata, use the following format for the value of the name property:
          nodename
    • The data is stored in the nodename property of the work item metadata. The data is preserved if the dialog subsequently used with the same payload.

Avatar

Level 2

danielgopo

Having same issue. Were you able to resolve your problem?

Avatar

Level 2

Just solved it. If anyone has an issue with dialog participant step not storing dialog entries with workitem metadata. I solved it by following naming convention for storing data in payload, BUT replacing payload path with work item metadata.

You can do this by copying and overriding

/libs/cq/inbox/gui/components/inbox/dialoginjection/render

in /apps


Avatar

Level 3

Hi ,

I am also not able to store dialog value in workitem metadata. Can u pls share what code you have changed in render.jsp to store dialog value in workflow workitem.

Avatar

Level 2

change

data-payloadpath="<%= xssAPI.getValidHref(payloadPath) %>"

to

data-payloadpath="<%= xssAPI.getValidHref(workitem.getWorkflow().getId()+"/data/metaData") %>"

Avatar

Level 2

Hi,

I am using Dynamic participant step . and giving my script to choose my participant and also i am giving a dialog path where my properties are to be configured. But my property is not getting stored in neither payload nor workitem. I tried the wayaround given by you but was unlucky. can you help more on this.

Thanks in Advance