Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
subscription.session.createMonitoredItems(createMonitorItemsRequest, function (err, response) {
/* istanbul ignore next */
if (err) {
//xx console.log("ClientMonitoredItemBase#_toolbox_monitor: ERROR in createMonitoredItems ".red, err.message);
//xx console.log("ClientMonitoredItemBase#_toolbox_monitor: ERROR in createMonitoredItems ".red, err);
//xx console.log(createMonitorItemsRequest.toString());
} else {
assert(response instanceof subscription_service.CreateMonitoredItemsResponse);
for (let i = 0; i < response.results.length; i++) {
const monitoredItemResult = response.results[i];
const monitoredItem = monitoredItems[i];
monitoredItem._after_create(monitoredItemResult);
}
}
done(err);
});
subscription.session.createMonitoredItems(createMonitorItemsRequest, function (err, response) {
if (!err) {
assert(response instanceof subscription_service.CreateMonitoredItemsResponse);
const monitoredItemResults = response.results;
monitoredItemResults.forEach(function (monitoredItemResult, index) {
const clientHandle = itemsToCreate[index].requestedParameters.clientHandle;
const monitoredItem = subscription.monitoredItems[clientHandle];
if (monitoredItemResult.statusCode === StatusCodes.Good) {
monitoredItem.result = monitoredItemResult;
monitoredItem.monitoredItemId = monitoredItemResult.monitoredItemId;
monitoredItem.monitoringParameters.samplingInterval = monitoredItemResult.revisedSamplingInterval;
monitoredItem.monitoringParameters.queueSize = monitoredItemResult.revisedQueueSize;
monitoredItem.filterResult = monitoredItemResult.filterResult;
// istanbul ignore next
g_session.createMonitoredItems(request, function (err, response) {
if (!err) {
response.should.be.instanceof(subscription_service.CreateMonitoredItemsResponse);
}
done(err);
});
});
ClientSession.prototype.createMonitoredItems = function (options, callback) {
this._defaultRequest(
subscription_service.CreateMonitoredItemsRequest,
subscription_service.CreateMonitoredItemsResponse,
options, callback);
};
const RepublishResponse = subscription_service.RepublishResponse;
const PublishRequest = subscription_service.PublishRequest;
const PublishResponse = subscription_service.PublishResponse;
const CreateSubscriptionRequest = subscription_service.CreateSubscriptionRequest;
const CreateSubscriptionResponse = subscription_service.CreateSubscriptionResponse;
const DeleteSubscriptionsRequest = subscription_service.DeleteSubscriptionsRequest;
const DeleteSubscriptionsResponse = subscription_service.DeleteSubscriptionsResponse;
const TransferSubscriptionsRequest = subscription_service.TransferSubscriptionsRequest;
const TransferSubscriptionsResponse = subscription_service.TransferSubscriptionsResponse;
const CreateMonitoredItemsRequest = subscription_service.CreateMonitoredItemsRequest;
const CreateMonitoredItemsResponse = subscription_service.CreateMonitoredItemsResponse;
const ModifyMonitoredItemsRequest = subscription_service.ModifyMonitoredItemsRequest;
const ModifyMonitoredItemsResponse = subscription_service.ModifyMonitoredItemsResponse;
const MonitoredItemModifyResult = subscription_service.MonitoredItemModifyResult;
const MonitoredItemCreateResult = subscription_service.MonitoredItemCreateResult;
const SetPublishingModeRequest = subscription_service.SetPublishingModeRequest;
const SetPublishingModeResponse = subscription_service.SetPublishingModeResponse;
const CallRequest = call_service.CallRequest;
const CallResponse = call_service.CallResponse;
const ReadRequest = read_service.ReadRequest;
const ReadResponse = read_service.ReadResponse;
const WriteRequest = write_service.WriteRequest;