Add a Custom Hook to a Step Manually
Note: Custom hooks are deprecated. Use interceptors instead.
Before you begin
You need:
- a custom hook module
- a flow configuration with the step to which the hook would be added
Latest MarkLogic releases provide a smarter, simpler, and more secure way to integrate data.
Latest MarkLogic releases provide a smarter, simpler, and more secure way to integrate data.
Join us in Chicago for the biggest global gathering of MarkLogic users and enthusiasts sharing insights on how to Integrate to Innovate.
Join us in Chicago for the biggest global gathering of MarkLogic users and enthusiasts sharing insights on how to Integrate to Innovate.
Be the first to know! News, product information, and events delivered straight to your inbox.
You need:
The following is an example of a flow configuration structure with an ingestion step.
{
"name": "your-flow-name",
"description": "",
"batchSize": 100,
"threadCount": 4,
"options": {
"sourceQuery": null
},
"steps": {
"1": {
"name" : "your-step-name",
"stepDefinitionName" : "your-ingestion-step-def-name",
"description" : null,
"stepDefinitionType" : "INGESTION",
"options" : {
"collections" : [ "your-ingestion-step-name" ],
"outputFormat" : "json",
"targetDatabase" : "data-hub-STAGING"
},
"customHook" : { },
"retryLimit" : 0,
"batchSize" : 100,
"threadCount" : 4,
"fileLocations" : {
"inputFilePath" : "",
"outputURIReplacement" : "",
"inputFileType" : ""
}
}
}
}
steps
node, search for the step
to which to add the hook.step
node, fill in the customhook
node.
"customHook" : {
"module" : "/custom-modules/your-step-type/your-hook-directory/your-hook-module-name.sjs",
"parameters" : {
"myParameter" : "myParameterValue"
},
"user" : "flow-operator",
"runBefore" : false
},
Name | Description |
---|---|
customHook » module | The path to your custom hook module. |
customHook » parameters | Parameters, as key-value pairs, to pass to your custom hook module. |
customHook » user |
The user account to use to run the module. The default is the user running the flow; e.g., flow-operator .
|
customHook » runBefore |
For a pre-step hook, set to true . For a post-step hook, set to false .
|