Try OpenEdge Now
skip to main content
Application Developer's Guide
Developing an application : Using JavaScript in a workstep : Integrating JavaScript : Including a driver function
 
Including a driver function
You can define as many JavaScript functions as you need for the Before Activation, When Completed, or On Recovery sections of any workstep. However, you must define one driver function.
For example, f3 would serve as the driver function in the following code, and is the one that would be invoked.
function f1() {
         . . .;
}function f2() {
         . . .;
         var x=f1(); return(100)
}function f3() { /* driver function */
         . . .;
         var z = f2();
         . . .;
} f3()
Note: If the driver function returns a value to the caller (which happens to be the BP Server), then this value is ignored. However, all other JavaScript functions may return a value, as required.