Question
Maantic Inc
US
Last activity: 24 Jun 2019 12:27 EDT
Pega mashup - How to refer the javascript passed parameters in pega code
Hi,
In pega mashup, Harness is called from external application.
how to pass the parameters to Harness from external application.
I do see pega mashup have syntax data-pega-parameters, In pega harness how refer external application passed parameters.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
ANZ Banking Group Ltd
AU
Hi,
We can not pass the parameters to Harness directly from the mashup.
Pass the parameters from the mashup and collect them into pyDefault data transform and set them on properties.
Syntax for passing Parameter through Mashup :
PegaA_params={Context:"ApplicationName",ParamOne:ValueOne,ParamTwo:ValueTwo}
You can pass as many as parameters.
You can access these parameters in pyDefault directly like "Param. ParamOne".
Best,
Mahesh
-
Shrikant Pustode
Maantic Inc
US
Thank you Mahesh@S for quick response, how to pass the value dynamically from host.
PegaA_params={Context:"ApplicationName",ParamOne:ValueOne,ParamTwo:ValueTwo}
Here I need to pass ApplicationName, ValueOne,and ValueTwo dynamically. what is the syntax for it.
ANZ Banking Group Ltd
AU
HI,
Value of application name will be constant as the mashup is for the specific Pega application.
For the value one and value two, you can pass through Java or Javascript object and the value for that object you can set as per your logic.
You can refer the dynamic values like PegaA_params={Context:'<%=AppContext%>',ParamOne:'<%=JavaObject1%>',ParamTwo:"<%=JavaObject2>"}
or ParamTwo:"Value"
-
Praneeth Singirikonda Sureckaa Suthagar
Pegasystems Inc.
AU
Hi Mahesh@S,
How do we use javascript object to pass the value to the pega action param ?
data-pega-action-param-parameters='{UserIdentifier:"xxxxx",Password:"yyyy",ID:"1"}'
I have tried below, but no luck
var action_param = '{UserIdentifier:"xxxxx",Password:"yyyy=",pzUsePreferenceSkin:"always",pzSkinName:"AppSkinTeamB"}';
data-pega-action-param-parameters='JSON.stringify(action_param)'
OR
data-pega-action-param-parameters='<%action_param%>'
Pegasystems Inc.
AU
This how I set the attributes in the DIV block
<script>
var action_param = "{UserIdentifier:'xxxxx',Password:'yyyyy=',pzUsePreferenceSkin:'always',pzSkinName:'AppSkinTeamB'}";
document.getElementById("TestDisplayHarness").setAttribute("data-pega-action-param-parameters", action_param);
</script>
The output is the DIV block with the "data-pega-action-param-parameters" set.
You can check via Chrome's console - document.getElementById("TestDisplayHarness")
Arbetsformedlingen
SE
Hi Guys, I have a question related to the same kind of requirement. I need to pass Operator IDs dynamically as we have multiple operators ( more than 2000), the list of operatoes can increase or decrease , it depends on the required operators.
Currently, I am passing like this our Pega web Mashup Code : data-pega-action-param-parameters={UserIdentifier:"xxxxx.yyyy"}
The Mentioned Operator(xxxx.yyyy) is already exposed to LDAP and is existing in Pega. It will then authenticate via IAC authentication and the auth service will check that the operator is existing in Designer Studio or not. I have modified the Auth Service Activity like if will check the passed operator from mashup that it is existing in Designer Studio or Not, if is existing in both Active Directory and Designer Studio, it will bypass the login screen and authenticate. If it is not existing in the Designer Studio and is existing in LDAP, it will create the operator ID in designer Studio. If the operator ID is not existing ( which is passed from Mashup), which is a very rare scenario, Pega will throw an authentication Error.
I am stuck that how can I pass the Multiple Operators dynamically. Although, out of multiple operators, only one of the operators is supposed to pass.
Is there any way to pass multiple operators IDs dynamically in Pega Web Mashup ?
Pegasystems Inc.
AU
Hello,
Don't use UserIdentifier. You can pass any param.xyz={"LifOfOper","a,b,c,d,e,etc"}. The param.xyz will be available for you to work with in your activity.
Express Scripts
US
Hi, I have similar requirement
How do we pass a hardcoded value in mashup script to clipboard page after launching the script. I am trying to pass value to a property and use that value on my case. I have tried below script
I want to pass something like data-pega-parameters='{ “pyWorkPage.ExternalUserName":"paul"}
I want to use that value(pyWorkPage.ExternalUserName) to show in my New harness when I launch case type in Iframe
Hi, I have similar requirement
How do we pass a hardcoded value in mashup script to clipboard page after launching the script. I am trying to pass value to a property and use that value on my case. I have tried below script
I want to pass something like data-pega-parameters='{ “pyWorkPage.ExternalUserName":"paul"}
I want to use that value(pyWorkPage.ExternalUserName) to show in my New harness when I launch case type in Iframe
<!-- ********************** Begin Pega content ********************** -->
<script src ='https://xxx /PRServlet?pyActivity=pzIncludeMashupScripts'></script>
<div data-pega-gadgetname ='PegaGadget'
data-pega-action ='createNewWork'
data-pega-action-param-classname ='XX-XX-Work-XX'
data-pega-action-param-flowname ='pyStartCase'
data-pega-action-param-model =''
data-pega-isdeferloaded ='false'
data-pega-applicationname ='XXX'
data-pega-threadname ='STANDARD'
data-pega-systemid ='pega'
data-pega-resizetype ='stretch'
data-pega-url ='https://xx/ PRServlet'
data-pega-redirectguests ='true'
data-pega-parameters='{ “pyWorkPage.ExternalUserName":"paul"}
data-pega-action-param-parameters='{"UserIdentifier":"External","Password":"zzzzz"}'></div>
<!-- ********************** End Pega content ********************** -->