TransactionManager
runIntegration()
Runs the specified Integration synchronously.
| Name | Type | Description |
|---|---|---|
| gr | GlideRecord | Record that will be used as the Integration's initRecord. |
| integrationId | string | The sys_id of the Integration. |
| operation | "insert" | "update" | "delete" | The operation that triggered the integration. |
| initialInputs | Record<string, any>|undefined | An object that can be used to pass initial inputs to the Integration |
Type
tsfunction runIntegration( gr: GlideRecord, integrationId: string, operation: 'insert' | 'update' | 'delete', initialInputs: Record<string, any> | undefined, ): Record<string, any>;function runIntegration( gr: GlideRecord, integrationId: string, operation: 'insert' | 'update' | 'delete', initialInputs: Record<string, any> | undefined, ): Record<string, any>;Example
js
(function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {
// create an inbound http request that will be used as the Integration's initRecord
var gr = new GlideRecord('x_devol_intgr_mgr_inbound_http_request');
gr.setValue('headers', JSON.stringify(request.headers));
gr.setValue('body', JSON.stringify(request.body.data));
gr.setValue('query', JSON.stringify(request.queryParams));
gr.setValue('uri', request.uri);
gr.setValue('url', request.url);
gr.setValue('method', 'post');
gr.insert();
// define the configuration for the Integration
var integrationId = 'integration_sys_id_goes_here'; // replace the placeholder with the integration's sys_id
var operation = 'insert'; // which operation to pass to the integration
var initialInputs = {}; // this can be used to provide some initial data that will be available as inputs for the first step
// run the integration synchronously
var result = x_devol_intgr_mgr.TransactionManager.runIntegration(
gr,
integrationId,
operation,
initialInputs,
); // this will return the outputs of the last step in the integration
response.setStatus(201);
response.setBody(result);
})(request, response);(function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {
// create an inbound http request that will be used as the Integration's initRecord
var gr = new GlideRecord('x_devol_intgr_mgr_inbound_http_request');
gr.setValue('headers', JSON.stringify(request.headers));
gr.setValue('body', JSON.stringify(request.body.data));
gr.setValue('query', JSON.stringify(request.queryParams));
gr.setValue('uri', request.uri);
gr.setValue('url', request.url);
gr.setValue('method', 'post');
gr.insert();
// define the configuration for the Integration
var integrationId = 'integration_sys_id_goes_here'; // replace the placeholder with the integration's sys_id
var operation = 'insert'; // which operation to pass to the integration
var initialInputs = {}; // this can be used to provide some initial data that will be available as inputs for the first step
// run the integration synchronously
var result = x_devol_intgr_mgr.TransactionManager.runIntegration(
gr,
integrationId,
operation,
initialInputs,
); // this will return the outputs of the last step in the integration
response.setStatus(201);
response.setBody(result);
})(request, response);