When packaging for MarkLogic deployment, Corticon.js generates the files:
  • decisionServiceBundle.js: Your rules, obfuscated
  • marklogic.sample.js: Sample MarkLogic wrapper

When invoked, the MarkLogic function is passed a JSON payload. This is most likely triggered by a REST call to invoke the function.

Open marklogic.sample.js to learn how to configure, run as an async function, test, and log with MarkLogic decision services. The wrapper is a complete, ready-to-run, MarkLogic function, yet you can also modify it to meet the specific needs of your application as it is heavily annotated. The MarkLogic API has different signatures for different triggers.

See the MarkLogic documentation for details on deploying serverless functions.