BPM, Workflow, and Case

 View Only

Architectural design for Near Real-Time Document or Event Alerts in IBM BAW (Business Automation Workflow)

By Sachin Jain posted Tue May 21, 2024 12:14 AM

  

Introduction

In this blog post, we'll examine an effective solution for notifying users when a new document/event arrives in a multi-user environment.We will utilize event subprocesses, UCA, data change events, and shared objects to design this solution. These features, though less explored, offer a powerful combination of functionalities provided by IBM BAW (Business Automation Workflow).

.

Pre Requisits: 

 
1. IBM BAW (Business Automation Workflow)
2. IBM FileNet (For Document event)
3. Document add / update alerts enabled which is calling another Java API
4. This Java API notifying BAW based on custom REST service defined in BAW
 
Note: For IBM FileNet Document add / update alerts can be configured to directly listened by IBM BAW as Content Event.

 

Use- Case:

In processes where decisions are made based on a documents provided then it becomes very important to let the users' know whenever a new document or a new document version arrives, so that the previous review needs to be re-done and the further processing needs to be stopped. It is much easier to control if the documents addition / update happens only through the BAW designed screens.

In such cases new document addition / new version addition can be controlled based on process stage or user type. But if the documents can be added directly to the document respository like IBM FileNet then BAW needs to be alerted about this event and necessary process adjustments are to be designed in BAW.

Typically, these notifications are managed via email or by creating a new task that prevents users from progressing until the new task is completed. However, a more efficient approach would be to refresh the user's current page and add a new required field that must be addressed before moving forward.

 

Examples:

  1. During the mortgage process, an agent uploads a new report while the valuation is under review.
  2. In a credit card application, a new compliance report is uploaded during the underwriting process.

 

Advantages:

  1. On-screen notifications prompt users to review new documents immediately.
  2. No additional tasks need to be created, preventing interruptions to the user's current workflow. 

Technical Details:

1. Business Object Creation

create new shared business object with following properties.

    1. documentCode
    2. docId 
Business Object Creation_IM1

 

2. UCA Design

Create a UCA with service attached and having following parameter.

a. documentCode

b. applicationNumber

c. docID

Application number will be used as co-relation key in the process.

UCA Design_IM2

 

3. Alert Service Design:

This service will be used to send alert when new document is arrived. This service can be exposed to external system.

 

    1. Identify the document type.
    2. Check if the required task is in progress.
    3. If the task is active, send a document notification event.

 

3.Process Level Changes:

 

  • Create a shared object of variable type DocumentNotificationInfo.
  • Create a boolean variable to indicate if there is any new incoming document type.

  • Create an event sub-process which includes the following: a. Attach the message UCA 'Send Document Alert Notification' and add a condition based on the respective document code. b. Save the DocumentNotificationInfo object with the document code and document ID. c. Update the boolean variable (UpdateReceived) to 'yes'.

  • Send the DocumentNotificationInfo and the boolean object in the data mapping of the relevant CSHS.

var sharedKey=tw.local.documentNotificationInfo.metadata('key');

//Fetch shared object using sharedKey
tw.local.documentNotificationInfo=new tw.object.DocumentNotificationInfo(sharedKey);

//Update document details recived via UCA and SAVE
tw.local.documentNotificationInfo.documentCode=tw.local.documentCode;
tw.local.documentNotificationInfo.docId=tw.local.docID;
tw.local.documentNotificationInfo.save();

//Update flag to show details in the User Interface
tw.local.updateRecieved=true;

4. Changes in the Client-side Human Service:

 

  • Create two input variables: a shared business object and a Boolean variable.

  • Place a data change event handler and add the code below in the script activity.


  • In the coach:
    • Drag and drop a refresh control available in the Dashboard toolkit, and configure the time interval for the refresh control from the environment settings.

  • Drag and drop a checkbox (Document Update Received) control and set its visibility to 'none'. 
  • Drag and drop a data control, add the code below on the load and change events, and modify the control IDs accordingly.
  • Bind the variable docId from the shared object to the data control.

  • Script on "On load" Event
    var updateReceived= me.getData();
    console.log("Load Page"+${updateReviewed}.getData());
    //var message= ${docNotificationMessage}.getData();
    var msg = "Please review the updated documents (s) and confirm)";
    if(updateReceived){
    	${updateReviewed}.show();
    	var view=page.ui.get("/updateReviewed");
    	view.context.options._metadata.visibility.set('value', 'REQUIRED');
    }
  • Script on "On change" Event
    var updateReceived= me.getData();
    console.log("On Change Page"+${updateReviewed}.getData());
    //var message= ${docNotificationMessage}.getData();
    var msg = "Please review the updated documents (s) and confirm)";
    if(updateReceived){
    	${updateReviewed}.show();
    	var view=page.ui.get("/updateReviewed");
    	view.context.options._metadata.visibility.set('value', 'REQUIRED');
    }

5. Demo

Step 1: Trigger new process and Open page

New instance got creation with human task.

Open the task and keep it open, where checkbox is not visible.

Current shared object properties:

a. DocumentCode: 2

b. DocId:200

Step 2: Run service to alert on arrival of new document

Properties send on service.

a. DocumentCode: 3

b. DocId:300

Step 3: Check in the opened coach and properties

On the screen

    1. "Document Update Required" checkbox is visible
    2. Properties are updated in the shared object.
      1. DocumentCode: 3

      2. DocId:300

Co- Authors:

This solution is developed and written with the help of following contributors:

1. Mukesh Verma

3. Sachin Kumar Jain

#BusinessAutomationWorkflow(BAW)#IBMBusinessAutomation  #IBMBAW #SharedObject#DataChangevent

0 comments
22 views

Permalink