Note: If you did not apply a license during the installation of the Corticon.js, add valid license at: C:\Progress\Corticon.js_Work_2.x\license\JSStudio

You can script continuous integration and continuous delivery (CI/CD) when you use the Corticon.js utilities to make changes to software rapidly and iteratively. You can use the corticonJS command line utility with the following options and sub-options:

  • Package rules for deployment
  • Generate a JSON report
  • Generate rule reports
  • Run rule tests

The utility is bundled with the Corticon JavaScript Studio installation in its Utilities/bin directory.

Note: The utilities require jdk-21
corticonJS.bat options
usage: corticonJS
-c,--compile          compile a ruleflow into a decision service
-g,--genJson          generate JSON from Rule Asset
-h,--help                print this message
-r,--report              generate the report for a Corticon asset
-t,--test                   execute tests for a set of ruleflows or rulesheets
--compile options
usage: compile
-b,--bundle <name>     the name of the decision service bundle
-djs,--dependentjs <dependentJS> dependent service callout javascript files
-h,--help              print this message
-i,--input <file>      ruleflow (.erf file) to compile
-o,--output <folder>   folder to place the decision service Javascript bundle in
-p,--platform <target platform> target platform 
				          (Azure, Browser, Google, Lambda, MarkLogic, Node)	
-t,--top <entities>   space separated list of entity names 
				     	  that are expected at the root of the payload
--genJson options
usage: generate JSON report from Rule Asset
-h,--help                   print this message
-i,--input <file>.erf       path to Corticon.js ruleflow
-o,--output <file>.json     fully qualified path for JSON output file
Example:
>corticonJS -g 
-i  "C:\Progress\Corticon.js 2.4\Samples\TutorialJS\TutorialJS\Tutorial-Done\tutorial_example.erf" 
-o "C:\Progress\Corticon.js 2.4\Samples\TutorialJS\TutorialJS\Tutorial-Done\GenerateJSON.json"

A valid license is required to run gen.JSON in Corticon.js Utilities.
The generated JSON will contain a full representation of the decision service, including all rulesheets, rules, and related attributes. The following assets must be accessible to the utility:
  • Vocabulary (.ecore)
  • Rulesheets (.ers)
  • Nested ruleflows (.erf)

If the export is successful, the utility exits with code 0. If the export fails, the utility exits with a non-zero code, and error messages are output to the console and potentially logged for further troubleshooting.

Format of the Generated JSON

The generated JSON contains only the functional aspects of the decision service (rulesheets, rules, conditions, actions, vocabulary, etc.). Formatting information (such as UI-related or presentation data) is not included. The format is consistent with the JSON used by the Corticon AI Assistant.

Usability in CI/CD

The utility integrates smoothly into CI/CD processes, enabling users to export decision services in JSON format for reporting as part of their deployment pipelines.
Note: Get the schema for the JSON representation of the ruleflow at  C:\Progress\Corticon.js 2.4\Javascript Utilities\Doc.
--report options
usage: report
-c,--css <CSS file>         CSS file to use in report
-h,--help                   print this message
-i,--input <file>           Corticon asset (.ecore, .ers, .erf, .ert) to report
-if,--image <image folder>  image folder to copy to output folder
-o,--output <folder>        folder to place the report files in
-p,--project <project name> Corticon project name to use in report
-x,--xslt <XSLT file>       XSLT file to use in report

The files related to reports are in your Corticon.js Work directory's Reports folder.

--test options
usage: test
-a,--all                          run all test sheets in the ruletest
-dj,--dependentjs <dependentJS>   comma separated list of dependent javascript files
-h,--help                         print this message
-i,--input <file>                 comma separated list of input (.ert) files to run, 
                                         wildcards allowed
-o,--output <file>                file to contain output of test run
-s,--sheet <Sheet names>          comma separated list of test sheets to run
Note: The test option requires a valid JavaScript enabled license file (CcLicense.jar) in the Utilities/lib folder.