활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
Hi,
I need to programmatically pull the list of AEM inbox notifications of a user, with the purpose of sending them a reminder (via email) of the workflow steps waiting for them to take action on.
Can someone please send some hints, or sample code on how to get the list of inbox items.
Thank you
조회 수
답글
좋아요 수
lir Yes, there are rest endpoints exposed via which you can retrieve the inbox items in a user's inbox. One example of such request is : http://host:port/bin/workflow/inbox which will list all the work items in the inbox of the user.
For more details on using this endpoint further please refer Interacting with Workflows Programmatically .
Once you have the work items, you can use the InboxItem API "The Adobe AEM Quickstart and Web Application." to retrieve further details regarding that InboxItem object.
조회 수
답글
좋아요 수
My code is an OSGI bundle service.
I got a reference to a user instance, and I need to pull the items in this user's inbox.
조회 수
답글
좋아요 수
조회 수
답글
좋아요 수
No, that makes no sense.
We are talking server side code here.
조회 수
답글
좋아요 수
Inbox items are just nodes. look at using the JCR api
조회 수
답글
좋아요 수
Hi,
Can you try below methods to get task and workflow item in osgi code.
ResourceResolver resolver = request.getResourceResolver();
TaskManager taskManager = resolver.adaptTo(TaskManager.class);
Iterator<Task> ti = taskManager.getTasks(new Filter());
WorkflowSession graniteWorkflowSession = resolver.adaptTo(WorkflowSession.class);
WorkItem[] workItems = graniteWorkflowSession.getActiveWorkItems();
example servlet aem63app-repo/GetInbox.java at master · arunpatidar02/aem63app-repo · GitHub
조회 수
답글
좋아요 수
Hi guys,
I am interested on the InboxItem-s (WorkItem-s) that belong to each and every user (who participates in a number of workflows), so I don't see how the suggestion above can help.
My final goal is that once a day, each and every user receive a reminder email, that lists all the pages/assets/etc they are expected to approve/disapprove in AEM.
So my code has to either:
1- impersonate each and every user, one by one, read their InboxItem-s and go from there.
This I think is straightforward, but seams impossible because "A system user cannot impersonate a non system AEM user"
2- access all active workflow instances, and somehow extract what each and every user is expected to approve/disapprove.
I don't know how to approach this code wise.
I hope this is clear and someone can help.
Thank you!
조회 수
답글
좋아요 수
If you request http://localhost:4502/libs/cq/workflow/content/inbox/list.json as an admin, you get a list of all pending inbox items and their assignees. The code for how that list is generated is available in crx/de under /libs/cq/workflow/components/inbox/list/json.jsp
So you can model your code after the code used in that page and retrieve the results as an InboxItem array and send your notifications.
Refer to the code in crx/de for the details on retrieving the data
조회 수
답글
좋아요 수
Thank you for the reply, that looks promising!
I will go through it and let you know.
Thanks again
조회 수
답글
좋아요 수
Hello @lir , were you able to get this working. I am in a similar situation and wondering if you can point me in right direction .
조회 수
답글
좋아요 수
Thanks shunnar
I tried to customize /libs/cq/workflow/components/inbox/list/json.jsp. But the changes are reflecting only on Classic UI but not on Touch UI. I am working on AEM 6.4.3.
조회 수
답글
좋아요 수
The logic to fetch or create data for TouchUI inbox is not at the front end as in case of classicUI but at the Java side. below is the basic flow:
-A request to '/aem/inbox' resolves to path '/libs/cq/inbox/content/inbox'
-This renders data per [1] which creates the html page per [2]
-At the same time [1] triggers a get request to fetch the data for the inbox page [3] which is handled by a servlet [4] and used by [2] to create the complete inbox page
-Further on logic goes to [5] and [6] to fetch the data per the logic
[1] /libs/cq/inbox/content/inbox/jcr:content/views/list/datasource
[2] /libs/cq/inbox/gui/components/inbox/inboxitem/list/list.html
[3] cq/inbox/gui/components/inbox/datasource/itemsdatasource
[4] com.adobe.cq.inbox.impl.servlet.ItemsDataSourceServlet.java
[5] com.adobe.granite.workflow.core.WorkflowSessionImpl.java
[6] com.adobe.granite.workflow.core.jcr.WorkItemManager.java
조회 수
답글
좋아요 수
Hi,
Were you able to get this work?
조회 수
답글
좋아요 수
조회 수
Like
답글
조회 수
Likes
답글
조회 수
Likes
답글