Reusability for pre/post scripts feature of Savvion BPM using common.js: Part I

Reusability-for-prepost-scripts-feature-of-Savvion-BPM-using-common-js Part I

BPM Process architecture and design must consider following for development plan:

  • Maximum reusability of the components
  • Avoid the deployment of the entire BPM Process (.spt) resources as much as possible.
  • Savvion Common Resources Project helps address above two points in the areas like custom adapters java code, third party integration code, common logger, property readers and so on.
  • The real challenge is identified when design requires the pre/post script’s code to be separated out from the BPM Process Template (.spt) and keep the code as part of some javascript file which is available to be used inside pre/post script.

One can address such design requirement using common.js” as explained below:

Introduction to “common.js”

  • “common.js” is the server side java script file which server loads at the time of Bizlogic Server startup from “<%SBM_HOME %> /BizLogic” location.
  • Bizlogic server expects this file to contain the server side javascript code.
  • If any syntax error available in “common.js” file, server startup will be fail and the logs will have information on the syntax error(s).
  • By default “common.js” file will not be available in the SBM installation directory. So if design approach requires “common.js” file to be used, one needs to create a new file with the name as “common.js” and place it at “<%SBM_HOME %> /BizLogic” location.
  • All the out of the box functions available for post/pre script (For example: jst.putDataslot, jst.getDataslotValue, etc.) are available to be used inside “common.js” file.


  • Savvion Server requires exact name for this server side javascript file – “common.js”.
  • “common.js” file will be shared across all the applications deployed on the SBM server.
  • At the time of redeployment, a special care must be taken for such approach as it is shared across the process templates deployed on SBM server.
  • Any change to this file requires to restart Bizlogic server in order to take effect.


  • Reusability of the common functions used across the multiple pre/post scripts
  • Java script Code will be cleaner.
  • The maintenance of the code will be far easier.
  • Change to the common function requires to be updated at one place only – This reduces the chances of defects.
  • If process requires only post/pre script modification, this approach does not require to refresh the process template. This can be achieved only by replacing the “common.js” file and server restart.

This is the most powerful feature about “common.js” approach.
Most of the times in production environment, stake holder likes to avoid the entire BPM process (.spt) deployment (Refresh the .spt) for any change in pre/post script.
In such scenarios, “common.js” approach is really helpful to avoid the risk factor while making the changes to post/pre script of the BPM Process.
In next Blog we will get into more details about how to develop and use “common.js” file.

Happy reading

Comments are closed.


Subscribe to get the latest updates on RPA, AI, and Hyperautomation.