@5minds/processcube_engine
Version:
The ProcessCube Engine. Stores and executes BPMNs.
348 lines • 19 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.NotificationLongPollingController = void 0;
const inversify_1 = require("inversify");
const processcube_engine_sdk_1 = require("@5minds/processcube_engine_sdk");
const Contracts_1 = require("../../Contracts");
const BaseController_1 = require("./BaseController");
let NotificationLongPollingController = class NotificationLongPollingController extends BaseController_1.BaseController {
notificationServiceProxy;
constructor(notificationServiceProxy) {
super();
this.logger = new processcube_engine_sdk_1.Logger('api:long_polling:notification_long_polling_controller');
this.notificationServiceProxy = notificationServiceProxy;
}
async onCronjobCreated(request, response) {
this.logger.debug('Received `on cronjob created` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onCronjobCreated((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onCronjobExecuted(request, response) {
this.logger.debug('Received `on cronjob executed` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onCronjobExecuted((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onCronjobStopped(request, response) {
this.logger.debug('Received `on cronjob stopped` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onCronjobStopped((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onCronjobUpdated(request, response) {
this.logger.debug('Received `on cronjob updated` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onCronjobUpdated((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onCronjobRemoved(request, response) {
this.logger.debug('Received `on cronjob removed` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onCronjobRemoved((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onProcessDeployed(request, response) {
this.logger.debug('Received `on cronjob deployed` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onProcessDeployed((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onProcessUndeployed(request, response) {
this.logger.debug('Received `on cronjob undeployed` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onProcessUndeployed((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onProcessStarting(request, response) {
this.logger.debug('Received `on process starting` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onProcessStarting((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onProcessStarted(request, response) {
this.logger.debug('Received `on process started` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onProcessStarted((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onProcessResumed(request, response) {
this.logger.debug('Received `on process resumed` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onProcessResumed((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onProcessEnded(request, response) {
this.logger.debug('Received `on process ended` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onProcessEnded((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onProcessOwnerChanged(request, response) {
this.logger.debug('Received `on process owner changed` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onProcessOwnerChanged((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onProcessTerminated(request, response) {
this.logger.debug('Received `on process terminated` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onProcessTerminated((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onProcessError(request, response) {
this.logger.debug('Received `on process error` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onProcessError((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onProcessInstancesDeleted(request, response) {
this.logger.debug('Received `on process instances deleted` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onProcessInstancesDeleted((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onProcessIsExecutableChanged(request, response) {
this.logger.debug('Received `on process is executable changed` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onProcessIsExecutableChanged((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onCronjobEnabledChanged(request, response) {
const identity = request.identity;
await this.notificationServiceProxy.onCronjobEnabledChanged((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onActivityReached(request, response) {
this.logger.debug('Received `on activity reached` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onActivityReached((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onActivityFinished(request, response) {
this.logger.debug('Received `on activity finished` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onActivityFinished((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onActivityCanceled(request, response) {
this.logger.debug('Received `on activity canceled` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onActivityCanceled((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onUntypedTaskWaiting(request, response) {
this.logger.debug('Received `on untyped task waiting` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onUntypedTaskWaiting((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onUntypedTaskFinished(request, response) {
this.logger.debug('Received `on untyped task finished` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onUntypedTaskFinished((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onEndEventFinished(request, response) {
this.logger.debug('Received `on end event finished` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onEndEventFinished((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onManualTaskWaiting(request, response) {
this.logger.debug('Received `on manual task waiting` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onManualTaskWaiting((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onManualTaskFinished(request, response) {
this.logger.debug('Received `on manual task finished` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onManualTaskFinished((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onStartEventFinished(request, response) {
this.logger.debug('Received `on start event finished` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onStartEventFinished((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onUserTaskWaiting(request, response) {
this.logger.debug('Received `on user task waiting` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onUserTaskWaiting((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onUserTaskFinished(request, response) {
this.logger.debug('Received `on user task finished` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onUserTaskFinished((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onUserTaskReserved(request, response) {
this.logger.debug('Received `on user task reserved` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onUserTaskReserved((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onUserTaskReservationCanceled(request, response) {
this.logger.debug('Received `on user task reservation canceled` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onUserTaskReservationCanceled((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onBoundaryEventWaiting(request, response) {
this.logger.debug('Received `on boundary event waiting` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onBoundaryEventWaiting((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onBoundaryEventTriggered(request, response) {
this.logger.debug('Received `on boundary event triggered` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onBoundaryEventTriggered((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onBoundaryEventFinished(request, response) {
this.logger.debug('Received `on boundary event finished` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onBoundaryEventFinished((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onIntermediateThrowEventTriggered(request, response) {
this.logger.debug('Received `on intermediate throw event triggered` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onIntermediateThrowEventTriggered((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onIntermediateCatchEventReached(request, response) {
this.logger.debug('Received `on intermediate catch event reached` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onIntermediateCatchEventReached((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onIntermediateCatchEventFinished(request, response) {
this.logger.debug('Received `on intermediate catch event finished` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onIntermediateCatchEventFinished((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onFlowNodeEventRetrySending(request, response) {
this.logger.debug('Received `on flow node event retry sending` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onFlowNodeEventRetrySending((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onMessageTriggered(request, response) {
this.logger.debug('Received `on message triggered` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onMessageTriggered((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onSignalTriggered(request, response) {
this.logger.debug('Received `on signal triggered` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onSignalTriggered((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onExternalTaskCreated(request, response) {
this.logger.debug('Received `on external task created` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onExternalTaskCreated((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onExternalTaskLocked(request, response) {
this.logger.debug('Received `on external task locked` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onExternalTaskLocked((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onExternalTaskUnlocked(request, response) {
this.logger.debug('Received `on external task unlocked` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onExternalTaskUnlocked((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onExternalTaskExpired(request, response) {
this.logger.debug('Received `on external task expired` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onExternalTaskExpired((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onProcessInstanceMetadataChanged(request, response) {
this.logger.debug('Received `on process instance metadata changed` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onProcessInstanceMetadataChanged((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
async onCorrelationMetadataChanged(request, response) {
this.logger.debug('Received `on correlation metadata changed` long polling subscription');
const identity = request.identity;
await this.notificationServiceProxy.onCorrelationMetadataChanged((message) => {
response.status(this.httpCodeSuccessfulResponse).json(message);
}, true, identity);
}
};
exports.NotificationLongPollingController = NotificationLongPollingController;
exports.NotificationLongPollingController = NotificationLongPollingController = __decorate([
(0, inversify_1.injectable)(),
__param(0, (0, inversify_1.inject)(Contracts_1.IocRegistrationKeys.api.services.NotificationServiceProxy)),
__metadata("design:paramtypes", [Object])
], NotificationLongPollingController);
//# sourceMappingURL=NotificationLongPollingController.js.map