Support Article
Navigation > Actions not happening in sequence
SA-36530
Summary
Configured actions on Navigation
Action 1: Refresh Harness
Action 2: Run Data Transform
Order of execution(observed in Tracer):
Action 2 and then Action 1.
Error Messages
Not Applicable
Steps to Reproduce
- Add a UI-Navigation.
- In navigation actions, add the following actions:
- Add "Harness" > New Document having a DT ABC.
- Add a Data Transform XYZ
4. Notice, it is calling the DT XYZ in start itself on click of the menu item.
Root Cause
The issue is that the runDataTransform request is sent before the harness request from the browser.
That is why ‘UpdateWidgetLoader’ datatransform is run before ‘SFAPrepareDefaultDashboard’ datatransform of harness.
The reason for this behavior is that when the show harness action is used, the harness is loaded in iframe with src attribute.
In JS execution stack, as soon as iframe src is set, it will not send request for iframe src, as the browser performs any DOM operations after the JS execution is done and continue to execute the code in the current stack and executes next action for that event.
And then AJAX call is sent for runDataTransform action. After the current execution stack is completed, browser sends request for iframe src.
Resolution
The following snippet can be used in UserWorkForm to call the data transform "UpdateWidgetLoader" after the harness is loaded:
function onHarnessLoadHandler() {
//Run datatransform
}
$(function() {
// Attach to harness onloads
var e = window.event;
pega.u.d.harness_execute (onHarnessLoadHandler, true, e);
});
To run the datatransform though JS, Pega has exposed pega.api.ui.actions.runDataTransform API as part of the user story US-156481 and the hotfix HFix-31514 is provided for Pega 7.2.2.
Published May 2, 2017 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.