UNPKG

@5minds/processcube_engine

Version:

The ProcessCube Engine. Stores and executes BPMNs.

85 lines 11.8 kB
"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.RuntimeNotificationLongPollingController = void 0; const inversify_1 = require("inversify"); const index_1 = require("../../Contracts/index"); const index_2 = require("../../Tools/Iam/index"); const SocketController_1 = require("./SocketController"); let RuntimeNotificationLongPollingController = class RuntimeNotificationLongPollingController extends SocketController_1.SocketController { notificationServiceProxy; identityService; subscriptions = []; constructor(notificationServiceProxy, IdentityService) { super(); this.notificationServiceProxy = notificationServiceProxy; this.identityService = IdentityService; } async registerEvents() { const internalIdentity = await this.identityService.getInternalIdentity(); this.subscriptions.push(await this.notificationServiceProxy.onActivityError((message) => this.publishMessage(index_1.socketSettings.paths.activityError, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onCronjobCreated((message) => this.publishMessage(index_1.socketSettings.paths.cronjobCreated, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onCronjobExecuted((message) => this.publishMessage(index_1.socketSettings.paths.cronjobExecuted, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onCronjobStopped((message) => this.publishMessage(index_1.socketSettings.paths.cronjobStopped, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onCronjobUpdated((message) => this.publishMessage(index_1.socketSettings.paths.cronjobUpdated, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onCronjobRemoved((message) => this.publishMessage(index_1.socketSettings.paths.cronjobRemoved, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onProcessDeployed((message) => this.publishMessage(index_1.socketSettings.paths.processDeployed, message, true), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onProcessIsExecutableChanged((message) => this.publishMessage(index_1.socketSettings.paths.processExecutableChanged, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onCronjobEnabledChanged((message) => this.publishMessage(index_1.socketSettings.paths.cronjobEnabledChanged, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onProcessUndeployed((message) => this.publishMessage(index_1.socketSettings.paths.processUndeployed, message, true), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onProcessStarting((message) => this.publishMessage(index_1.socketSettings.paths.processStarting, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onProcessStarted((message) => this.publishMessage(index_1.socketSettings.paths.processStarted, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onProcessResumed((message) => this.publishMessage(index_1.socketSettings.paths.processResumed, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onProcessEnded((message) => this.publishMessage(index_1.socketSettings.paths.processEnded, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onProcessOwnerChanged((message) => this.publishMessage(index_1.socketSettings.paths.processInstanceOwnerChanged, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onProcessTerminated((message) => this.publishMessage(index_1.socketSettings.paths.processTerminated, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onProcessError((message) => this.publishMessage(index_1.socketSettings.paths.processError, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onProcessInstancesDeleted((message) => this.publishMessage(index_1.socketSettings.paths.processInstancesDeleted, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onActivityReached((message) => this.publishMessage(index_1.socketSettings.paths.activityReached, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onActivityFinished((message) => this.publishMessage(index_1.socketSettings.paths.activityFinished, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onActivityCanceled((message) => this.publishMessage(index_1.socketSettings.paths.activityCanceled, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onUntypedTaskWaiting((message) => this.publishMessage(index_1.socketSettings.paths.untypedTaskWaiting, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onUntypedTaskFinished((message) => this.publishMessage(index_1.socketSettings.paths.untypedTaskFinished, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onEndEventFinished((message) => this.publishMessage(index_1.socketSettings.paths.endEventFinished, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onStartEventFinished((message) => this.publishMessage(index_1.socketSettings.paths.startEventFinished, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onManualTaskWaiting((message) => this.publishMessage(index_1.socketSettings.paths.manualTaskWaiting, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onManualTaskFinished((message) => this.publishMessage(index_1.socketSettings.paths.manualTaskFinished, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onUserTaskWaiting((message) => this.publishMessage(index_1.socketSettings.paths.userTaskWaiting, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onUserTaskFinished((message) => this.publishMessage(index_1.socketSettings.paths.userTaskFinished, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onUserTaskReserved((message) => this.publishMessage(index_1.socketSettings.paths.userTaskReserved, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onUserTaskReservationCanceled((message) => this.publishMessage(index_1.socketSettings.paths.userTaskReservationCanceled, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onBoundaryEventWaiting((message) => this.publishMessage(index_1.socketSettings.paths.boundaryEventWaiting, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onBoundaryEventTriggered((message) => this.publishMessage(index_1.socketSettings.paths.boundaryEventTriggered, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onBoundaryEventFinished((message) => this.publishMessage(index_1.socketSettings.paths.boundaryEventFinished, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onIntermediateThrowEventTriggered((message) => this.publishMessage(index_1.socketSettings.paths.intermediateThrowEventTriggered, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onIntermediateCatchEventReached((message) => this.publishMessage(index_1.socketSettings.paths.intermediateCatchEventReached, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onIntermediateCatchEventFinished((message) => this.publishMessage(index_1.socketSettings.paths.intermediateCatchEventFinished, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onFlowNodeEventRetrySending((message) => this.publishMessage(index_1.socketSettings.paths.flowNodeEventRetrySending, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onMessageTriggered((message) => this.publishMessage(index_1.socketSettings.paths.messageTriggered, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onSignalTriggered((message) => this.publishMessage(index_1.socketSettings.paths.signalTriggered, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onExternalTaskCreated((message) => this.publishMessage(index_1.socketSettings.paths.externalTaskCreated, message, true), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onProcessInstanceMetadataChanged((message) => this.publishMessage(index_1.socketSettings.paths.processInstanceMetadataChanged, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onCorrelationMetadataChanged((message) => this.publishMessage(index_1.socketSettings.paths.correlationMetadataChanged, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onGatewayReached((message) => this.publishMessage(index_1.socketSettings.paths.gatewayReached, message), false, internalIdentity)); this.subscriptions.push(await this.notificationServiceProxy.onGatewayFinished((message) => this.publishMessage(index_1.socketSettings.paths.gatewayFinished, message), false, internalIdentity)); } }; exports.RuntimeNotificationLongPollingController = RuntimeNotificationLongPollingController; exports.RuntimeNotificationLongPollingController = RuntimeNotificationLongPollingController = __decorate([ (0, inversify_1.injectable)(), __param(0, (0, inversify_1.inject)(index_1.IocRegistrationKeys.api.services.NotificationServiceProxy)), __param(1, (0, inversify_1.inject)(index_1.IocRegistrationKeys.internal.IdentityService)), __metadata("design:paramtypes", [Object, index_2.IdentityService]) ], RuntimeNotificationLongPollingController); //# sourceMappingURL=RuntimeNotificationSocketController.js.map