@5minds/processcube_engine
Version:
The ProcessCube Engine. Stores and executes BPMNs.
355 lines • 20.9 kB
JavaScript
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.NotificationExtensionAdapter = void 0;
const inversify_1 = require("inversify");
const processcube_engine_sdk_1 = require("@5minds/processcube_engine_sdk");
const Services_1 = require("../../../Api/Services");
const Contracts_1 = require("../../../Contracts");
const Iam_1 = require("../../Iam");
let NotificationExtensionAdapter = class NotificationExtensionAdapter {
identityService;
logger;
notificationService;
constructor(notificationService, identityService) {
this.identityService = identityService;
this.logger = new processcube_engine_sdk_1.Logger('api:extension_adapter:notification_extension_adapter');
this.notificationService = notificationService;
}
removeSubscription(subscription) {
return this.notificationService.removeSubscription(subscription);
}
async onActivityError(callback, options) {
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onActivityError(callback, options?.subscribeOnce, identityToUse);
}
async onProcessDeployed(callback, options) {
this.logger.debug('Received `on process deployed` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onProcessDeployed(callback, options?.subscribeOnce, identityToUse);
}
async onProcessUndeployed(callback, options) {
this.logger.debug('Received `on process undeployed` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onProcessUndeployed(callback, options?.subscribeOnce, identityToUse);
}
async onProcessIsExecutableChanged(callback, options) {
this.logger.debug('Received `on process is executable` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onProcessIsExecutableChanged(callback, options?.subscribeOnce, identityToUse);
}
async onCronjobEnabledChanged(callback, options) {
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onCronjobEnabledChanged(callback, options?.subscribeOnce, identityToUse);
}
async onProcessStarting(callback, options) {
this.logger.debug('Received `on process starting` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onProcessStarting(callback, options?.subscribeOnce, identityToUse);
}
async onProcessStarted(callback, options) {
this.logger.debug('Received `on process started` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onProcessStarted(callback, options?.subscribeOnce, identityToUse);
}
async onProcessResumed(callback, options) {
this.logger.debug('Received `on process resumed` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onProcessResumed(callback, options?.subscribeOnce, identityToUse);
}
async onProcessEnded(callback, options) {
this.logger.debug('Received `on process ended` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onProcessEnded(callback, options?.subscribeOnce, identityToUse);
}
async onProcessOwnerChanged(callback, options) {
this.logger.debug('Received `on process owner changed` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onProcessOwnerChanged(callback, options?.subscribeOnce, identityToUse);
}
async onProcessTerminated(callback, options) {
this.logger.debug('Received `on process terminated` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onProcessTerminated(callback, options?.subscribeOnce, identityToUse);
}
async onProcessError(callback, options) {
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onProcessError(callback, options?.subscribeOnce, identityToUse);
}
async onProcessInstancesDeleted(callback, options) {
this.logger.debug('Received `on process instances deleted` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onProcessInstancesDeleted(callback, options?.subscribeOnce, identityToUse);
}
async onCronjobCreated(callback, options) {
this.logger.debug('Received `on cronjob created` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onCronjobCreated(callback, options?.subscribeOnce, identityToUse);
}
async onCronjobStopped(callback, options) {
this.logger.debug('Received `on cronjob stopped` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onCronjobStopped(callback, options?.subscribeOnce, identityToUse);
}
async onCronjobUpdated(callback, options) {
this.logger.debug('Received `on cronjob updated` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onCronjobUpdated(callback, options?.subscribeOnce, identityToUse);
}
async onCronjobExecuted(callback, options) {
this.logger.debug('Received `on cronjob executed` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onCronjobExecuted(callback, options?.subscribeOnce, identityToUse);
}
async onCronjobRemoved(callback, options) {
this.logger.debug('Received `on cronjob removed` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onCronjobRemoved(callback, options?.subscribeOnce, identityToUse);
}
async onActivityReached(callback, options) {
this.logger.debug('Received `on activity reached` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onActivityReached(callback, options?.subscribeOnce, identityToUse);
}
async onActivityFinished(callback, options) {
this.logger.debug('Received `on activity finished` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onActivityFinished(callback, options?.subscribeOnce, identityToUse);
}
async onActivityCanceled(callback, options) {
this.logger.debug('Received `on activity canceled` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onActivityCanceled(callback, options?.subscribeOnce, identityToUse);
}
async onUntypedTaskWaiting(callback, options) {
this.logger.debug('Received `on untyped task waiting` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onUntypedTaskWaiting(callback, options?.subscribeOnce, identityToUse);
}
async onUntypedTaskFinished(callback, options) {
this.logger.debug('Received `on untyped task finished` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onUntypedTaskFinished(callback, options?.subscribeOnce, identityToUse);
}
async onManualTaskWaiting(callback, options) {
this.logger.debug('Received `on manual task waiting` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onManualTaskWaiting(callback, options?.subscribeOnce, identityToUse);
}
async onManualTaskFinished(callback, options) {
this.logger.debug('Received `on manual task finished` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onManualTaskFinished(callback, options?.subscribeOnce, identityToUse);
}
async onUserTaskWaiting(callback, options) {
this.logger.debug('Received `on user task waiting` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onUserTaskWaiting(callback, options?.subscribeOnce, identityToUse);
}
async onUserTaskFinished(callback, options) {
this.logger.debug('Received `on user task finished` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onUserTaskFinished(callback, options?.subscribeOnce, identityToUse);
}
async onUserTaskReserved(callback, options) {
this.logger.debug('Received `on user task reserved` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onUserTaskReserved(callback, options?.subscribeOnce, identityToUse);
}
async onUserTaskReservationCanceled(callback, options) {
this.logger.debug('Received `on user task reservation canceled` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onUserTaskReservationCanceled(callback, options?.subscribeOnce, identityToUse);
}
async onBoundaryEventWaiting(callback, options) {
this.logger.debug('Received `on boundary event waiting` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onBoundaryEventWaiting(callback, options?.subscribeOnce, identityToUse);
}
async onBoundaryEventTriggered(callback, options) {
this.logger.debug('Received `on boundary event triggered` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onBoundaryEventTriggered(callback, options?.subscribeOnce, identityToUse);
}
async onBoundaryEventFinished(callback, options) {
this.logger.debug('Received `on boundary event finished` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onBoundaryEventFinished(callback, options?.subscribeOnce, identityToUse);
}
async onIntermediateThrowEventTriggered(callback, options) {
this.logger.debug('Received `on intermediate throw event triggered` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onIntermediateThrowEventTriggered(callback, options?.subscribeOnce, identityToUse);
}
async onIntermediateCatchEventReached(callback, options) {
this.logger.debug('Received `on intermediate catch event reached` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onIntermediateCatchEventReached(callback, options?.subscribeOnce, identityToUse);
}
async onIntermediateCatchEventFinished(callback, options) {
this.logger.debug('Received `on intermediate catch event finished` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onIntermediateCatchEventFinished(callback, options?.subscribeOnce, identityToUse);
}
async onFlowNodeEventRetrySending(callback, options) {
this.logger.debug('Received `on flow node event retry sending` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onFlowNodeEventRetrySending(callback, options?.subscribeOnce, identityToUse);
}
async onMessageTriggered(callback, options) {
this.logger.debug('Received `on message triggered` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onMessageTriggered(callback, options?.subscribeOnce, identityToUse);
}
async onSignalTriggered(callback, options) {
this.logger.debug('Received `on signal triggered` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onSignalTriggered(callback, options?.subscribeOnce, identityToUse);
}
async onStartEventFinished(callback, options) {
this.logger.debug('Received `on start event finished` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onStartEventFinished(callback, options?.subscribeOnce, identityToUse);
}
async onEndEventFinished(callback, options) {
this.logger.debug('Received `on end event finished` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onEndEventFinished(callback, options?.subscribeOnce, identityToUse);
}
async onExternalTaskCreated(callback, options) {
this.logger.debug('Received `on external task created` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onExternalTaskCreated(callback, options?.subscribeOnce, identityToUse);
}
async onExternalTaskLocked(callback, options) {
this.logger.debug('Received `on external task locked` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onExternalTaskLocked(callback, options?.subscribeOnce, identityToUse);
}
async onExternalTaskUnlocked(callback, options) {
this.logger.debug('Received `on external task unlocked` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onExternalTaskUnlocked(callback, options?.subscribeOnce, identityToUse);
}
async onProcessInstanceMetadataChanged(callback, options) {
this.logger.debug('Received `on process instance metadata changed` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onProcessInstanceMetadataChanged(callback, options?.subscribeOnce, identityToUse);
}
async onCorrelationMetadataChanged(callback, options) {
this.logger.debug('Received `on correlation metadata changed` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onCorrelationMetadataChanged(callback, options?.subscribeOnce, identityToUse);
}
async onGatewayFinished(callback, options) {
this.logger.debug('Received `on gateway finished` extension subscription', {
options: options,
});
const identityToUse = await this.identityService.getIdentityForExtensionAdapters(options?.identity);
return this.notificationService.onGatewayFinished(callback, options?.subscribeOnce, identityToUse);
}
};
exports.NotificationExtensionAdapter = NotificationExtensionAdapter;
exports.NotificationExtensionAdapter = NotificationExtensionAdapter = __decorate([
(0, inversify_1.injectable)(),
__param(0, (0, inversify_1.inject)(Contracts_1.IocRegistrationKeys.api.services.NotificationService)),
__param(1, (0, inversify_1.inject)(Contracts_1.IocRegistrationKeys.internal.IdentityService)),
__metadata("design:paramtypes", [Services_1.NotificationService,
Iam_1.IdentityService])
], NotificationExtensionAdapter);
//# sourceMappingURL=NotificationExtensionAdapter.js.map