Introduction

Hooks are little scripts that allow you to extend functionality of Nedap Harmony at certain points. This allows you to import data from and export data to other related systems, without requiring additional infrastructure.

The scripts can be programmed in JavaScript, and can leverage the vast ecosystem of JavaScript modules, like HTTP(S) clients, FTP(S) clients, etc.

A hook is started with a trigger, and those triggers can be one of the following:

  • Time-based (based on a CRON expression)
  • Action (you can select which action to trigger)
  • New or updated Document
  • API call (which can be ran from an Application)

JavaScript module

A hook is basically a JavaScript module, with one function. It uses the Node JS callback pattern to indicate errors.

📘

Async function

The function is by default marked as async, you can directly use 'await' statements.

Please see the sub-pages for the exact call description for each type of hook.

Logging

All logging statements in an Hook are stored. You can retrieve those by using the 'Log' link in the Hooks page.

console.log('Some logging')
console.error('AN ERROR HAS HAPPENED')

To debug an Hook, the best way is to use extensive logging.


Did this page help you?