Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Not able to drag & drop the custom workflow step

aemninja
Level 4
Level 4

Hello Community - I am not able to drag & drop the custom workflow step in the workflow model. Not sure what is happening. Can someone advise on this?

 

customworkflowstep XML:

 

<?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"
jcr:description="This is a custom workflow step for test project."
jcr:primaryType="cq:Component"
jcr:title="Test Workflow Step"
sling:resourceSuperType="cq/workflow/components/model/process"
allowedParents="[*/parsys]"
componentGroup="Test Utility"/>

 

cq_editConfig.xml

 

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root 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"
cq:dialogMode="floating"
jcr:primaryType="cq:EditConfig">
<cq:formParameters
jcr:description="custom workflow step."
jcr:primaryType="nt:unstructured"
jcr:title="Custom Workflow Step"
PROCESS="com.test.aem.core.workflows.CustomWorkflowStep"
PROCESS_AUTO_ADVANCE="true"/>
<cq:listeners
jcr:primaryType="cq:EditListenersConfig"
afterdelete="CQ.workflow.flow.Step.afterDelete"
afteredit="CQ.workflow.flow.Step.afterEdit"
afterinsert="CQ.workflow.flow.Step.afterInsert"
afterMove="REFRESH_PAGE"/>
</jcr:root>

 

cq_dialog.xml:

 

<?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 Workflow Step"
sling:resourceType="cq/gui/components/authoring/dialog">
<content
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/tabs">
<items jcr:primaryType="nt:unstructured">
<common
cq:hideOnEdit="true"
jcr:primaryType="nt:unstructured"
jcr:title="Common"
sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns"/>
<process
cq:hideOnEdit="true"
jcr:primaryType="nt:unstructured"
jcr:title="Process"
sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns"/>
<processcommon
jcr:primaryType="nt:unstructured"
jcr:title="Common"
sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns">
<items jcr:primaryType="nt:unstructured">
<column
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container">
<items jcr:primaryType="nt:unstructured">
<basic
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/fieldset">
<items jcr:primaryType="nt:unstructured">
<title
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
disabled="false"
fieldLabel="Title"
name="./jcr:title"/>
<description
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textarea"
disabled="false"
fieldLabel="Description"
name="./jcr:description"/>
</items>
</basic>
<advanced
jcr:primaryType="nt:unstructured"
jcr:title="Advanced Settings"
sling:resourceType="granite/ui/components/coral/foundation/form/fieldset">
<items jcr:primaryType="nt:unstructured">
<advance
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
fieldDescription="Check if your handler will advance to the next step."
fieldLabel="Handler Advance"
name="./metaData/PROCESS_AUTO_ADVANCE"
text="Handler Advance"
value="true"/>
</items>
</advanced>
</items>
</column>
</items>
</processcommon>
<processargs
jcr:primaryType="nt:unstructured"
jcr:title="Arguments"
sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns">
<items jcr:primaryType="nt:unstructured">
<column
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container">
<items jcr:primaryType="nt:unstructured">
<arguments
jcr:primaryType="nt:unstructured"
jcr:title="Step Arguments"
sling:resourceType="granite/ui/components/coral/foundation/form/fieldset">
<items jcr:primaryType="nt:unstructured">
<brand
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
fieldLabel="Brand"
name="./metaData/BRAND"/>
<multinational
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
checked="{Boolean}false"
fieldDescription="is your brand present in multiple conuntries."
name="./metaData/MULTINATIONAL"
text="Is Multinational"
uncheckedValue="{Boolean}false"
value="{Boolean}true"/>
<countries
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
fieldDescription="Add sites for countries."
fieldLabel="Countries">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
name="./metaData/COUNTRIES"/>
</countries>
</items>
</arguments>
</items>
</column>
</items>
</processargs>
</items>
</content>
</jcr:root>

14 Replies
ravi_joshi
Level 3
Level 3

Hi @aemninja ,

 

If you are not able to locate your component in model parsys. Most probably that is because your model is using default design from libs where your component group is not allowed. To allow your component group I will will suggest to follow below steps :

 

