Creating & Configuring Process Hooks

Learn how external system process hooks are hosted, coded, and configured with the DirectScale system.

👍

Best Practice for Self-Hosted Web Applications

The Directscale Corporate Admin Application is Hosted with Azure in their West US Datacenter. Process hooks execute synchronously and add overhead to the Directscale system. It is recommended that clients host Web Applications with Azure in their West US Datacenter to reduce the latency of calling the External System. Learn more by reading Writing and Hosting Client Web Applications

👋 Make sure to read this content before continuing


Coding Process Hooks


Scenario #1: Coding a Before Hook

Scenario #2: Coding an After Hook

Scenario #3: Use a Directscale Service in a Hook

❗️

Scenario 3 adds logic to the Orders.SubmitOrder Hook for demonstrating how to use a Directscale service in a Process Hook. Any logic added to a Process Hook decreases the performance of Directscale systems. Process Hooks should only change logic like Scenarios 1 & 2. This scenario would be most performant if it was coded as a WebHook. Reference Coding a WebHook to see this scenario implemented as a Webhook.


Configuring Process Hooks


📘

For Clients using the Client Extension

Configurations are managed by the Client Extension and should not be updated with the UI. Find out more about how configurations are managed by reading Deploying The Client Extension

  1. Navigate to your Corporate Admin instance.
  2. Select Tools, then Developer Tools from the main menu.
  3. Click on Process Hooks.
  4. Use the search field to locate the name of the Event you want to hook and click on the Hook Name.
  5. Enter the Endpoint that implements the custom Process Hook logic.
    • Example: https://acme.clientextension.directscale.com/hooks/Orders/SubmitOrder

👍

Pro Tip:

Click Models for JSON examples of the payload Directscale sends and expects to receive.

892

Figure 1. Process Hook configuration modal in Corporate Admin


🚧

Warning displayed if using the Client Extension

Process Hook configurations are updated to the configurations made in the source code of the Client Extension each time it is deployed. The yellow warning displayed in Figure 1 will appear if the Client Extension solution is enabled for a client.