Thursday, October 23, 2008

Author Field in My Workflow Assigments

OOTB UCM workflow application is very powerfull but lacks basic common sense features. One of them is the author field in the workflow queue table. When a reviewer checks in to look at the number of workitems in his queue there is no way he can see who modified the content.


Here I have put the steps to add the author field for this page. I have followed the techniques given by Brain 'Bex' in his book. So in case you want to know more detail approach on customising the core services check out his book.


Step1: Open the files workflow.htm and std_services.htm. We can find these under installdirectory/shared/config/resources. These will list the standard services provided and services that are used to implement workflows.

Step2: (Assuming that we have at least one active workflow) Click on MyContentServer-->MyWorkflowAssignments. We will see Workflow in Queue page, here we see ContentID, Title,Enter Date, Last Action Date, and Actions columns for each work item in the queue.

Step3:Do a mouse hover on All Active Workflows and you will see a similar URL -->http//ContentServer/instancename/idcplg?IdcService=GET_ACTIVE_WORKFLOWS. The resultset for GET_ACTIVE_WORKFLOWS service is all the active workflows in the content server. Search for this service in services_refrence guide you will see the that the response template is WORKFLOW_LIST. Our first instinct will lead us to experiment with this. But if we see the other templates using these and do a intelligent guess we will stumble on WF_INQUEUE_LIST (workflow_queue.htm). Also you will see the refrence to this page in the URL of My workflow assignments page.

Step4: You will find workflow_queue.htm page in installDirectory/server/shared/config/templates. Open this page in a editor and add sample html code. Refresh content server page. You will see Testing at the end of the page. Incase you do not see any changes then, clear browser cache and refresh. Restart content server. Restart machine. If still you do not see the changes then you need to see other places where workflow_queue.htm is available. If you have a core update installed than go edit the page you will find inside the core update.

Step5:Now double click on workflow_queue.htm you will see the dynamic html resource used to build this page. You will see workflow_in_queue_table is an include. Now go to std_page_workflow.htm found under installDirectory/server/shared/config/resources and search for workflow_in_queue_table. Here we see that this inturn executes setup_workflow_in_queue_table_header.

Step6: Find for setup_workflow_in_queue_table_header and add below lines. dDocName column properties. <$exec rsAppendNewRow("ColumnProperties")$> <$exec setValue("ColumnProperties", "id", "dDocAuthor")$> <$exec setValue("ColumnProperties", "width", "auto")$> <$exec setValue("ColumnProperties", "headerLabel", "wwdDocAuthor")$> <$fieldName = "dDocAuthor"$> <$exec setValue("ColumnProperties", "headerURL", strTrimWs(inc("workflow_in_queue_header_resort_url")))$> <$exec setValue("ColumnProperties", "rowAlign", "left")$>This will add Author column in your content server page.Do a refresh to see the changes. Again make sure you are changing the file at the right place.

Step7: Above step will add the Author coulumn, to get the document author name for each document in the workflow do the following change.Add below line inside setup_workflow_in_queue_table_row dhtml<$exec setValue("RowData", "dDocAuthor", "<$if dDocAuthor$><$dDocAuthor$><$else$><$lc(\"wwNoRevisionCheckedIn\")$><$endif$>")$>.

On refresh you will the Author field of each document in your work queue.

1 comment:

Unknown said...

Hi,
It is very helpful blog, you have suggested to add column in core table but I need to add through component by overriding.
Can you please help me in achieving this task.
Thanks.