Keep track of comments in the RBPM workflow

This article describes how one can keep track of comments which have been entered into one or more forms during the NetIQ User Application request process. This is helpful if you want to display a ‘running commentary’ of the previously entered comments on each new form when it is presented to the User.

For instance, during the request process, the business logic might require that a User enters some comments detailing why the request was made. When the request is submitted, there may well be a two-step approval with an approval form being routed to the Manager of the requestor and another approval form being routed to the Service Desk group which, in turn, requires two approvals. Assume we have the following actors in the request process:

  • The requestor is User A
  • The Manager of the requestor is User B
  • The 1st Service Desk User is User X
  • The 2nd Service Desk User is User Y

By using the code contained within this article, you can expect the following outcome:

  • User A submits a request via a form which includes a mandatory comments field
  • User B opens the approval form and sees the comments which were entered in by User A. User B approves the request
  • User X opens the Service Desk approval form and sees the comments entered in by both User A and User B. User X approves the request
  • User Y opens the Service Desk approval form and sees the comments entered in by User A, User B, and User X. User Y denies the request
  • Since the request process has finished (User Y denied the request), an email is sent to User A and User B
  • Within the email, there is a HTML table which displays all the comments entered during the request lifecycle (including their own). User A and User B would be able to see that the request was denied, the time the request was denied, by whom the request was denied, and the reason for the denial

In order to implement such a solution, the first thing that is required is to add a data-mapping activity after each of the forms for which you want to collect a comment. The source for the data-mapping is shown below. The result of the data-mapping is stored in the flowdata variable Global/values/FinalComments. In the code below, the form where the comments have been captured is Activity15.

The returnComments function, called from the above function, is shown below.

The code below is used to display the comments in a HTML field. The code can be used either in a pre data-mapping activity for a HTML field on a form, or as part of the HTML email template. Because there is only a single function to construct the table, the displayed data on the form and in the email looks identical, colours and all.