Question
IP Australia
AU
Last activity: 26 Sep 2017 0:44 EDT
Run DataTransform from Script
Hi,
Can anyone suggest how to run DataTransform from a Script or Function.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Capgemini
SE
Hi,
Use ApplyModel function in default library to call a data transform from java step or within a function.
Capgemini
US
Hi, You can write the logic below to run the Data transform from function.
PublicAPI tools = ThreadContainer.get().getPublicAPI();
ClipboardPage ClipboardPage = tools.findPage("ClipboardPage");
tools.applyModel(ClipboardPage, tools.getParameterPage(),ModelName);
Declare ClipboardPage and ModelName as params to the function and pass the appropriate values.
IP Australia
AU
Hi,
Thank you for reply, I am trying to use the below code in text file and it is not working. Am I missing anything?
function execute(){
<%
tools.applyModel(tools.getStepPage(),tools.getParameterPage(),"ModelName");
%>
}
Pegasystems Inc.
IN
Hi Mohammad,
Can you try this and let me know if this works:
- var options = {
- name: “dataTransformName ",
- parameters: [{name: "param1", value: "Page1.prop1", isProperty: true}, {name: "param2", value: 123, isProperty: false}],
- contextPage: "page1.page2 ",
- event: eventObject
- };
pega.api.ui.actions.runDataTransform(options);
Hi Mohammad,
Can you try this and let me know if this works:
- var options = {
- name: “dataTransformName ",
- parameters: [{name: "param1", value: "Page1.prop1", isProperty: true}, {name: "param2", value: 123, isProperty: false}],
- contextPage: "page1.page2 ",
- event: eventObject
- };
pega.api.ui.actions.runDataTransform(options);
- name: The name of the Data Transform.
- parameters: Optional. Array of the data transform parameters in JSON format.
- contextPage: Optional. The Page that provides the context that the data transform run in. When not set, the data transform run in the primary page context.
- event: The event refers to a DOM eventObject.
Regards,
Vikash
IP Australia
AU
Thank you Vikash,
Do I have to use this code in function? and text file rule?
Thanks,
Mohammad Gouse.
Pegasystems Inc.
IN
Hi Mohammad,
You can write this function in a javascript file.
Please refer the below link:
https://docs-previous.pega.com/rundatatransform-public-js-api-control-actions
Regards,
Vikash