Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Script modules are used to define common use commonly used library functions. Modules can be called from pre work, post work like server environment, or form and validation rule like client environment.

Modules are always executed in an isolated environment, and does do not automatically import any process related variable.

...

  1. Click "+" icon from "Script Modules"
  2. Specify the module name. Because module name used in a script environment, whitespace or other punctuation chars cannot be used.
  3. Modify the module content as a following script:
Code Block
function privateSum(a,b) {
    return a+b;
}


function publicSum(a,b) {
	return privateSum(a,b);
}

exports.sum = publicSum;

...

Modules may contain one or more functions to structure content and reusability, but not all functions are exported to the outside of a module. If you want to expose a function to the outside world, function must be added to "exports" object.

...

Modules are always executed as synchronous context in server environment, but because of the browser limitations, client side modules can be renamed as "functionAsync" and return a javascript promise object to support asynchronous context. For example same module can be called as following example;

...