@5minds/processcube_engine_sdk 6.1.0-develop-c028f8-m209uxnd → 6.1.0-feature-361d3e-m20dodea
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Engine.d.ts +9 -1
- package/dist/EngineEventBus.d.ts +87 -0
- package/dist/EngineEventBusSettings.d.ts +88 -0
- package/dist/EngineEvents/EventPayloads/TerminateProcessInstance.d.ts +1 -0
- package/dist/EngineEvents/index.d.ts +0 -1
- package/dist/EngineRestApiSettings.d.ts +2020 -0
- package/dist/EngineSocketIoSettings.d.ts +62 -0
- package/dist/ExtensionAdapter/NotificationExtensionAdapter.d.ts +4 -4
- package/dist/commonjs/Engine.js.map +1 -1
- package/dist/commonjs/{EngineEvents/Subscription.js → EngineEventBus.js} +1 -1
- package/dist/commonjs/EngineEventBus.js.map +1 -0
- package/dist/commonjs/EngineEventBusSettings.js +95 -0
- package/dist/commonjs/EngineEventBusSettings.js.map +1 -0
- package/dist/commonjs/EngineEvents/index.js +0 -1
- package/dist/commonjs/EngineEvents/index.js.map +1 -1
- package/dist/commonjs/EngineRestApiSettings.js +2052 -0
- package/dist/commonjs/EngineRestApiSettings.js.map +1 -0
- package/dist/commonjs/EngineSocketIoSettings.js +67 -0
- package/dist/commonjs/EngineSocketIoSettings.js.map +1 -0
- package/dist/commonjs/index.js +4 -0
- package/dist/commonjs/index.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/package.json +1 -1
- package/dist/EngineEvents/Subscription.d.ts +0 -26
- package/dist/commonjs/EngineEvents/Subscription.js.map +0 -1
package/dist/Engine.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as express from 'express';
|
|
2
2
|
import { UserTaskInstance } from './DataModels';
|
|
3
3
|
import { Identity } from './DataModels/Iam/index';
|
|
4
|
+
import { ExternalEventBus } from './EngineEventBus';
|
|
4
5
|
import { EngineEventType, MiddlewareCallback } from './EngineEvents/index';
|
|
5
6
|
import { IApplicationInfoExtensionAdapter, ICorrelationExtensionAdapter, ICronjobExtensionAdapter, IDataObjectInstanceExtensionAdapter, IEventExtensionAdapter, IExternalTaskExtensionAdapter, IFlowNodeInstanceExtensionAdapter, IIamExtensionAdapter, IManualTaskExtensionAdapter, INotificationExtensionAdapter, IProcessDefinitionExtensionAdapter, IProcessInstanceExtensionAdapter, IProcessModelExtensionAdapter, IUntypedTaskExtensionAdapter, IUserTaskExtensionAdapter } from './ExtensionAdapter';
|
|
6
7
|
import { EventViewModel, FlowNodeViewModel } from './ProcessModel/index';
|
|
@@ -201,11 +202,18 @@ export type Engine = {
|
|
|
201
202
|
*/
|
|
202
203
|
onBeforeResuming(callback: () => void | Promise<void>): void;
|
|
203
204
|
/**
|
|
204
|
-
* Registers a callback to execute after the Engine has finished starting up.
|
|
205
205
|
*
|
|
206
206
|
* @param callback The callback to call after the Engine has finished starting up.
|
|
207
207
|
*/
|
|
208
208
|
onReady(callback: () => void | Promise<void>): void;
|
|
209
|
+
/**
|
|
210
|
+
* Registers a custom Event Bus, which will replace the Engine's own internal Event Bus.
|
|
211
|
+
*
|
|
212
|
+
* **NOTE:** Can only be used BEFORE the {@link Engine.onReady} Event was fired!
|
|
213
|
+
*
|
|
214
|
+
* @param eventBus A custom {@link ExternalEventBus}.
|
|
215
|
+
*/
|
|
216
|
+
registerCustomEventBus(eventBus: ExternalEventBus): void;
|
|
209
217
|
/**
|
|
210
218
|
* Registers the given callback as an Event Middleware.
|
|
211
219
|
* This middleware gets called whenever a Log Event occurs at the Engine.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines the signature for the Callback that an EventSubscription should have.
|
|
3
|
+
*
|
|
4
|
+
* @param eventPayload Optional: The payload received with the event.
|
|
5
|
+
* @param eventName Optional: The name of the received event.
|
|
6
|
+
*/
|
|
7
|
+
export type EventReceivedCallback = (eventPayload?: any, eventName?: string) => void | Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* Contains information about a subscription on the EngineEventBus.
|
|
10
|
+
* External services can use this information to manage their own subscriptions.
|
|
11
|
+
*/
|
|
12
|
+
export type Subscription = {
|
|
13
|
+
/**
|
|
14
|
+
* The Id under which the EngineEventBus has stored the Subscription.
|
|
15
|
+
*/
|
|
16
|
+
readonly id: string;
|
|
17
|
+
/**
|
|
18
|
+
* The name of the event for which the Subscription was created.
|
|
19
|
+
*/
|
|
20
|
+
readonly eventName: string;
|
|
21
|
+
/**
|
|
22
|
+
* If set to true, the Subscription will be destroyed after first receiving
|
|
23
|
+
* the event.
|
|
24
|
+
*/
|
|
25
|
+
readonly onlyReceiveOnce: boolean;
|
|
26
|
+
};
|
|
27
|
+
export type ExternalSubscription = {
|
|
28
|
+
remove: () => Promise<void>;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* The Event Bus is used by the Engine to manage communications between the individual engine services, as well as all Flow Node Instances and Process Instances.
|
|
32
|
+
*
|
|
33
|
+
* By default, the Engine uses its own EventAggregator.
|
|
34
|
+
*
|
|
35
|
+
* You can replace it with your own, if you want to connect the engine to an external messagebus.
|
|
36
|
+
*/
|
|
37
|
+
export type EngineEventBus = {
|
|
38
|
+
/**
|
|
39
|
+
* Creates a new {@link Subscription} on the EventBus for the event with the given name.
|
|
40
|
+
* The {@link Subscription} will remain active, until manually disposed through the {@link EngineEventBus.unsubscribe} method.
|
|
41
|
+
*
|
|
42
|
+
* @param eventName The name of the Event to subscribe to.
|
|
43
|
+
* @param callback The callback to execute, when the event is received.
|
|
44
|
+
* @returns A {@link Subscription} object.
|
|
45
|
+
*/
|
|
46
|
+
subscribe: (eventName: string, callback: EventReceivedCallback) => Subscription;
|
|
47
|
+
/**
|
|
48
|
+
* Creates a new {@link Subscription} on the EventBus for the event with the given name.
|
|
49
|
+
* The {@link Subscription} is automatically disposed, after the event was received once.
|
|
50
|
+
*
|
|
51
|
+
* @param eventName The name of the Event to subscribe to.
|
|
52
|
+
* @param callback The callback to execute, when the event is received.
|
|
53
|
+
* @returns A {@link Subscription} object.
|
|
54
|
+
*/
|
|
55
|
+
subscribeOnce: (eventName: string, callback: EventReceivedCallback) => Subscription;
|
|
56
|
+
/**
|
|
57
|
+
* Publishes a given event on the EventBus.
|
|
58
|
+
* Usually, this function returns as soon as the Event was published.
|
|
59
|
+
* However, it is possible to wait for all Subscribers to acknowledge receiving the Event, by providing an "onAcknowledgement" Callback function.
|
|
60
|
+
*
|
|
61
|
+
* @param eventName The name of the Event to publish.
|
|
62
|
+
* @param payload The payload to send with the Event.
|
|
63
|
+
* @param onAcknowledgement Optional: The callback to call, after all Subscribers have acknowledged receiving the Event.
|
|
64
|
+
* @param eventId Optional: The Event ID to use.
|
|
65
|
+
*/
|
|
66
|
+
publish: (eventName: string, payload?: Record<string, any>, onAcknowledgement?: () => void, eventId?: string) => void;
|
|
67
|
+
/**
|
|
68
|
+
* Allows a Subscriber to acknowledge the receit of an Event with the given ID.
|
|
69
|
+
*
|
|
70
|
+
* @param eventId The ID of the Event to acknowledge.
|
|
71
|
+
*/
|
|
72
|
+
acknowledgeEvent: (eventId: string) => void;
|
|
73
|
+
/**
|
|
74
|
+
* Disposes the given Event Subscription.
|
|
75
|
+
*
|
|
76
|
+
* @param subscription The Subscription to dispose.
|
|
77
|
+
*/
|
|
78
|
+
unsubscribe: (subscription: Subscription) => void;
|
|
79
|
+
};
|
|
80
|
+
export type ExternalEventBus = {
|
|
81
|
+
subscribeToWorkQueue: (queueName: string, callback: Function) => Promise<ExternalSubscription>;
|
|
82
|
+
subscribeToTopicWithRoutingKey: (topic: string, routingKey: string, callback: Function) => Promise<ExternalSubscription>;
|
|
83
|
+
subscribeToBroadcast: (topic: string, callback: Function) => Promise<ExternalSubscription>;
|
|
84
|
+
publishToWorkQueue: (queueName: string, payload: Record<string, any>) => Promise<void>;
|
|
85
|
+
publishToTopicWithRoutingKey: (topic: string, routingKey: string, payload: Record<string, any>) => Promise<void>;
|
|
86
|
+
publishToBroadcast: (topic: string, payload: Record<string, any>) => Promise<void>;
|
|
87
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export declare const EngineEventBusSettings: {
|
|
2
|
+
messageParams: {
|
|
3
|
+
correlationId: string;
|
|
4
|
+
externalTaskId: string;
|
|
5
|
+
flowNodeInstanceId: string;
|
|
6
|
+
messageReference: string;
|
|
7
|
+
processInstanceId: string;
|
|
8
|
+
triggerValueReference: string;
|
|
9
|
+
processModelId: string;
|
|
10
|
+
signalReference: string;
|
|
11
|
+
};
|
|
12
|
+
messagePaths: {
|
|
13
|
+
activityReached: string;
|
|
14
|
+
activityFinished: string;
|
|
15
|
+
activityCanceled: string;
|
|
16
|
+
boundaryEventTriggered: string;
|
|
17
|
+
boundaryEventFinished: string;
|
|
18
|
+
boundaryEventWaiting: string;
|
|
19
|
+
changeCorrelationMetadata: string;
|
|
20
|
+
correlationMetadataChanged: string;
|
|
21
|
+
cronjobCreated: string;
|
|
22
|
+
cronjobExecuted: string;
|
|
23
|
+
cronjobEnabledChanged: string;
|
|
24
|
+
cronjobStopped: string;
|
|
25
|
+
cronjobUpdated: string;
|
|
26
|
+
cronjobRemoved: string;
|
|
27
|
+
untypedTaskReached: string;
|
|
28
|
+
untypedTaskFinished: string;
|
|
29
|
+
endEventFinished: string;
|
|
30
|
+
externalTaskCreated: string;
|
|
31
|
+
externalTaskExpired: string;
|
|
32
|
+
externalTaskFinished: string;
|
|
33
|
+
externalTaskLocked: string;
|
|
34
|
+
externalTaskUnlocked: string;
|
|
35
|
+
finishExternalTask: string;
|
|
36
|
+
flowNodeEventRetrySending: string;
|
|
37
|
+
intermediateThrowEventTriggered: string;
|
|
38
|
+
intermediateCatchEventReached: string;
|
|
39
|
+
intermediateCatchEventFinished: string;
|
|
40
|
+
manualTaskReached: string;
|
|
41
|
+
manualTaskFinished: string;
|
|
42
|
+
processDeployed: string;
|
|
43
|
+
processUndeployed: string;
|
|
44
|
+
processInstancesDeleted: string;
|
|
45
|
+
processInstanceMetadataChanged: string;
|
|
46
|
+
processExecutableChanged: string;
|
|
47
|
+
startEventFinished: string;
|
|
48
|
+
terminateProcessInstance: string;
|
|
49
|
+
userTaskReached: string;
|
|
50
|
+
userTaskFinished: string;
|
|
51
|
+
userTaskReserved: string;
|
|
52
|
+
userTaskReservationCanceled: string;
|
|
53
|
+
messageOnProcessInstanceTriggered: string;
|
|
54
|
+
messageEventTriggeredOnPath: string;
|
|
55
|
+
messageTriggered: string;
|
|
56
|
+
signalOnProcessInstanceTriggered: string;
|
|
57
|
+
signalEventTriggeredOnPath: string;
|
|
58
|
+
signalTriggered: string;
|
|
59
|
+
tokenPayloadChange: string;
|
|
60
|
+
tokenPayloadChangeFinished: string;
|
|
61
|
+
activityError: string;
|
|
62
|
+
processStarting: string;
|
|
63
|
+
processStarted: string;
|
|
64
|
+
processResumed: string;
|
|
65
|
+
processOwnerChanged: string;
|
|
66
|
+
processEnded: string;
|
|
67
|
+
processError: string;
|
|
68
|
+
processTerminated: string;
|
|
69
|
+
gatewayFinished: string;
|
|
70
|
+
finishUntypedTask: string;
|
|
71
|
+
untypedTaskWithInstanceIdFinished: string;
|
|
72
|
+
finishUserTask: string;
|
|
73
|
+
userTaskWithInstanceIdFinished: string;
|
|
74
|
+
finishManualTask: string;
|
|
75
|
+
manualTaskWithInstanceIdFinished: string;
|
|
76
|
+
endEventReached: string;
|
|
77
|
+
processInstanceWithIdStarted: string;
|
|
78
|
+
processInstanceWithIdEnded: string;
|
|
79
|
+
processInstanceWithIdErrored: string;
|
|
80
|
+
terminateProcessInstanceWithId: string;
|
|
81
|
+
processInstanceWithIdTerminated: string;
|
|
82
|
+
changeProcessInstanceOwner: string;
|
|
83
|
+
processInstanceOwnerChanged: string;
|
|
84
|
+
};
|
|
85
|
+
externalMessagePaths: {
|
|
86
|
+
processStartRequest: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
@@ -3,6 +3,7 @@ import { Identity } from '../../DataModels/Iam/index';
|
|
|
3
3
|
* Encapsulates a message for when a Process Instance gets terminated.
|
|
4
4
|
*/
|
|
5
5
|
export type TerminateProcessInstanceMessage = {
|
|
6
|
+
processInstanceId: string;
|
|
6
7
|
/**
|
|
7
8
|
* If the Process Instance is terminated by a user, this will contain the users identity.
|
|
8
9
|
*/
|
|
@@ -9,7 +9,6 @@ export * from './EventCallbackTypes';
|
|
|
9
9
|
export * from './EngineEvent';
|
|
10
10
|
export * from './EngineEventMiddlewares';
|
|
11
11
|
export * from './EventPayloads/index';
|
|
12
|
-
export * from './Subscription';
|
|
13
12
|
export declare namespace Messages {
|
|
14
13
|
export import EventMessage = eventPayloads.EventMessage;
|
|
15
14
|
export import IConstructor = iConstructor.IConstructor;
|