1. Copy the node (Overlay) from "/libs/settings/wcm/designs/default" to "/apps/settings/wcm/designs/default". You can change name "default" to anything as per need.

 

2. Go to "/apps/settings/wcm/designs/default/jcr:content/model/flow" and locate the multivalued property "components" and add "group:Test Utility" there. (Here Test Utility is your component group for the workflow custom step model).

 

3. Finally, Go to your workflow model and open properties. There in the advance tab change the design path to "/apps/settings/wcm/designs/default" and save.

 

4. Now try to drag and drop your component it should appear.

 

Hope this helps. And me know if you face any issue.

 

Thanks,

Ravi Joshi

aemninja
Level 4
Level 4

@ravi_joshi - I have already followed the steps you have provided. It is not letting me to drag the process step in the modal.

ravi_joshi
Level 3
Level 3

@aemninja Okay. I have tested the same in my local aem 6.5 it is loading fine. Can you check whether the below java file throwing any error or not. "com.test.aem.core.workflows.CustomWorkflowStep". Check error.log after drag and drop of the component.

 

Screenshot (23).png

bangar50
Level 7
Level 7

Hi @aemninja ,

                          Your workflow process step is it showing for drag n drop.

I think you need workflow component in the workflow group.

 

Kr,

Sanjay

aemninja
Level 4
Level 4

@bangar50 - The workflow process step is available but I am not able to drag the process step.

 

CaptureWF.PNG

lukaszm
Level 7
Level 7

Hi @aemninja, did you try to add your custom step to the workflow model by clicking on parsys and using + sign (instead of using d&d)? Are there any errors in the browser console or in the server error.log correlated with d&d operation?

aemninja
Level 4
Level 4

@lukaszm - In the parsys, Insert component, the custom workflow step is not appearing in the list. Moreover I dont see any errors in the console/error.log while dragging the custom workflow step.

lukaszm
Level 7
Level 7

This looks like design configuration issue, could you please share following information:

  1. What design are you using in your workflow - you can get this information by opening page properties of your workflow model page and navigate to advanced tab.
  2. Definition of your custom design that you are using in your workflow model.

You can also change component group from Test Utility into Workflow, and see if this will work. This change will also confirms that root case is configuration of the design that is used by your workflow model.

 

Last but not least you can check if proper design is requested - you can use dev tools in your browser to track requests.

aemninja
Level 4
Level 4

@lukaszm - I am using the below design. If I move the Test Utility into Workflow group, I am able to drag and drop the custom workflow step. Not sure what could be the design issue as I have copied the required design.

 

/apps/settings/wcm/designs/test-utilityCaptureWorkflow.PNG

lukaszm
Level 7
Level 7

@aemninja- thanks, could you please try to change Test Utility into group:Test Utility in your design configuration - inside components property.

aemninja
Level 4
Level 4

@lukaszm - I am able to drag and drop the workflow step in the model. The issue is with the group name. I didn't add the prefix "group:" before the group name. Thanks for your inputs. Also one more thing, I have a dialog participant step in the workflow model. Basically I wanted to assign the task to the user who initiated the workflow rather than assign it to any group. Can you tell me is there a way to do that? Screenshot attached.DialogParticipant.PNG

lukaszm
Level 7
Level 7

@aemninjayou can use AEM OOTB Workflow Initiator Participant Chooser step in your workflow model.

aemninja
Level 4
Level 4

@lukaszm - Thanks for your inputs. Actually I just wanted to capture some input data from the initiator (Dialog) in this step. is there a way to customize and add the dialog to capture input from the initiator.

lukaszm
Level 7
Level 7

@aemninjaI believe it is possible, please have a look on dialog implementation of Workflow Initiator Participant Chooser step /libs/cq/workflow/components/workflow/initiatorparticipantchooser, it is using following ecma script /libs/workflow/scripts/initiator-participant-chooser.ecma.

 

I think base on above you should be able to modify your workflow step to have all you need.