Saturday, October 22, 2011

Modify Workflow Popup

Recently I got requirement to modify workflow popup menu according to certain conditions

The following explains how simply to do that:

  • Go to the following directory <middleware_home>/Oracle_ECM1/ucm/idc/resources/core/idoc
  • In that directory, we have two interesting files that contains most of resource includes that we desire to customize std_page.idocstd_workflow.idoc
  • As per our requirement of customizing Workflow related feature so our target will be std_workflow.idoc, inside it you will find an include called setup_workflow_action_popups
  • I will assume you will be able to create a new component, and add a resource file to it, then inside that resource file copy and past the include setup_workflow_action_popups from std_workflow.idoc as is.
  • Now lets take a look at the include
You will find there repeating parts in the include everyone is representing an item in the popup menu.


<$exec rsAppendNewRow("PopupProps")$>

<$exec setValue("PopupProps", "label", lc(""))$>

<$exec setValue("PopupProps", "function", "")$>
<$exec setValue("PopupProps", "ifClause", "")$>

<$exec setValue("PopupProps", "class", "workflow")$>
<$exec setValue("PopupProps", "id", "")$>

id: unique i for the popup menu item
class: will be always workflow
function: either a link location or javascript calls. The link may be composited by idoc script
label: localized display label for the popup menu item
ifClause: Which is the amazing feature, it is the condition for displaying the menu item and it can be something like dDocType like 'Correspondence' and of course you can make use of the existing conditions like AllowReviewAllowCheckin 

Here is an example of a new item I added


<$exec rsAppendNewRow("PopupProps")$>

<$exec setValue("PopupProps", "label", lc("wwUpdateAndApprove"))$>

<$exec setValue("PopupProps", "function", "<$HttpCgiPath$&>IdcService=GET_UPDATE_FORM&dDocType=Correspondence&dID=<$dID$>&dDocName=<$url(dDocName)$>&idcToken=<$idcToken$>")$>
<$exec setValue("PopupProps", "ifClause", "dDocType like 'Correspondence'")$>
<$exec setValue("PopupProps", "class", "workflow")$>
<$exec setValue("PopupProps", "id", "workflowUpdateAndApprove")$>

The two resource file std_page.idoc & std_workflow.idoc will make you very powerful, don't miss them and don't give up until you find your needs.


No comments: