Many rule applications need to access external data within the context of rules. The service callout feature in Corticon.js provides users with ways to enrich their JSON payload from external data. The most typical case is for payload enrichment where a fragment of the payload to be processed is passed to a decision service and the rules determine what additional data is needed.

You determine the implementation of the callouts in Ruleflow nodes. You can provide an implementation to access external data sources as well as one to access the payload being processed; thereby, enabling you to:
  • Execute custom JavaScript code that can change the payload by doing various computations and data manipulations, or by accessing external data.
  • Enrich the payload with data retrieved from an external data source.
  • Persist the payload, or a portion of it, in an external data source.
Note: corticon.js-samples repository—The samples referenced in this document are derived from GitHub samples in the repository for Corticon.js, Corticon.js Samples Repository. You could export the entire zip at the root level and import the .zip subset ServiceCallout into a workspace to ensure that the assets use the correct extensions. Then run Upgrade rule assets to get the files updated. Be sure to add the .js files to the project's Properties tab Corticon.js Extensions.