Expand my Community achievements bar.

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

How to add custom property in project task(in backend via crxde) in vanilla AEM 6.4 instance and fetch its value.

Avatar

Level 8

Hi All,

This is a requirement related to Show/hide custom button in http://localhost:4502/aem/inbox in vanilla AEM 6.4instance .

Suppose I create a task in my inbox by going to http://localhost:4502/projects/details.html/content/projects/we-retail  -> Start workflow -> Project Approval Workflow.

A task then gets created in the http://localhost:4502/aem/inbox .

This task in crxde is stored somewhere under /content/projects/we-retail/jcr:content/tasks/2018-06-08/task_from_workflowlaunchedbyproject. If I add a custom property to it say 'showCustom ={Boolean}true' and I want to fetch that value to show/hide my custom button[i.e, My Complete] in AEM inbox.

How should we go about doing this.

Tried few things[not sure if its a proper approach] :

-In the task created /content/projects/we-retail/jcr:content/tasks/2018-06-08/task_from_workflowlaunchedbyproject, added some value to existing description property.

- In /libs/cq/inbox/gui/components/inbox/inboxitem/list/list.html added data element data-custom-item="${item.description}".

- In custom js code able to read the value, based on which I am able to show/hide.

- But in case I add a custom property to the task, how do I do this, is a challenge.

Any thoughts/pointers/reference code here will be helpful.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

when you create a task, add custom parameter in content path i.e.

newTask.setContentPath("/content/AEM63App/en?showCustom=true");

and read this property when do show and hide.

Demo Code aem63app-repo/SimpleCreateTaskServlet.java at master · arunpatidar02/aem63app-repo · GitHub

Screen Shot 2018-06-13 at 11.18.19 PM.png

Thanks

Arun



Arun Patidar

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

Hi,

when you create a task, add custom parameter in content path i.e.

newTask.setContentPath("/content/AEM63App/en?showCustom=true");

and read this property when do show and hide.

Demo Code aem63app-repo/SimpleCreateTaskServlet.java at master · arunpatidar02/aem63app-repo · GitHub

Screen Shot 2018-06-13 at 11.18.19 PM.png

Thanks

Arun



Arun Patidar

Avatar

Level 8

Hi Arun,

Sorry for the delayed response.

Thanks a ton for all your help. Able to get some way now to go about this.

Once again, thanks a lot.