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
Scriptpad := new infopad<cell{ageVal:int,nameVal:string,instCtr:int}>[1][1]("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 =
getLongSlot("ScriptInfopad::ScriptInfopad_rules::Scriptpad", 1, 1, "ageVal");
   var name =
getStringSlot("ScriptInfopad::ScriptInfopad_rules::Scriptpad", 1, 1, "nameVal");
   var instCtr =
getLongSlot("ScriptInfopad::ScriptInfopad_rules::Scriptpad", 1, 1, "instCtr");
   jst.putDataSlot("InfopadAge", age);
   jst.putDataSlot("InfopadName", name);
   jst.putDataSlot("CreatedInstances", instCtr);
} getInfopadValues()