Try OpenEdge Now
skip to main content
BP Server Developer's Guide
Workstep template management : Accesing infopads from BP Server : Accesing infopads from pre and post-JavaScript
 

Accesing infopads from pre and post-JavaScript

This section lists an example of infopad access from pre and post-JavaScript.

Partial code

The partial code for the rule defining the infopad is as follows:
application ScriptInfopad
module ScriptInfopad_rules
initialize{
Scriptpad := new infopad<cell{ageVal:int,nameVal:string,instCtr:int}>[1][1]("Scriptpad");
}finalize{
   discard(Scriptpad);
}
Then the slot values from this infopad can be referred in a prejavascript of a workstep as shown in the following example script:
function getInfopadValues() {
   var age =
Packages.com.savvion.sbm.bizpulse.client.queryservice.QSInfopadService.
getLongSlot("ScriptInfopad::ScriptInfopad_rules::Scriptpad", 1, 1, "ageVal");
   var name =
Packages.com.savvion.sbm.bizpulse.client.queryservice.QSInfopadService.
getStringSlot("ScriptInfopad::ScriptInfopad_rules::Scriptpad", 1, 1, "nameVal");
   var instCtr =
Packages.com.savvion.sbm.bizpulse.client.queryservice.QSInfopadService.
getLongSlot("ScriptInfopad::ScriptInfopad_rules::Scriptpad", 1, 1, "instCtr");
   jst.putDataSlot("InfopadAge", age);
   jst.putDataSlot("InfopadName", name);
   jst.putDataSlot("CreatedInstances", instCtr);
} getInfopadValues()