IBM Support

When a flow loops back to a Coach in IBM Business Process Manager (BPM), its Coach Views that are bound to re-initialized complex objects might contain stale data

Troubleshooting


Problem

Coach Views that are bound to complex objects (both data binding and configuration binding) might contain stale data when the runtime flow returns to a Coach that contains these Coach Views.

Cause

The runtime flow returns to the Coach through a stay on page node or connection. The stale data occurs only when complex objects, such as a business object of a complex type, are re-initialized on the server side. The Coach views are not notified of this re-initialization and, as a result, do not refresh their data. That is, a server-side tw.local.var1= new tw.object.BO1() means that Coach views that are bound to the business object (BO) might have data that is out of sync with the server. Coach views that are bound to simple type properties of the complex object are notified of changes (for example, tw.local.var1.property1="changed").

For example, CoachView1 is bound to BO1 and CoachView2 is bound to BO1.property1, which is a simple type such as String or Integer. If you re-initialize BO1 on the server and the flow returns to the Coach that contains CoachView1, CoachView1 is not notified of this change. However, if the re-initialization of BO1 changes BO1.property1, CoachView2 is notified of this change to BO1.property1.

Resolving The Problem

To make your Coach view aware of changes to a complex object, use one of the following techniques:

  • Create a callback to capture changes to the complex object:
    1. In the load() event handler of the Coach view, add the following code:

      this.context.binding.get("value").bindAll(this.myChange, this);
    2. Define the myChange() event handler in the Coach view JavaScriptâ„¢. Add the logic to handle properties changes.
    3. In the change() event handler, call bindAll() to rebind to the properties. This step is necessary because the previous binding subscriptions are lost when the complex object is replaced.
  • Create a flag to indicate that the complex object has changed:
    1. Add a variable of a simple type such as Boolean or String to the human service.
    2. Bind the variable as a configuration option to the Coach view.
    3. Add server-side scripting that updates the variable when the complex object changes. The change in the configuration option variable invokes the change() event handler for the Coach view.
    4. Add code to handle the changes in the complex object.

[{"Product":{"code":"SSFTN5","label":"IBM Business Process Manager Advanced"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Coach","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"},{"code":"PF035","label":"z\/OS"}],"Version":"8.5;8.0.1;8.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSFTBX","label":"IBM Business Process Manager Express"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Coach","Platform":[{"code":"PF016","label":"Linux"},{"code":"","label":"Linux zSeries"},{"code":"PF033","label":"Windows"}],"Version":"8.5;8.0.1;8.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSFTDH","label":"IBM Business Process Manager Standard"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Coach","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF016","label":"Linux"},{"code":"","label":"Linux zSeries"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"8.5;8.0.1;8.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Product Synonym

BPM

Document Information

Modified date:
15 June 2018

UID

swg21638401