在AEM 6.2中向工作流收件箱添加新/自定义属性

时间:2017-11-07 14:33:40

标签: java adobe aem cq5

当用户在AEM 6.2中启动工作流期间设置优先级属性时,我要求在经典UI收件箱中呈现新的优先级属性。

我在AEM 6.3中看到这是一个OOTB功能,但在AEM 6.2中没有,新的Workitem处理优先级。我理解在AEM 6.3中自定义收件箱的可能性。

如何利用AEM 6.2中的收件箱自定义?

我目前正在遵循Adobe forum中提到的方法。

enter image description here

即使在更新列列表后,我也看不到收件箱中的新列。

谢谢!

1 个答案:

答案 0 :(得分:1)

您遵循的方法适用于CQ5。     对于AEM 6.2,请按照以下步骤操作:

Taking a example to show the name of the workflow initiator 

1) /libs/cq/workflow/content/notifications/workitemdetails/items/content/items/itemdetails/items/well/items
create a new node : nt:unstructured
(ex)
fieldLabel - String - Started By
name - String - startedBy
renderReadOnly - Boolean - true
showEmptyInReadOnly - Boolean - true
sling:resourceType - String - granite/ui/components/foundation/form/textfield

2) /libs/cq/workflow/components/inbox/list/json.jsp
add code :

WorkflowStatus wfStatus = res.adaptTo(WorkflowStatus.class);                
if (wfStatus != null) {
   List<Workflow> workflows = wfStatus.getWorkflows(true);
   if(workflows.size() > 0) {
     String initiator = workflows.get(0).getInitiator();
     writer.key("startedBy").value(initiator);
   }
}

Note :
key name (startedBy) should match the name defined in new node

3) /libs/cq/workflow/gui/components/inbox/clientlibs/inbox/js/model/InboxItemModel.js
toJSON: function() {
.
.
.
startedBy: Granite.I18n.getVar(this.get("startedBy")) || "",
}

Now you can see the custom node entry in /notifications.html]

screen shot :
https://i.stack.imgur.com/YpoY9.png