Scripting plugin
This plugin reads the batch.xml file of a batch and works upon the given document as per the scripts given in the scripts folder. All the scripts are placed inside "{SharedFolder}batch class folder (ex:-BC1)scripts
For any script there are two ways to write it, either it could be written in IScript or JDOM. For running any type of script user needs to place the script inside the scripts folder inside batch class folder for the respective batch class on which the script needs to be run.
Configurable properties
The following table shows the configurable properties available for the Fuzzy Db plugin in the dcma-scripting-plugin properties file in META_INFdcma-scripting-plugin.
Configurable property | Type of value | Value options | Description |
---|---|---|---|
Script Parser Type |
String |
|
This value defines the type of scripts that will run. There could be two types of scripts that could be run i.e. JDOM and ISCRIPT. For script to run in JDOM user has to give the parser type as "jdom". For script to run in ISCRIPT user has to give the value as "iscript". Default jdom. |
Script Switch |
String |
|
This switch is used to set the execution of scripts on or off. If this switch is off then no script will run otherwise scripts will run. Default ON. |
Script Class Name |
String |
NA |
This tells the user as to what is the name of application level script file. |
Script Folder Name |
String |
NA |
This tells the user about the name of folder where application level script is lying. |
Application Level Script cron Expression |
String |
NA |
This tells the user about the cron job expression. |
Script Optimizer Switch |
String |
|
This property is used to implement the optimization of scripts. |
Example:
Plugin configuration
- Users can set the script switch to on/off for running the scripts and for skipping the execution of scripts respectively.
- If the script switch is on, the parser type mentioned in the Script Parser Type property defines the type of scripts given.
- If the parser type is jdom then the JDOM scripts will run and if any script is present that runs for ISCRIPT then it will give errors and vice versa.
Steps of execution
-
Configure the plugin switch in the configuration file:
META-INF/dcma-scripting-plugin/dcma-scripting-plugin.properties
Also give the parser type for the script to run.
-
Enter the desired script in the scripts folder of the batch class in which you want to run the script in.
There are predefined scripts present in the scripts folder for each batch class. These are the dummy scripts.
-
There is a set format for the naming of the scripts which will be picked as their names are configured.
Therefore, the names of the scripts need to be the same as in the scripts folder. For running any custom script, user needs to make changes to the present script or make its own custom script with same name as predefined scripts and replace the existing script.
Dependency
There is only one dependency of this plugin. The import-batch-folder plugin needs to be executed before scripting-plugin to generate the files required for processing of scripting-plugin. If the batch goes into the Error state then proper logs will be generated in log file kept at {Application}dcma-all.log.
Troubleshooting
The following tale lists a few common error messages that occur due to malfunctioning of the plugin.
Error message | Possible root cause |
---|---|
Script having invalid parser type or invalid arguments. Throwing workflow in error |
This occurs when the entered parser type and the present script types does not match for ex. If parser given is dom and user puts in an iscript script then this error occurs. |
Script error out. Throwing workflow in error. |
This happens when the custom script that has been put error out and needs to be corrected. |