Part I of this subject provided theoretical information as how “common.js” can be used increase reusability for pre/post scripts of Savvion BPM process template. Below are guidelines and detailed approach to using “common.js”.
Design/Implementation of “common.js” approach
1). Look for “common.js” file in “<%SBM_HOME %> /BizLogic” location.
2). If it is not available create a new file.
3). If it is available, edit the same file.
pre_common_workstep & post_common_workstep functions – This section will contain only two java script functions which will be used across all the prescripts and postscripts.
Refer to below snapshot for implementation logic for Section 1.
Common functions used at multiple pre/post scripts – This section will contain those common functions which are required to be used for multiple pre/post scripts.
Refer to below snapshot for implementation logic for Section 2.
Activity wise implementation of the prescript/postscript functions – This section will contain the actual implementation of the pre/post script functions.
Refer to below snapshot for implementation logic for Section 3.
As “common.js” is shared across all the process templates deployed on SBM Server, the merging and managing of the common.js must be done manually. This must not be kept as part of the “CommonResourcesProject”.