@acorex/platform 21.0.0-next.8 → 21.0.0-next.83
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/contracts/README.md +3 -0
- package/fesm2022/acorex-platform-auth.mjs +201 -81
- package/fesm2022/acorex-platform-auth.mjs.map +1 -1
- package/fesm2022/acorex-platform-common-common-settings.provider-Ytey9uhY.mjs +177 -0
- package/fesm2022/acorex-platform-common-common-settings.provider-Ytey9uhY.mjs.map +1 -0
- package/fesm2022/acorex-platform-common.mjs +4490 -880
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-contracts.mjs +38 -0
- package/fesm2022/acorex-platform-contracts.mjs.map +1 -0
- package/fesm2022/acorex-platform-core.mjs +2612 -667
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-domain.mjs +557 -826
- package/fesm2022/acorex-platform-domain.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +1255 -209
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-components-binding-expression-editor-popup.component-CXEdvDTf.mjs +121 -0
- package/fesm2022/acorex-platform-layout-components-binding-expression-editor-popup.component-CXEdvDTf.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-components.mjs +6486 -1915
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +612 -287
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity-attachments-page.component-CwG6n_Yb.mjs +376 -0
- package/fesm2022/acorex-platform-layout-entity-attachments-page.component-CwG6n_Yb.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-entity-file-list-popup.component--IeMZLIr.mjs +100 -0
- package/fesm2022/acorex-platform-layout-entity-file-list-popup.component--IeMZLIr.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-entity.mjs +22502 -9964
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-views.mjs +1360 -338
- package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widget-core.mjs +2226 -524
- package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
- package/fesm2022/{acorex-platform-layout-widgets-button-widget-designer.component-C3VoBb_b.mjs → acorex-platform-layout-widgets-button-widget-designer.component-Dy7jF-oD.mjs} +10 -10
- package/fesm2022/acorex-platform-layout-widgets-button-widget-designer.component-Dy7jF-oD.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-image-preview.popup-V31OpYah.mjs → acorex-platform-layout-widgets-image-preview.popup-C_EPAvCU.mjs} +6 -7
- package/fesm2022/acorex-platform-layout-widgets-image-preview.popup-C_EPAvCU.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-page-widget-designer.component-BtZMBxYp.mjs → acorex-platform-layout-widgets-page-widget-designer.component-D10yO28c.mjs} +12 -12
- package/fesm2022/acorex-platform-layout-widgets-page-widget-designer.component-D10yO28c.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets-repeater-widget-column.component-J0zcGKBX.mjs +116 -0
- package/fesm2022/acorex-platform-layout-widgets-repeater-widget-column.component-J0zcGKBX.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-tabular-data-edit-popup.component-Ck7-wpT2.mjs → acorex-platform-layout-widgets-tabular-data-edit-popup.component-DjpZU6gz.mjs} +6 -6
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-DjpZU6gz.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-tabular-data-view-popup.component-y8vjUiVs.mjs → acorex-platform-layout-widgets-tabular-data-view-popup.component-gX-3Kx9I.mjs} +5 -5
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-gX-3Kx9I.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-text-block-widget-designer.component-Df1BFkSa.mjs → acorex-platform-layout-widgets-text-block-widget-designer.component-Vo4fWHtX.mjs} +6 -6
- package/fesm2022/acorex-platform-layout-widgets-text-block-widget-designer.component-Vo4fWHtX.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets.mjs +18742 -16715
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
- package/fesm2022/acorex-platform-native.mjs +8 -7
- package/fesm2022/acorex-platform-native.mjs.map +1 -1
- package/fesm2022/acorex-platform-runtime.mjs +391 -166
- package/fesm2022/acorex-platform-runtime.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-CWLfNqV0.mjs +160 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-CWLfNqV0.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-C7cT82K2.mjs +120 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-C7cT82K2.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-eMBby9k4.mjs → acorex-platform-themes-default-entity-master-single-view.component-Br9p5aXT.mjs} +21 -28
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-Br9p5aXT.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-error-401.component-B1nsdpTY.mjs +48 -0
- package/fesm2022/acorex-platform-themes-default-error-401.component-B1nsdpTY.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-error-404.component-D4UvRe8u.mjs +42 -0
- package/fesm2022/acorex-platform-themes-default-error-404.component-D4UvRe8u.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-error-offline.component-DR6G8gPC.mjs +19 -0
- package/fesm2022/acorex-platform-themes-default-error-offline.component-DR6G8gPC.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +2337 -94
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-shared-icon-chooser-column.component-C0EpfU2k.mjs → acorex-platform-themes-shared-icon-chooser-column.component-CqkWJYdv.mjs} +6 -6
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-column.component-CqkWJYdv.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-shared-icon-chooser-view.component-9W52W6Nu.mjs → acorex-platform-themes-shared-icon-chooser-view.component-BOTuLdWN.mjs} +6 -6
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-BOTuLdWN.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-shared-settings.provider-DSs1o1M6.mjs → acorex-platform-themes-shared-settings.provider-BjuzSe0T.mjs} +52 -33
- package/fesm2022/acorex-platform-themes-shared-settings.provider-BjuzSe0T.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-D566Kdvy.mjs +94 -0
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-D566Kdvy.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-D7-rCGl7.mjs +86 -0
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-D7-rCGl7.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared.mjs +793 -612
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/fesm2022/acorex-platform-workflow.mjs +997 -274
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
- package/fesm2022/acorex-platform.mjs.map +1 -1
- package/package.json +41 -35
- package/{auth/index.d.ts → types/acorex-platform-auth.d.ts} +40 -19
- package/types/acorex-platform-common.d.ts +3673 -0
- package/types/acorex-platform-contracts.d.ts +940 -0
- package/{core/index.d.ts → types/acorex-platform-core.d.ts} +1029 -170
- package/{domain/index.d.ts → types/acorex-platform-domain.d.ts} +744 -412
- package/{layout/builder/index.d.ts → types/acorex-platform-layout-builder.d.ts} +262 -55
- package/types/acorex-platform-layout-components.d.ts +3329 -0
- package/{layout/designer/index.d.ts → types/acorex-platform-layout-designer.d.ts} +96 -18
- package/types/acorex-platform-layout-entity.d.ts +4512 -0
- package/{layout/views/index.d.ts → types/acorex-platform-layout-views.d.ts} +334 -91
- package/{layout/widget-core/index.d.ts → types/acorex-platform-layout-widget-core.d.ts} +438 -162
- package/{layout/widgets/index.d.ts → types/acorex-platform-layout-widgets.d.ts} +1152 -507
- package/{native/index.d.ts → types/acorex-platform-native.d.ts} +0 -7
- package/types/acorex-platform-runtime.d.ts +571 -0
- package/{themes/default/index.d.ts → types/acorex-platform-themes-default.d.ts} +268 -11
- package/{themes/shared/index.d.ts → types/acorex-platform-themes-shared.d.ts} +30 -2
- package/{workflow/index.d.ts → types/acorex-platform-workflow.d.ts} +436 -748
- package/common/index.d.ts +0 -2470
- package/fesm2022/acorex-platform-common-common-settings.provider-zhqNP3xb.mjs +0 -71
- package/fesm2022/acorex-platform-common-common-settings.provider-zhqNP3xb.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-button-widget-designer.component-C3VoBb_b.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-CxrsI6Hn.mjs +0 -135
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-CxrsI6Hn.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-image-preview.popup-V31OpYah.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-page-widget-designer.component-BtZMBxYp.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-Ck7-wpT2.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-y8vjUiVs.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-text-block-widget-designer.component-Df1BFkSa.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs +0 -157
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-D3qZa5fM.mjs +0 -1542
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-D3qZa5fM.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Ua3ZA5hk.mjs +0 -101
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Ua3ZA5hk.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-eMBby9k4.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-error-401.component-cfREo88K.mjs +0 -31
- package/fesm2022/acorex-platform-themes-default-error-401.component-cfREo88K.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-error-404.component-CdCV5ZoA.mjs +0 -25
- package/fesm2022/acorex-platform-themes-default-error-404.component-CdCV5ZoA.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-error-offline.component-E7SzBcAt.mjs +0 -19
- package/fesm2022/acorex-platform-themes-default-error-offline.component-E7SzBcAt.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-column.component-C0EpfU2k.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-9W52W6Nu.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-settings.provider-DSs1o1M6.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-Dz0cylyQ.mjs +0 -65
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-Dz0cylyQ.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-DY0JtT1v.mjs +0 -64
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-DY0JtT1v.mjs.map +0 -1
- package/layout/components/index.d.ts +0 -1670
- package/layout/entity/index.d.ts +0 -2294
- package/runtime/index.d.ts +0 -307
- /package/{index.d.ts → types/acorex-platform.d.ts} +0 -0
|
@@ -2,9 +2,8 @@ import * as rxjs from 'rxjs';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { Type, ModuleWithProviders, Injector, InjectionToken } from '@angular/core';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { AXPCommand, AXPExecuteCommandResultPromise } from '@acorex/platform/runtime';
|
|
5
|
+
import { AXPActivityCategory, AXPActivityDefinition, AXPWorkflowContinuationMetadata, AXPWorkflowContinuationBeforeInteractive, AXPWorkflowDefinition } from '@acorex/platform/contracts';
|
|
6
|
+
import { AXPExpressionEvaluatorScope, AXPCategoryEntity } from '@acorex/platform/core';
|
|
8
7
|
|
|
9
8
|
declare class AXPWorkflowError extends Error {
|
|
10
9
|
inner: Error | null;
|
|
@@ -147,637 +146,6 @@ declare class AXPWorkflowService {
|
|
|
147
146
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXPWorkflowService>;
|
|
148
147
|
}
|
|
149
148
|
|
|
150
|
-
interface AXPWorkflowDefinition {
|
|
151
|
-
schemaVersion: "acorex-platform-workflow/v1";
|
|
152
|
-
name: string;
|
|
153
|
-
title?: string | null;
|
|
154
|
-
description?: string | null;
|
|
155
|
-
variables?: AXPVariableDefinition[];
|
|
156
|
-
inputs?: AXPWorkflowInputDescriptor[];
|
|
157
|
-
outputs?: AXPWorkflowOutputDescriptor[];
|
|
158
|
-
graph: AXPWorkflowGraph;
|
|
159
|
-
customProperties?: Record<string, any>;
|
|
160
|
-
/** engine specific (Elsa, ...) */
|
|
161
|
-
extensions?: AXPWorkflowExtensions;
|
|
162
|
-
}
|
|
163
|
-
interface AXPWorkflowGraph {
|
|
164
|
-
startActivityId: string;
|
|
165
|
-
activities: AXPWorkflowActivityInstance[];
|
|
166
|
-
connections: AXPConnection[];
|
|
167
|
-
/** purely designer */
|
|
168
|
-
designer?: {
|
|
169
|
-
nodes?: Record<string, {
|
|
170
|
-
x: number;
|
|
171
|
-
y: number;
|
|
172
|
-
nodeId?: string;
|
|
173
|
-
}>;
|
|
174
|
-
edges?: Array<{
|
|
175
|
-
from: string;
|
|
176
|
-
to: string;
|
|
177
|
-
vertices?: Array<{
|
|
178
|
-
x: number;
|
|
179
|
-
y: number;
|
|
180
|
-
}>;
|
|
181
|
-
}>;
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
interface AXPWorkflowActivityInstance {
|
|
185
|
-
id: string;
|
|
186
|
-
nodeId?: string;
|
|
187
|
-
name: string;
|
|
188
|
-
title?: string | null;
|
|
189
|
-
executionMode?: "frontend" | "backend" | "both";
|
|
190
|
-
inputs?: Record<string, any>;
|
|
191
|
-
metadata?: Record<string, any>;
|
|
192
|
-
customProperties?: Record<string, any>;
|
|
193
|
-
/** engine-specific override */
|
|
194
|
-
extensions?: Record<string, any>;
|
|
195
|
-
}
|
|
196
|
-
interface AXPConnection {
|
|
197
|
-
source: {
|
|
198
|
-
activtyName: string;
|
|
199
|
-
port?: string | null;
|
|
200
|
-
};
|
|
201
|
-
target: {
|
|
202
|
-
activtyName: string;
|
|
203
|
-
port?: string | null;
|
|
204
|
-
};
|
|
205
|
-
vertices?: Array<{
|
|
206
|
-
x: number;
|
|
207
|
-
y: number;
|
|
208
|
-
}>;
|
|
209
|
-
}
|
|
210
|
-
interface AXPVariableDefinition {
|
|
211
|
-
name: string;
|
|
212
|
-
type: string;
|
|
213
|
-
isArray?: boolean;
|
|
214
|
-
value?: any;
|
|
215
|
-
storageDriverType?: string | null;
|
|
216
|
-
}
|
|
217
|
-
interface AXPWorkflowPropertyWidget {
|
|
218
|
-
type: AXPWidgetTypesMap[keyof AXPWidgetTypesMap] | string;
|
|
219
|
-
options?: Record<string, any>;
|
|
220
|
-
}
|
|
221
|
-
interface AXPWorkflowInputDescriptor {
|
|
222
|
-
name: string;
|
|
223
|
-
title: string;
|
|
224
|
-
description?: string;
|
|
225
|
-
schema: {
|
|
226
|
-
dataType: string;
|
|
227
|
-
isArray?: boolean;
|
|
228
|
-
nullable?: boolean;
|
|
229
|
-
readonly?: boolean;
|
|
230
|
-
hidden?: boolean | string;
|
|
231
|
-
defaultValue?: any | string | ((context: any | null) => any);
|
|
232
|
-
interface: AXPWorkflowPropertyWidget;
|
|
233
|
-
};
|
|
234
|
-
validations?: AXPValidationRules;
|
|
235
|
-
}
|
|
236
|
-
interface AXPWorkflowOutputDescriptor {
|
|
237
|
-
name: string;
|
|
238
|
-
title: string;
|
|
239
|
-
description?: string;
|
|
240
|
-
/**
|
|
241
|
-
* Optional: where this output comes from in your context/memory.
|
|
242
|
-
* Example: "$.result.orderId" or "vars.orderId"
|
|
243
|
-
*/
|
|
244
|
-
path?: string;
|
|
245
|
-
metadata?: Record<string, any>;
|
|
246
|
-
schema: {
|
|
247
|
-
isArray?: boolean;
|
|
248
|
-
dataType: string;
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* Engine-specific extension bag for a workflow.
|
|
253
|
-
* Keep ALL engine-only fields here (Elsa, StepFunctions adapter, etc).
|
|
254
|
-
*/
|
|
255
|
-
interface AXPWorkflowExtensions {
|
|
256
|
-
/**
|
|
257
|
-
* Elsa-specific extensions (optional).
|
|
258
|
-
*/
|
|
259
|
-
elsa?: AXPElsaWorkflowExtensions;
|
|
260
|
-
/**
|
|
261
|
-
* Other engines (future-proof).
|
|
262
|
-
* Example: stepFunctions, logicApps, temporal, ...
|
|
263
|
-
*/
|
|
264
|
-
[engine: string]: any;
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* Elsa-only fields (Optional).
|
|
268
|
-
* Put strategy/tool/schema/raw payload here to keep Core model global.
|
|
269
|
-
*/
|
|
270
|
-
interface AXPElsaWorkflowExtensions {
|
|
271
|
-
/**
|
|
272
|
-
* Elsa schema URL (if you want to round-trip exact docs).
|
|
273
|
-
* Example: "https://elsaworkflows.io/schemas/workflow-definition/v3.0.0/schema.json"
|
|
274
|
-
*/
|
|
275
|
-
schema?: string;
|
|
276
|
-
toolVersion?: string;
|
|
277
|
-
materializerName?: string;
|
|
278
|
-
/**
|
|
279
|
-
* Elsa strategy/options (engine-level concerns).
|
|
280
|
-
*/
|
|
281
|
-
options?: {
|
|
282
|
-
activationStrategyType?: string | null;
|
|
283
|
-
incidentStrategyType?: string | null;
|
|
284
|
-
commitStrategyName?: string | null;
|
|
285
|
-
autoUpdateConsumingWorkflows?: boolean;
|
|
286
|
-
usableAsActivity?: boolean | null;
|
|
287
|
-
activityCategory?: string | null;
|
|
288
|
-
};
|
|
289
|
-
/**
|
|
290
|
-
* If you want lossless Elsa round-trip, keep the raw Elsa definition here.
|
|
291
|
-
*/
|
|
292
|
-
rawDefinition?: any;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* Workflow definition loader interface.
|
|
297
|
-
* Implement this to provide workflow definitions from various sources (JSON files, database, etc.).
|
|
298
|
-
*/
|
|
299
|
-
interface AXPWorkflowDefinitionLoader {
|
|
300
|
-
/**
|
|
301
|
-
* Get workflow definition by name (unique key).
|
|
302
|
-
* @param name - The workflow name (unique key)
|
|
303
|
-
* @returns Workflow definition or null if not found
|
|
304
|
-
*/
|
|
305
|
-
get(name: string): Promise<AXPWorkflowDefinition | null>;
|
|
306
|
-
/**
|
|
307
|
-
* Get all available workflow names.
|
|
308
|
-
* Used for preloading and discovery.
|
|
309
|
-
* @returns Array of workflow names
|
|
310
|
-
*/
|
|
311
|
-
getAllNames?(): Promise<string[]>;
|
|
312
|
-
}
|
|
313
|
-
/**
|
|
314
|
-
* Injection token for workflow definition loaders.
|
|
315
|
-
* Multiple loaders can be provided (multi: true).
|
|
316
|
-
*/
|
|
317
|
-
declare const AXP_WORKFLOW_DEFINITION_LOADER: InjectionToken<AXPWorkflowDefinitionLoader>;
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* Workflow status.
|
|
321
|
-
*/
|
|
322
|
-
type AXPWorkflowStatus = 'Running' | 'Finished';
|
|
323
|
-
/**
|
|
324
|
-
* Workflow sub-status.
|
|
325
|
-
*/
|
|
326
|
-
type AXPWorkflowSubStatus = 'Pending' | 'Executing' | 'Suspended' | 'Finished' | 'Cancelled' | 'Faulted';
|
|
327
|
-
/**
|
|
328
|
-
* Activity status.
|
|
329
|
-
*/
|
|
330
|
-
type AXPActivityStatus = 'Running' | 'Completed' | 'Canceled' | 'Faulted';
|
|
331
|
-
/**
|
|
332
|
-
* Exception state.
|
|
333
|
-
*/
|
|
334
|
-
interface AXPExceptionState {
|
|
335
|
-
/**
|
|
336
|
-
* Exception type name.
|
|
337
|
-
*/
|
|
338
|
-
type: string;
|
|
339
|
-
/**
|
|
340
|
-
* Exception message.
|
|
341
|
-
*/
|
|
342
|
-
message: string;
|
|
343
|
-
/**
|
|
344
|
-
* Stack trace (nullable).
|
|
345
|
-
*/
|
|
346
|
-
stackTrace?: string | null;
|
|
347
|
-
/**
|
|
348
|
-
* Inner exception (nullable).
|
|
349
|
-
*/
|
|
350
|
-
innerException?: AXPExceptionState | null;
|
|
351
|
-
}
|
|
352
|
-
/**
|
|
353
|
-
* Activity incident.
|
|
354
|
-
*/
|
|
355
|
-
interface AXPActivityIncident {
|
|
356
|
-
/**
|
|
357
|
-
* Activity ID that caused the incident.
|
|
358
|
-
*/
|
|
359
|
-
activityId: string;
|
|
360
|
-
/**
|
|
361
|
-
* Activity node ID.
|
|
362
|
-
*/
|
|
363
|
-
activityNodeId: string;
|
|
364
|
-
/**
|
|
365
|
-
* Activity type.
|
|
366
|
-
*/
|
|
367
|
-
activityType: string;
|
|
368
|
-
/**
|
|
369
|
-
* Incident message.
|
|
370
|
-
*/
|
|
371
|
-
message: string;
|
|
372
|
-
/**
|
|
373
|
-
* Exception (nullable).
|
|
374
|
-
*/
|
|
375
|
-
exception?: AXPExceptionState | null;
|
|
376
|
-
/**
|
|
377
|
-
* Timestamp (ISO date-time).
|
|
378
|
-
*/
|
|
379
|
-
timestamp: string;
|
|
380
|
-
}
|
|
381
|
-
/**
|
|
382
|
-
* Workflow fault state.
|
|
383
|
-
*/
|
|
384
|
-
interface AXPWorkflowFaultState {
|
|
385
|
-
/**
|
|
386
|
-
* Exception (nullable).
|
|
387
|
-
*/
|
|
388
|
-
exception?: AXPExceptionState | null;
|
|
389
|
-
/**
|
|
390
|
-
* Fault message.
|
|
391
|
-
*/
|
|
392
|
-
message: string;
|
|
393
|
-
/**
|
|
394
|
-
* Faulted activity ID (nullable).
|
|
395
|
-
*/
|
|
396
|
-
faultedActivityId?: string | null;
|
|
397
|
-
}
|
|
398
|
-
/**
|
|
399
|
-
* Bookmark.
|
|
400
|
-
*/
|
|
401
|
-
interface AXPBookmark {
|
|
402
|
-
/**
|
|
403
|
-
* Bookmark ID.
|
|
404
|
-
*/
|
|
405
|
-
id: string;
|
|
406
|
-
/**
|
|
407
|
-
* Bookmark name.
|
|
408
|
-
*/
|
|
409
|
-
name: string;
|
|
410
|
-
/**
|
|
411
|
-
* Bookmark hash.
|
|
412
|
-
*/
|
|
413
|
-
hash: string;
|
|
414
|
-
/**
|
|
415
|
-
* Bookmark payload (nullable).
|
|
416
|
-
*/
|
|
417
|
-
payload?: any | null;
|
|
418
|
-
/**
|
|
419
|
-
* Activity node ID.
|
|
420
|
-
*/
|
|
421
|
-
activityNodeId: string;
|
|
422
|
-
/**
|
|
423
|
-
* Activity instance ID.
|
|
424
|
-
*/
|
|
425
|
-
activityInstanceId: string;
|
|
426
|
-
/**
|
|
427
|
-
* Auto burn flag.
|
|
428
|
-
*/
|
|
429
|
-
autoBurn?: boolean;
|
|
430
|
-
/**
|
|
431
|
-
* Callback method name (nullable).
|
|
432
|
-
*/
|
|
433
|
-
callbackMethodName?: string | null;
|
|
434
|
-
/**
|
|
435
|
-
* Metadata (nullable).
|
|
436
|
-
*/
|
|
437
|
-
metadata?: Record<string, string> | null;
|
|
438
|
-
}
|
|
439
|
-
/**
|
|
440
|
-
* Completion callback state.
|
|
441
|
-
*/
|
|
442
|
-
interface AXPCompletionCallbackState {
|
|
443
|
-
/**
|
|
444
|
-
* Owner activity instance ID.
|
|
445
|
-
*/
|
|
446
|
-
ownerInstanceId: string;
|
|
447
|
-
/**
|
|
448
|
-
* Child activity node ID.
|
|
449
|
-
*/
|
|
450
|
-
childNodeId: string;
|
|
451
|
-
/**
|
|
452
|
-
* Method name (nullable).
|
|
453
|
-
*/
|
|
454
|
-
methodName?: string | null;
|
|
455
|
-
}
|
|
456
|
-
/**
|
|
457
|
-
* Variable (for activity context).
|
|
458
|
-
*/
|
|
459
|
-
interface AXPActivityVariable {
|
|
460
|
-
/**
|
|
461
|
-
* Variable ID.
|
|
462
|
-
*/
|
|
463
|
-
id: string;
|
|
464
|
-
/**
|
|
465
|
-
* Variable name.
|
|
466
|
-
*/
|
|
467
|
-
name: string;
|
|
468
|
-
/**
|
|
469
|
-
* Type name.
|
|
470
|
-
*/
|
|
471
|
-
typeName: string;
|
|
472
|
-
/**
|
|
473
|
-
* Is array flag.
|
|
474
|
-
*/
|
|
475
|
-
isArray?: boolean;
|
|
476
|
-
/**
|
|
477
|
-
* Variable value (nullable).
|
|
478
|
-
*/
|
|
479
|
-
value?: any | null;
|
|
480
|
-
/**
|
|
481
|
-
* Storage driver type name (nullable).
|
|
482
|
-
*/
|
|
483
|
-
storageDriverTypeName?: string | null;
|
|
484
|
-
}
|
|
485
|
-
/**
|
|
486
|
-
* Activity execution context state.
|
|
487
|
-
*/
|
|
488
|
-
interface AXPActivityExecutionContextState {
|
|
489
|
-
/**
|
|
490
|
-
* Context ID (activity instance ID).
|
|
491
|
-
*/
|
|
492
|
-
id: string;
|
|
493
|
-
/**
|
|
494
|
-
* Parent context ID (nullable).
|
|
495
|
-
*/
|
|
496
|
-
parentContextId?: string | null;
|
|
497
|
-
/**
|
|
498
|
-
* Scheduled activity node ID.
|
|
499
|
-
*/
|
|
500
|
-
scheduledActivityNodeId: string;
|
|
501
|
-
/**
|
|
502
|
-
* Owner activity node ID (nullable).
|
|
503
|
-
*/
|
|
504
|
-
ownerActivityNodeId?: string | null;
|
|
505
|
-
/**
|
|
506
|
-
* Properties bag.
|
|
507
|
-
*/
|
|
508
|
-
properties: Record<string, any>;
|
|
509
|
-
/**
|
|
510
|
-
* Activity state (evaluated properties) (nullable).
|
|
511
|
-
*/
|
|
512
|
-
activityState?: Record<string, any> | null;
|
|
513
|
-
/**
|
|
514
|
-
* Dynamic variables.
|
|
515
|
-
*/
|
|
516
|
-
dynamicVariables: AXPActivityVariable[];
|
|
517
|
-
/**
|
|
518
|
-
* Activity status.
|
|
519
|
-
*/
|
|
520
|
-
status: AXPActivityStatus;
|
|
521
|
-
/**
|
|
522
|
-
* Is executing flag.
|
|
523
|
-
*/
|
|
524
|
-
isExecuting: boolean;
|
|
525
|
-
/**
|
|
526
|
-
* Fault count.
|
|
527
|
-
*/
|
|
528
|
-
faultCount: number;
|
|
529
|
-
/**
|
|
530
|
-
* Started at timestamp (ISO date-time).
|
|
531
|
-
*/
|
|
532
|
-
startedAt: string;
|
|
533
|
-
/**
|
|
534
|
-
* Completed at timestamp (ISO date-time, nullable).
|
|
535
|
-
*/
|
|
536
|
-
completedAt?: string | null;
|
|
537
|
-
/**
|
|
538
|
-
* Tag (nullable).
|
|
539
|
-
*/
|
|
540
|
-
tag?: any | null;
|
|
541
|
-
}
|
|
542
|
-
/**
|
|
543
|
-
* Workflow state (internal execution state).
|
|
544
|
-
*/
|
|
545
|
-
interface AXPWorkflowState {
|
|
546
|
-
/**
|
|
547
|
-
* State ID.
|
|
548
|
-
*/
|
|
549
|
-
id: string;
|
|
550
|
-
/**
|
|
551
|
-
* Workflow definition ID.
|
|
552
|
-
*/
|
|
553
|
-
definitionId: string;
|
|
554
|
-
/**
|
|
555
|
-
* Workflow definition version.
|
|
556
|
-
*/
|
|
557
|
-
definitionVersion: number;
|
|
558
|
-
/**
|
|
559
|
-
* Correlation ID (nullable).
|
|
560
|
-
*/
|
|
561
|
-
correlationId?: string | null;
|
|
562
|
-
/**
|
|
563
|
-
* Workflow status.
|
|
564
|
-
*/
|
|
565
|
-
status: AXPWorkflowStatus;
|
|
566
|
-
/**
|
|
567
|
-
* Workflow sub-status.
|
|
568
|
-
*/
|
|
569
|
-
subStatus: AXPWorkflowSubStatus;
|
|
570
|
-
/**
|
|
571
|
-
* Bookmarks.
|
|
572
|
-
*/
|
|
573
|
-
bookmarks: AXPBookmark[];
|
|
574
|
-
/**
|
|
575
|
-
* Incidents.
|
|
576
|
-
*/
|
|
577
|
-
incidents: AXPActivityIncident[];
|
|
578
|
-
/**
|
|
579
|
-
* Fault (nullable).
|
|
580
|
-
*/
|
|
581
|
-
fault?: AXPWorkflowFaultState | null;
|
|
582
|
-
/**
|
|
583
|
-
* Completion callbacks.
|
|
584
|
-
*/
|
|
585
|
-
completionCallbacks: AXPCompletionCallbackState[];
|
|
586
|
-
/**
|
|
587
|
-
* Activity execution contexts.
|
|
588
|
-
*/
|
|
589
|
-
activityExecutionContexts: AXPActivityExecutionContextState[];
|
|
590
|
-
/**
|
|
591
|
-
* Input data.
|
|
592
|
-
*/
|
|
593
|
-
input: Record<string, any>;
|
|
594
|
-
/**
|
|
595
|
-
* Output data.
|
|
596
|
-
*/
|
|
597
|
-
output: Record<string, any>;
|
|
598
|
-
/**
|
|
599
|
-
* Properties bag.
|
|
600
|
-
*/
|
|
601
|
-
properties: Record<string, any>;
|
|
602
|
-
/**
|
|
603
|
-
* Created at timestamp (ISO date-time).
|
|
604
|
-
*/
|
|
605
|
-
createdAt: string;
|
|
606
|
-
/**
|
|
607
|
-
* Updated at timestamp (ISO date-time).
|
|
608
|
-
*/
|
|
609
|
-
updatedAt: string;
|
|
610
|
-
/**
|
|
611
|
-
* Finished at timestamp (ISO date-time, nullable).
|
|
612
|
-
*/
|
|
613
|
-
finishedAt?: string | null;
|
|
614
|
-
}
|
|
615
|
-
/**
|
|
616
|
-
* Workflow instance (stored in database).
|
|
617
|
-
* This matches the Elsa Workflow Instance schema for backend compatibility.
|
|
618
|
-
*/
|
|
619
|
-
interface AXPWorkflowInstance {
|
|
620
|
-
/**
|
|
621
|
-
* Schema reference.
|
|
622
|
-
*/
|
|
623
|
-
$schema?: string;
|
|
624
|
-
/**
|
|
625
|
-
* Unique instance ID.
|
|
626
|
-
*/
|
|
627
|
-
id: string;
|
|
628
|
-
/**
|
|
629
|
-
* Workflow definition ID.
|
|
630
|
-
*/
|
|
631
|
-
definitionId: string;
|
|
632
|
-
/**
|
|
633
|
-
* Workflow definition version ID.
|
|
634
|
-
*/
|
|
635
|
-
definitionVersionId: string;
|
|
636
|
-
/**
|
|
637
|
-
* Workflow definition version number.
|
|
638
|
-
*/
|
|
639
|
-
version: number;
|
|
640
|
-
/**
|
|
641
|
-
* Parent workflow instance ID (nullable, for child workflows).
|
|
642
|
-
*/
|
|
643
|
-
parentWorkflowInstanceId?: string | null;
|
|
644
|
-
/**
|
|
645
|
-
* Workflow state (internal execution state).
|
|
646
|
-
*/
|
|
647
|
-
workflowState: AXPWorkflowState;
|
|
648
|
-
/**
|
|
649
|
-
* Workflow status.
|
|
650
|
-
*/
|
|
651
|
-
status: AXPWorkflowStatus;
|
|
652
|
-
/**
|
|
653
|
-
* Workflow sub-status.
|
|
654
|
-
*/
|
|
655
|
-
subStatus: AXPWorkflowSubStatus;
|
|
656
|
-
/**
|
|
657
|
-
* Correlation ID (nullable).
|
|
658
|
-
*/
|
|
659
|
-
correlationId?: string | null;
|
|
660
|
-
/**
|
|
661
|
-
* Instance name (nullable).
|
|
662
|
-
*/
|
|
663
|
-
name?: string | null;
|
|
664
|
-
/**
|
|
665
|
-
* Incident count.
|
|
666
|
-
*/
|
|
667
|
-
incidentCount: number;
|
|
668
|
-
/**
|
|
669
|
-
* Created at timestamp (ISO date-time).
|
|
670
|
-
*/
|
|
671
|
-
createdAt: string;
|
|
672
|
-
/**
|
|
673
|
-
* Updated at timestamp (ISO date-time).
|
|
674
|
-
*/
|
|
675
|
-
updatedAt: string;
|
|
676
|
-
/**
|
|
677
|
-
* Finished at timestamp (ISO date-time, nullable).
|
|
678
|
-
*/
|
|
679
|
-
finishedAt?: string | null;
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
/**
|
|
683
|
-
* Activity Category - Extends AXPCategoryEntity for consistency and performance
|
|
684
|
-
*
|
|
685
|
-
* Inherited properties from AXPCategoryEntity:
|
|
686
|
-
* - id: string - Unique identifier
|
|
687
|
-
* - title: string - Display name
|
|
688
|
-
* - description?: string - Category description
|
|
689
|
-
* - parentId?: string - Parent category ID
|
|
690
|
-
* - childrenCount: number - Direct child categories count (enables lazy loading)
|
|
691
|
-
* - itemsCount?: number - Direct activities count
|
|
692
|
-
* - totalChildren?: number - Total nested categories (optional, for analytics)
|
|
693
|
-
* - totalItems?: number - Total activities in tree (optional, for analytics)
|
|
694
|
-
*/
|
|
695
|
-
interface AXPActivityCategory extends AXPCategoryEntity {
|
|
696
|
-
}
|
|
697
|
-
/**
|
|
698
|
-
* Activity Definition - Metadata for UI and tooling.
|
|
699
|
-
* Contains all metadata needed for displaying activities in toolbox and designer.
|
|
700
|
-
* The `name` property is used as the command key for execution.
|
|
701
|
-
*/
|
|
702
|
-
interface AXPActivityDefinition {
|
|
703
|
-
/**
|
|
704
|
-
* Activity name - used as command key for execution.
|
|
705
|
-
* This is the unique identifier for the activity.
|
|
706
|
-
*/
|
|
707
|
-
name: string;
|
|
708
|
-
/**
|
|
709
|
-
* Activity type (e.g., "workflow-activity:check-permission").
|
|
710
|
-
*/
|
|
711
|
-
type: string;
|
|
712
|
-
/**
|
|
713
|
-
* Display name for UI.
|
|
714
|
-
*/
|
|
715
|
-
title?: string;
|
|
716
|
-
/**
|
|
717
|
-
* Description of what the activity does.
|
|
718
|
-
*/
|
|
719
|
-
description?: string;
|
|
720
|
-
/**
|
|
721
|
-
* Category for grouping in toolbox.
|
|
722
|
-
*/
|
|
723
|
-
category?: string;
|
|
724
|
-
/**
|
|
725
|
-
* Icon name or class.
|
|
726
|
-
*/
|
|
727
|
-
icon?: string;
|
|
728
|
-
/**
|
|
729
|
-
* Where this activity should be executed.
|
|
730
|
-
* - 'frontend': Execute in browser (UI activities, console, events)
|
|
731
|
-
* - 'backend': Execute in backend (business logic, API calls)
|
|
732
|
-
* - 'both': Execute in both frontend and backend (hybrid activities)
|
|
733
|
-
*
|
|
734
|
-
* Default: 'frontend'
|
|
735
|
-
*/
|
|
736
|
-
executionMode?: 'frontend' | 'backend' | 'both';
|
|
737
|
-
/**
|
|
738
|
-
* Input descriptors.
|
|
739
|
-
*/
|
|
740
|
-
inputs?: AXPWorkflowInputDescriptor[];
|
|
741
|
-
/**
|
|
742
|
-
* Output descriptors.
|
|
743
|
-
*/
|
|
744
|
-
outputs?: AXPWorkflowOutputDescriptor[];
|
|
745
|
-
/**
|
|
746
|
-
* Static outcomes (exit points).
|
|
747
|
-
* Example: ['Done', 'Success', 'Failed']
|
|
748
|
-
*/
|
|
749
|
-
outcomes?: string[];
|
|
750
|
-
/**
|
|
751
|
-
* Whether this activity is browsable in the toolbox.
|
|
752
|
-
* Default: true
|
|
753
|
-
*/
|
|
754
|
-
isBrowsable?: boolean;
|
|
755
|
-
/**
|
|
756
|
-
* Whether this activity is a container (can have children).
|
|
757
|
-
* Default: false
|
|
758
|
-
*/
|
|
759
|
-
isContainer?: boolean;
|
|
760
|
-
}
|
|
761
|
-
/**
|
|
762
|
-
* Activity - Command with specific TResult structure.
|
|
763
|
-
* Extends AXPCommand with a fixed TResult that includes output and outcomes.
|
|
764
|
-
* No additional properties beyond AXPCommand - pure command interface.
|
|
765
|
-
*/
|
|
766
|
-
interface AXPActivity<TInput = any, TOutput = any> extends AXPCommand<TInput, {
|
|
767
|
-
output: TOutput;
|
|
768
|
-
outcomes: Record<string, any>;
|
|
769
|
-
}> {
|
|
770
|
-
/**
|
|
771
|
-
* Execute the activity as a command.
|
|
772
|
-
* @param input - Activity input data
|
|
773
|
-
* @returns Promise with output and outcomes
|
|
774
|
-
*/
|
|
775
|
-
execute(input: TInput): AXPExecuteCommandResultPromise<{
|
|
776
|
-
output: TOutput;
|
|
777
|
-
outcomes: Record<string, any>;
|
|
778
|
-
}>;
|
|
779
|
-
}
|
|
780
|
-
|
|
781
149
|
type AXPActivityProviderToken = AXPActivityProvider | Promise<AXPActivityProvider>;
|
|
782
150
|
declare const AXP_ACTIVITY_PROVIDER: InjectionToken<AXPActivityProviderToken[]>;
|
|
783
151
|
interface AXPActivityProvider {
|
|
@@ -876,6 +244,11 @@ declare class AXPActivityDefinitionService {
|
|
|
876
244
|
* @returns Activity definition or undefined if not found
|
|
877
245
|
*/
|
|
878
246
|
getActivityByName(name: string): Promise<AXPActivityDefinition | undefined>;
|
|
247
|
+
/**
|
|
248
|
+
* Get all activity definitions (flat list) by loading root categories and their activities.
|
|
249
|
+
* Used by activity selector UIs (e.g. automation command configurator).
|
|
250
|
+
*/
|
|
251
|
+
getAllActivities(): Promise<AXPActivityDefinition[]>;
|
|
879
252
|
/**
|
|
880
253
|
* Get category ID containing a specific activity definition
|
|
881
254
|
*
|
|
@@ -967,6 +340,10 @@ interface AXPWorkflowTask {
|
|
|
967
340
|
* - 'both': Execute in both frontend and backend (hybrid activities)
|
|
968
341
|
*/
|
|
969
342
|
executionMode: 'frontend' | 'backend' | 'both';
|
|
343
|
+
/**
|
|
344
|
+
* Type of task for inbox handling.
|
|
345
|
+
*/
|
|
346
|
+
taskType?: 'human-task' | 'ui-activity' | 'system-activity';
|
|
970
347
|
/**
|
|
971
348
|
* Input data for the activity (for frontend activities).
|
|
972
349
|
*/
|
|
@@ -975,6 +352,10 @@ interface AXPWorkflowTask {
|
|
|
975
352
|
* Configuration for the activity (for frontend activities).
|
|
976
353
|
*/
|
|
977
354
|
config?: Record<string, any>;
|
|
355
|
+
/**
|
|
356
|
+
* Continuation UX copied from the activity definition at task creation time.
|
|
357
|
+
*/
|
|
358
|
+
continuation?: AXPWorkflowContinuationMetadata;
|
|
978
359
|
}
|
|
979
360
|
/**
|
|
980
361
|
* Request to start a workflow instance.
|
|
@@ -1006,6 +387,16 @@ interface AXPStartWorkflowResponse {
|
|
|
1006
387
|
* Client should execute this task based on executionMode.
|
|
1007
388
|
*/
|
|
1008
389
|
pendingTask?: AXPWorkflowTask | null;
|
|
390
|
+
/**
|
|
391
|
+
* Activity outputs map (activityId -> output).
|
|
392
|
+
* Returned for expression evaluation in subsequent activities.
|
|
393
|
+
*/
|
|
394
|
+
activityOutputs?: Record<string, any>;
|
|
395
|
+
/**
|
|
396
|
+
* Last activity output (convenience).
|
|
397
|
+
* Prefer using `activityOutputs[activityId]` when possible.
|
|
398
|
+
*/
|
|
399
|
+
lastActivityOutput?: any;
|
|
1009
400
|
}
|
|
1010
401
|
/**
|
|
1011
402
|
* Request to resume a suspended workflow.
|
|
@@ -1027,7 +418,7 @@ interface AXPResumeWorkflowRequest {
|
|
|
1027
418
|
/**
|
|
1028
419
|
* User action outcome (e.g., 'Confirmed', 'Cancelled').
|
|
1029
420
|
*/
|
|
1030
|
-
outcome
|
|
421
|
+
outcome?: string;
|
|
1031
422
|
/**
|
|
1032
423
|
* Optional user input data.
|
|
1033
424
|
*/
|
|
@@ -1087,6 +478,16 @@ interface AXPWorkflowInstanceState {
|
|
|
1087
478
|
* Workflow variables (state).
|
|
1088
479
|
*/
|
|
1089
480
|
variables: Record<string, any>;
|
|
481
|
+
/**
|
|
482
|
+
* Activity outputs map (activityId -> output).
|
|
483
|
+
* Used by expression evaluation scope as `outputs.activityId`.
|
|
484
|
+
*/
|
|
485
|
+
activityOutputs?: Record<string, any>;
|
|
486
|
+
/**
|
|
487
|
+
* Last activity output (convenience).
|
|
488
|
+
* Useful when the next activity needs a quick access to the previous result.
|
|
489
|
+
*/
|
|
490
|
+
lastActivityOutput?: any;
|
|
1090
491
|
/**
|
|
1091
492
|
* Initial input data.
|
|
1092
493
|
*/
|
|
@@ -1100,6 +501,79 @@ interface AXPWorkflowInstanceState {
|
|
|
1100
501
|
*/
|
|
1101
502
|
lastUpdated: Date;
|
|
1102
503
|
}
|
|
504
|
+
interface AXPFrontActivityCompleteRequest {
|
|
505
|
+
/**
|
|
506
|
+
* Instance ID.
|
|
507
|
+
*/
|
|
508
|
+
instanceId: string;
|
|
509
|
+
activityNode: string;
|
|
510
|
+
output: Record<string, any>;
|
|
511
|
+
outcome?: string;
|
|
512
|
+
}
|
|
513
|
+
interface AXPFrontActivityCompleteResponse {
|
|
514
|
+
/**
|
|
515
|
+
* Activity execution output.
|
|
516
|
+
*/
|
|
517
|
+
output?: any;
|
|
518
|
+
/**
|
|
519
|
+
* Activity execution outcomes.
|
|
520
|
+
*/
|
|
521
|
+
outcomes?: Record<string, any>;
|
|
522
|
+
/**
|
|
523
|
+
* Next task to execute (if any).
|
|
524
|
+
*/
|
|
525
|
+
nextTask?: AXPWorkflowTask | null;
|
|
526
|
+
/**
|
|
527
|
+
* Updated workflow state.
|
|
528
|
+
*/
|
|
529
|
+
state?: AXPWorkflowInstanceState;
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* Activity types that use the task board (suspend until user acts via inbox), not inline interactive execution.
|
|
533
|
+
*/
|
|
534
|
+
declare const AXP_WORKFLOW_TASK_BOARD_ACTIVITY_TYPES: readonly string[];
|
|
535
|
+
declare function axpIsWorkflowTaskBoardActivityType(activityType: string | undefined | null): boolean;
|
|
536
|
+
/**
|
|
537
|
+
* Claim a pooled workflow task (updates bookmark assignee without resuming the workflow).
|
|
538
|
+
*/
|
|
539
|
+
interface AXPClaimWorkflowTaskRequest {
|
|
540
|
+
instanceId: string;
|
|
541
|
+
bookmarkId: string;
|
|
542
|
+
stepId: string;
|
|
543
|
+
}
|
|
544
|
+
interface AXPClaimWorkflowTaskResponse {
|
|
545
|
+
success: boolean;
|
|
546
|
+
error?: string;
|
|
547
|
+
errorCode?: string;
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* Reassign a human-task bookmark to the current user without resuming the workflow.
|
|
551
|
+
*/
|
|
552
|
+
interface AXPReassignWorkflowTaskToSelfRequest {
|
|
553
|
+
instanceId: string;
|
|
554
|
+
bookmarkId: string;
|
|
555
|
+
stepId: string;
|
|
556
|
+
}
|
|
557
|
+
interface AXPReassignWorkflowTaskToSelfResponse {
|
|
558
|
+
success: boolean;
|
|
559
|
+
error?: string;
|
|
560
|
+
errorCode?: string;
|
|
561
|
+
}
|
|
562
|
+
/** Restore task-board visibility after the user declines a pre-interactive continuation prompt. */
|
|
563
|
+
interface AXPRevertResumeAfterDeclinedInteractiveContinuationRequest {
|
|
564
|
+
instanceId: string;
|
|
565
|
+
/** Human-task / cartable step that was resumed from the task board. */
|
|
566
|
+
suspendedStepId: string;
|
|
567
|
+
/** Inline frontend step that was about to run when the user declined. */
|
|
568
|
+
abortedStepId?: string;
|
|
569
|
+
/** Bookmark id of the suspended step (when known). */
|
|
570
|
+
bookmarkId?: string;
|
|
571
|
+
}
|
|
572
|
+
interface AXPRevertResumeAfterDeclinedInteractiveContinuationResponse {
|
|
573
|
+
success: boolean;
|
|
574
|
+
state?: AXPWorkflowInstanceState;
|
|
575
|
+
error?: string;
|
|
576
|
+
}
|
|
1103
577
|
|
|
1104
578
|
/**
|
|
1105
579
|
* Interface for workflow engine operations.
|
|
@@ -1135,6 +609,24 @@ interface AXPWorkflowEngine {
|
|
|
1135
609
|
*
|
|
1136
610
|
*/
|
|
1137
611
|
getState(request: AXPGetWorkflowStateRequest): Promise<AXPWorkflowInstanceState>;
|
|
612
|
+
frontActivtyComplete(request: AXPFrontActivityCompleteRequest): Promise<AXPFrontActivityCompleteResponse>;
|
|
613
|
+
/**
|
|
614
|
+
* Optional: claim a pooled task (e.g. cartable) without consuming the bookmark.
|
|
615
|
+
* Engines that do not support pooling should omit this method.
|
|
616
|
+
*/
|
|
617
|
+
claimTask?(request: AXPClaimWorkflowTaskRequest): Promise<AXPClaimWorkflowTaskResponse>;
|
|
618
|
+
/**
|
|
619
|
+
* Optional: reassign a human-task bookmark to the current user (requires permission on the engine).
|
|
620
|
+
*/
|
|
621
|
+
reassignTaskToSelf?(request: AXPReassignWorkflowTaskToSelfRequest): Promise<AXPReassignWorkflowTaskToSelfResponse>;
|
|
622
|
+
/**
|
|
623
|
+
* Optional: restore a suspended task-board step when the user declines a pre-interactive continuation prompt.
|
|
624
|
+
*/
|
|
625
|
+
revertResumeAfterDeclinedInteractiveContinuation?(request: AXPRevertResumeAfterDeclinedInteractiveContinuationRequest): Promise<AXPRevertResumeAfterDeclinedInteractiveContinuationResponse>;
|
|
626
|
+
/**
|
|
627
|
+
* Optional: terminate a non-finished instance (e.g. superseded lifecycle run).
|
|
628
|
+
*/
|
|
629
|
+
cancelInstance?(instanceId: string, reason?: string): Promise<void>;
|
|
1138
630
|
}
|
|
1139
631
|
/**
|
|
1140
632
|
* Injection token for workflow engine.
|
|
@@ -1143,44 +635,33 @@ interface AXPWorkflowEngine {
|
|
|
1143
635
|
declare const AXP_WORKFLOW_ENGINE: InjectionToken<AXPWorkflowEngine>;
|
|
1144
636
|
|
|
1145
637
|
/**
|
|
1146
|
-
*
|
|
638
|
+
* Stable workflow engine error codes for UI branching (toasts, take-over flow, etc.).
|
|
1147
639
|
*/
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
* Task execution outcome (e.g., 'Done', 'Confirmed', 'Cancelled', 'Failed').
|
|
1155
|
-
*/
|
|
1156
|
-
outcome: string;
|
|
1157
|
-
}
|
|
640
|
+
declare const AXP_WORKFLOW_ERROR_CODES: {
|
|
641
|
+
readonly TASK_NOT_ASSIGNEE: "WORKFLOW_TASK_NOT_ASSIGNEE";
|
|
642
|
+
readonly CLAIM_REQUIRED: "WORKFLOW_CLAIM_REQUIRED";
|
|
643
|
+
readonly REASSIGN_NOT_ALLOWED: "WORKFLOW_REASSIGN_NOT_ALLOWED";
|
|
644
|
+
};
|
|
645
|
+
type AXPWorkflowErrorCode = (typeof AXP_WORKFLOW_ERROR_CODES)[keyof typeof AXP_WORKFLOW_ERROR_CODES];
|
|
1158
646
|
/**
|
|
1159
|
-
*
|
|
1160
|
-
*
|
|
1161
|
-
* This service handles the execution of frontend or hybrid tasks using
|
|
1162
|
-
* the command infrastructure. It translates command results into
|
|
1163
|
-
* workflow-compatible output and outcome format.
|
|
1164
|
-
*
|
|
1165
|
-
* This service is replaceable per platform and contains all execution logic.
|
|
647
|
+
* Business-rule failure from {@link AXPWorkflowEngine} (expected, user-facing).
|
|
1166
648
|
*/
|
|
1167
|
-
declare class
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
*
|
|
1172
|
-
* Only executes tasks with executionMode 'frontend' or 'both'.
|
|
1173
|
-
* Backend tasks should not be passed to this executor.
|
|
1174
|
-
*
|
|
1175
|
-
* @param task - Task to execute
|
|
1176
|
-
* @returns Execution result with output and outcome
|
|
1177
|
-
*
|
|
1178
|
-
* @throws Error if task is not a frontend task
|
|
1179
|
-
*/
|
|
1180
|
-
execute(task: AXPWorkflowTask): Promise<FrontendTaskExecutionResult>;
|
|
1181
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FrontendTaskExecutor, never>;
|
|
1182
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<FrontendTaskExecutor>;
|
|
649
|
+
declare class AXPWorkflowEngineError extends Error {
|
|
650
|
+
readonly code: AXPWorkflowErrorCode;
|
|
651
|
+
readonly details?: Record<string, unknown> | undefined;
|
|
652
|
+
constructor(message: string, code: AXPWorkflowErrorCode, details?: Record<string, unknown> | undefined);
|
|
1183
653
|
}
|
|
654
|
+
/**
|
|
655
|
+
* Resolves a stable error code from an unknown thrown value.
|
|
656
|
+
*/
|
|
657
|
+
declare function getWorkflowEngineErrorCode(error: unknown): AXPWorkflowErrorCode | undefined;
|
|
658
|
+
/**
|
|
659
|
+
* Resolves a user-facing message and optional code from an unknown thrown value.
|
|
660
|
+
*/
|
|
661
|
+
declare function getWorkflowEngineErrorInfo(error: unknown): {
|
|
662
|
+
message: string;
|
|
663
|
+
code?: AXPWorkflowErrorCode;
|
|
664
|
+
};
|
|
1184
665
|
|
|
1185
666
|
/**
|
|
1186
667
|
* Result of starting a workflow.
|
|
@@ -1268,6 +749,28 @@ interface WorkflowResumeResult {
|
|
|
1268
749
|
* Error message (if failed).
|
|
1269
750
|
*/
|
|
1270
751
|
error?: string;
|
|
752
|
+
/**
|
|
753
|
+
* Stable engine error code when available (e.g. WORKFLOW_TASK_NOT_ASSIGNEE).
|
|
754
|
+
*/
|
|
755
|
+
errorCode?: string;
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* Result of claiming a pooled workflow task (cartable / candidate pool).
|
|
759
|
+
*/
|
|
760
|
+
interface WorkflowClaimTaskResult {
|
|
761
|
+
success: boolean;
|
|
762
|
+
instanceId: string;
|
|
763
|
+
error?: string;
|
|
764
|
+
errorCode?: string;
|
|
765
|
+
}
|
|
766
|
+
/**
|
|
767
|
+
* Result of reassigning a human-task bookmark to the current user.
|
|
768
|
+
*/
|
|
769
|
+
interface WorkflowReassignTaskToSelfResult {
|
|
770
|
+
success: boolean;
|
|
771
|
+
instanceId: string;
|
|
772
|
+
error?: string;
|
|
773
|
+
errorCode?: string;
|
|
1271
774
|
}
|
|
1272
775
|
/**
|
|
1273
776
|
* Workflow Manager - Facade for workflow lifecycle orchestration.
|
|
@@ -1277,20 +780,21 @@ interface WorkflowResumeResult {
|
|
|
1277
780
|
*
|
|
1278
781
|
* Responsibilities:
|
|
1279
782
|
* - Orchestrate workflow lifecycle (start, execute, complete, resume)
|
|
1280
|
-
* - Delegate execution to
|
|
783
|
+
* - Delegate execution to ActivityExecutor
|
|
1281
784
|
* - Cache workflow state in memory
|
|
1282
785
|
* - Expose a stable API for UI
|
|
1283
786
|
*
|
|
1284
787
|
* Rules:
|
|
1285
788
|
* - No HTTP calls (delegates to AXPWorkflowEngine)
|
|
1286
|
-
* - No CommandBus / Command execution (delegates to
|
|
789
|
+
* - No CommandBus / Command execution (delegates to ActivityExecutor)
|
|
1287
790
|
* - No workflow branching logic (backend decides)
|
|
1288
791
|
* - No business validation (backend validates)
|
|
1289
792
|
* - No backend assumptions (uses abstract runtime service)
|
|
1290
793
|
*/
|
|
1291
794
|
declare class AXPWorkflowManager {
|
|
1292
795
|
private readonly workflowEngine;
|
|
1293
|
-
private readonly
|
|
796
|
+
private readonly activityExecutor;
|
|
797
|
+
private readonly continuationHook;
|
|
1294
798
|
/**
|
|
1295
799
|
* Cache workflow states in memory for quick access.
|
|
1296
800
|
* Key: instanceId
|
|
@@ -1301,6 +805,29 @@ declare class AXPWorkflowManager {
|
|
|
1301
805
|
* Cache TTL in milliseconds (5 minutes).
|
|
1302
806
|
*/
|
|
1303
807
|
private readonly CACHE_TTL;
|
|
808
|
+
/**
|
|
809
|
+
* Execute frontend activities interactively until reaching workflow-activity:human-task or completion.
|
|
810
|
+
*
|
|
811
|
+
* Interactive = show form/popup immediately (user sees and acts). Only workflow-activity:human-task
|
|
812
|
+
* is not interactive (goes to task board). Other frontend activities (show-layout-popup, show-toast, etc.)
|
|
813
|
+
* even with taskType human-task in definition are executed here.
|
|
814
|
+
*
|
|
815
|
+
* @param instanceId - Workflow instance ID
|
|
816
|
+
* @param task - Current task to execute
|
|
817
|
+
* @param state - Current workflow state
|
|
818
|
+
* @param lastActivityOutput - Last activity output (for expression evaluation)
|
|
819
|
+
* @returns Final result with nextTask (if workflow-activity:human-task) or completion status
|
|
820
|
+
*/
|
|
821
|
+
private executeInteractiveFlow;
|
|
822
|
+
/**
|
|
823
|
+
* Runs inline interactive activities when allowed, with an optional pre-flow continuation prompt.
|
|
824
|
+
*/
|
|
825
|
+
private runInteractiveFlowWithContinuation;
|
|
826
|
+
private invokeWorkflowContinuationAfterStep;
|
|
827
|
+
/**
|
|
828
|
+
* Restores the suspended task-board step when the user declines a pre-interactive continuation prompt.
|
|
829
|
+
*/
|
|
830
|
+
private revertResumeAfterDeclinedInteractiveContinuation;
|
|
1304
831
|
/**
|
|
1305
832
|
* Start a new workflow instance.
|
|
1306
833
|
*
|
|
@@ -1325,31 +852,6 @@ declare class AXPWorkflowManager {
|
|
|
1325
852
|
* ```
|
|
1326
853
|
*/
|
|
1327
854
|
start(workflowId: string, input?: Record<string, any>): Promise<WorkflowStartResult>;
|
|
1328
|
-
/**
|
|
1329
|
-
* Execute a frontend task.
|
|
1330
|
-
*
|
|
1331
|
-
* Delegates to FrontendTaskExecutor for actual execution.
|
|
1332
|
-
* Only executes tasks with executionMode 'frontend' or 'both'.
|
|
1333
|
-
*
|
|
1334
|
-
* @param task - Task to execute
|
|
1335
|
-
* @returns Execution result with output and outcome
|
|
1336
|
-
*
|
|
1337
|
-
* @throws Error if task is not a frontend task
|
|
1338
|
-
*/
|
|
1339
|
-
execute(task: AXPWorkflowTask): Promise<FrontendTaskExecutionResult>;
|
|
1340
|
-
/**
|
|
1341
|
-
* Complete a task and get next task from backend.
|
|
1342
|
-
*
|
|
1343
|
-
* Sends task result to backend API.
|
|
1344
|
-
* Backend decides: next task, fail, or complete workflow.
|
|
1345
|
-
*
|
|
1346
|
-
* @param instanceId - Workflow instance ID
|
|
1347
|
-
* @param task - Completed task
|
|
1348
|
-
* @param outcome - Task outcome (e.g., 'Done', 'Confirmed', 'Cancelled')
|
|
1349
|
-
* @param output - Task output/result (optional)
|
|
1350
|
-
* @returns Complete result with next task (if any)
|
|
1351
|
-
*/
|
|
1352
|
-
complete(instanceId: string, task: AXPWorkflowTask, outcome: string, output?: any): Promise<WorkflowCompleteResult>;
|
|
1353
855
|
/**
|
|
1354
856
|
* Resume a suspended workflow (e.g., after user interaction).
|
|
1355
857
|
*
|
|
@@ -1373,6 +875,16 @@ declare class AXPWorkflowManager {
|
|
|
1373
875
|
* @returns Workflow instance state or null if not found
|
|
1374
876
|
*/
|
|
1375
877
|
getState(instanceId: string): Promise<AXPWorkflowInstanceState | null>;
|
|
878
|
+
/**
|
|
879
|
+
* Claim a pooled workflow task (assign current user on the bookmark without advancing the workflow).
|
|
880
|
+
* Supported only when the injected workflow engine implements {@link AXPWorkflowEngine.claimTask}.
|
|
881
|
+
*/
|
|
882
|
+
claimTask(instanceId: string, bookmarkId: string, stepId: string): Promise<WorkflowClaimTaskResult>;
|
|
883
|
+
/**
|
|
884
|
+
* Reassign a human-task bookmark to the current user without advancing the workflow.
|
|
885
|
+
* Supported only when the injected workflow engine implements {@link AXPWorkflowEngine.reassignTaskToSelf}.
|
|
886
|
+
*/
|
|
887
|
+
reassignTaskToSelf(instanceId: string, bookmarkId: string, stepId: string): Promise<WorkflowReassignTaskToSelfResult>;
|
|
1376
888
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXPWorkflowManager, never>;
|
|
1377
889
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXPWorkflowManager>;
|
|
1378
890
|
}
|
|
@@ -1386,15 +898,16 @@ declare class AXPWorkflowManager {
|
|
|
1386
898
|
* - Maintains workflow state in memory
|
|
1387
899
|
* - Does not require backend API calls
|
|
1388
900
|
*
|
|
1389
|
-
* Execution of frontend tasks is handled by AXPWorkflowManager via
|
|
901
|
+
* Execution of frontend tasks is handled by AXPWorkflowManager via ActivityExecutor.
|
|
1390
902
|
* This engine only manages workflow progression and state storage.
|
|
1391
903
|
*
|
|
1392
904
|
* This is the DEFAULT engine provider. Applications can override it with
|
|
1393
905
|
* an API-based engine implementation.
|
|
1394
906
|
*/
|
|
1395
907
|
declare class AXPWorkflowLocalEngine implements AXPWorkflowEngine {
|
|
1396
|
-
private readonly
|
|
1397
|
-
|
|
908
|
+
private readonly activityDefinitionService;
|
|
909
|
+
private readonly workflowProviders;
|
|
910
|
+
private readonly multiLanguageResolver;
|
|
1398
911
|
/**
|
|
1399
912
|
* In-memory storage for workflow instances.
|
|
1400
913
|
* Key: instanceId
|
|
@@ -1427,7 +940,7 @@ declare class AXPWorkflowLocalEngine implements AXPWorkflowEngine {
|
|
|
1427
940
|
*/
|
|
1428
941
|
getState(request: AXPGetWorkflowStateRequest): Promise<AXPWorkflowInstanceState>;
|
|
1429
942
|
/**
|
|
1430
|
-
* Get workflow definition from available
|
|
943
|
+
* Get workflow definition from available providers.
|
|
1431
944
|
*/
|
|
1432
945
|
private getDefinition;
|
|
1433
946
|
/**
|
|
@@ -1443,65 +956,239 @@ declare class AXPWorkflowLocalEngine implements AXPWorkflowEngine {
|
|
|
1443
956
|
* Get next activity ID based on connections and outcomes.
|
|
1444
957
|
*/
|
|
1445
958
|
private getNextActivityId;
|
|
1446
|
-
|
|
959
|
+
frontActivtyComplete(request: AXPFrontActivityCompleteRequest): Promise<AXPFrontActivityCompleteResponse>;
|
|
960
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXPWorkflowLocalEngine, never>;
|
|
1447
961
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXPWorkflowLocalEngine>;
|
|
1448
962
|
}
|
|
1449
963
|
|
|
1450
964
|
/**
|
|
1451
|
-
*
|
|
1452
|
-
*
|
|
1453
|
-
* Inherited properties from AXPCategoryEntity:
|
|
1454
|
-
* - id: string - Unique identifier
|
|
1455
|
-
* - title: string - Display name
|
|
1456
|
-
* - description?: string - Category description
|
|
1457
|
-
* - parentId?: string - Parent category ID
|
|
1458
|
-
* - childrenCount: number - Direct child categories count (enables lazy loading)
|
|
1459
|
-
* - itemsCount?: number - Direct workflows count
|
|
1460
|
-
* - totalChildren?: number - Total nested categories (optional, for analytics)
|
|
1461
|
-
* - totalItems?: number - Total workflows in tree (optional, for analytics)
|
|
965
|
+
* Result of executing a workflow activity.
|
|
1462
966
|
*/
|
|
1463
|
-
interface
|
|
967
|
+
interface ActivityExecutionResult {
|
|
968
|
+
/**
|
|
969
|
+
* Activity execution output.
|
|
970
|
+
*/
|
|
971
|
+
output: any;
|
|
972
|
+
/**
|
|
973
|
+
* Activity execution outcome (e.g., 'Done', 'Confirmed', 'Cancelled', 'Failed').
|
|
974
|
+
*/
|
|
975
|
+
outcome: string;
|
|
1464
976
|
}
|
|
1465
977
|
/**
|
|
1466
|
-
*
|
|
1467
|
-
*
|
|
1468
|
-
*
|
|
978
|
+
* Activity Executor Service
|
|
979
|
+
*
|
|
980
|
+
* Service for executing workflow activities via CommandBus.
|
|
981
|
+
* Automatically evaluates expressions in activity inputs before execution.
|
|
982
|
+
*
|
|
983
|
+
* @example
|
|
984
|
+
* ```typescript
|
|
985
|
+
* const executor = inject(ActivityExecutor);
|
|
986
|
+
*
|
|
987
|
+
* // Execute activity with task and workflow state (expressions will be evaluated)
|
|
988
|
+
* const result = await executor.execute(task, workflowState, activityOutputs);
|
|
989
|
+
* ```
|
|
1469
990
|
*/
|
|
1470
|
-
|
|
991
|
+
declare class ActivityExecutor {
|
|
992
|
+
private readonly commandService;
|
|
993
|
+
private readonly expressionEvaluator;
|
|
994
|
+
private readonly expressionScopeService;
|
|
995
|
+
private readonly translateService;
|
|
1471
996
|
/**
|
|
1472
|
-
*
|
|
1473
|
-
*
|
|
997
|
+
* Execute a workflow activity with expression evaluation.
|
|
998
|
+
*
|
|
999
|
+
* Evaluates expressions in activity inputs using workflow state,
|
|
1000
|
+
* then executes the activity via CommandBus.
|
|
1001
|
+
*
|
|
1002
|
+
* @param task - Workflow task containing activity information
|
|
1003
|
+
* @param workflowState - Current workflow instance state (for expression evaluation)
|
|
1004
|
+
* @param activityOutputs - Map of previous activity outputs (for expression evaluation)
|
|
1005
|
+
* @returns Execution result with output and outcome
|
|
1474
1006
|
*/
|
|
1475
|
-
|
|
1007
|
+
execute(task: AXPWorkflowTask, workflowState?: AXPWorkflowInstanceState, activityOutputs?: Map<string, any> | Record<string, any>): Promise<ActivityExecutionResult>;
|
|
1476
1008
|
/**
|
|
1477
|
-
*
|
|
1009
|
+
* Resolves command failure message text for workflow output: `@` keys via translate, MLS maps via resolve.
|
|
1478
1010
|
*/
|
|
1479
|
-
|
|
1011
|
+
private resolveCommandMessageTextForError;
|
|
1012
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ActivityExecutor, never>;
|
|
1013
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ActivityExecutor>;
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
/**
|
|
1017
|
+
* Workflow expression evaluation context.
|
|
1018
|
+
* Contains workflow state data needed for expression evaluation.
|
|
1019
|
+
*/
|
|
1020
|
+
interface WorkflowExpressionContext {
|
|
1021
|
+
/** Workflow input values */
|
|
1022
|
+
inputs: Record<string, any>;
|
|
1023
|
+
/** Workflow state variables */
|
|
1024
|
+
variables: Record<string, any>;
|
|
1025
|
+
/** Previous activity outputs (activityId -> output) */
|
|
1026
|
+
outputs: Record<string, any>;
|
|
1027
|
+
}
|
|
1028
|
+
/**
|
|
1029
|
+
* Workflow Expression Scope Service
|
|
1030
|
+
*
|
|
1031
|
+
* Shared service for building expression evaluation scope from workflow data.
|
|
1032
|
+
* Used by both Local Engine and Mock Runtime to manage workflow data (inputs, variables, outputs).
|
|
1033
|
+
*
|
|
1034
|
+
* Responsibilities:
|
|
1035
|
+
* - Build expression evaluation scope from workflow state
|
|
1036
|
+
* - Provide context.eval() function for accessing workflow data
|
|
1037
|
+
* - Manage workflow data structure (inputs, variables, outputs)
|
|
1038
|
+
*
|
|
1039
|
+
* This service does NOT:
|
|
1040
|
+
* - Execute activities
|
|
1041
|
+
* - Evaluate expressions (delegates to AXPExpressionEvaluatorService)
|
|
1042
|
+
* - Manage workflow state (handled by runtime)
|
|
1043
|
+
*
|
|
1044
|
+
* @example
|
|
1045
|
+
* ```typescript
|
|
1046
|
+
* const scopeService = inject(WorkflowExpressionScopeService);
|
|
1047
|
+
*
|
|
1048
|
+
* // Build scope from workflow state
|
|
1049
|
+
* const scope = scopeService.buildScope({
|
|
1050
|
+
* inputs: state.input || {},
|
|
1051
|
+
* variables: state.variables || {},
|
|
1052
|
+
* outputs: activityOutputs
|
|
1053
|
+
* });
|
|
1054
|
+
*
|
|
1055
|
+
* // Or build from state directly
|
|
1056
|
+
* const scope = scopeService.buildScopeFromState(state, activityOutputs);
|
|
1057
|
+
* ```
|
|
1058
|
+
*/
|
|
1059
|
+
declare class WorkflowExpressionScopeService {
|
|
1480
1060
|
/**
|
|
1481
|
-
*
|
|
1061
|
+
* Collect dot-notation key-value pairs from nested objects so that e.g.
|
|
1062
|
+
* { metadata: { "metadata.questionnaire.id": "x" } } becomes { "metadata.questionnaire.id": "x" } at root.
|
|
1063
|
+
* Top-level non-dot keys are kept as-is.
|
|
1482
1064
|
*/
|
|
1483
|
-
|
|
1065
|
+
private flattenDotKeysFromTree;
|
|
1484
1066
|
/**
|
|
1485
|
-
*
|
|
1067
|
+
* Expand flat keys with dots into nested objects.
|
|
1068
|
+
* e.g. { "metadata.questionnaire.id": "x" } -> { metadata: { questionnaire: { id: "x" } } }.
|
|
1486
1069
|
*/
|
|
1487
|
-
|
|
1070
|
+
private expandDotKeys;
|
|
1488
1071
|
/**
|
|
1489
|
-
*
|
|
1072
|
+
* Normalize workflow input so that flat dot-notation keys (e.g. from form schema
|
|
1073
|
+
* "metadata.questionnaire.id") become nested for expression access (inputs.metadata.questionnaire.id).
|
|
1490
1074
|
*/
|
|
1491
|
-
|
|
1075
|
+
private normalizeInputs;
|
|
1492
1076
|
/**
|
|
1493
|
-
*
|
|
1494
|
-
*
|
|
1077
|
+
* Build expression evaluation scope for workflow activities.
|
|
1078
|
+
*
|
|
1079
|
+
* Provides workflow-specific data (inputs, variables, outputs) and context.eval() function.
|
|
1080
|
+
* Other data (session, current user, etc.) are provided by expression evaluator scope providers.
|
|
1081
|
+
*
|
|
1082
|
+
* Scope includes:
|
|
1083
|
+
* - inputs: Workflow input values (accessible as inputs.propertyName)
|
|
1084
|
+
* - variables: Workflow state variables (accessible as variables.propertyName or vars.propertyName)
|
|
1085
|
+
* - outputs: Previous activity outputs (accessible as outputs.activityId)
|
|
1086
|
+
* - context.eval(path): Function to access nested properties from workflow data
|
|
1087
|
+
*
|
|
1088
|
+
* Expressions can use:
|
|
1089
|
+
* - {{inputs.userName}} - Direct access to workflow input
|
|
1090
|
+
* - {{variables.someVar}} or {{vars.someVar}} - Direct access to workflow variable
|
|
1091
|
+
* - {{outputs.activityId.property}} - Direct access to previous activity output
|
|
1092
|
+
* - {{context.eval("inputs.userName")}} - Access via context.eval (supports nested paths)
|
|
1093
|
+
* - {{context.eval("variables.someVar")}} - Access variables via context.eval
|
|
1094
|
+
* - {{context.eval("outputs.activityId.property")}} - Access outputs via context.eval
|
|
1095
|
+
* - {{session.currentUser().name}} - Access current user via expression evaluator scope providers
|
|
1096
|
+
*
|
|
1097
|
+
* The context.eval() function provides a unified way to access all workflow data,
|
|
1098
|
+
* similar to how entity-detail-list uses context.eval() to access parent data.
|
|
1099
|
+
*
|
|
1100
|
+
* @param context - Workflow expression context containing inputs, variables, and outputs
|
|
1101
|
+
* @returns Expression evaluator scope with workflow data and context.eval() function
|
|
1495
1102
|
*/
|
|
1496
|
-
|
|
1103
|
+
buildScope(context: WorkflowExpressionContext): AXPExpressionEvaluatorScope;
|
|
1497
1104
|
/**
|
|
1498
|
-
*
|
|
1105
|
+
* Build expression evaluation scope from workflow instance state.
|
|
1106
|
+
*
|
|
1107
|
+
* Convenience method that extracts data from AXPWorkflowInstanceState.
|
|
1108
|
+
*
|
|
1109
|
+
* @param state - Workflow instance state
|
|
1110
|
+
* @param activityOutputs - Map of activity outputs (activityId -> output)
|
|
1111
|
+
* @returns Expression evaluator scope with workflow data and context.eval() function
|
|
1499
1112
|
*/
|
|
1500
|
-
|
|
1113
|
+
buildScopeFromState(state: AXPWorkflowInstanceState, activityOutputs?: Map<string, any> | Record<string, any>): AXPExpressionEvaluatorScope;
|
|
1114
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<WorkflowExpressionScopeService, never>;
|
|
1115
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<WorkflowExpressionScopeService>;
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
/** Context passed after a workflow step completes (resume, start, or interactive chain). */
|
|
1119
|
+
interface AXPWorkflowContinuationStepContext {
|
|
1120
|
+
instanceId: string;
|
|
1121
|
+
/** Consumed bookmark id from the task board (when known). */
|
|
1122
|
+
completedBookmarkId?: string;
|
|
1123
|
+
/** Activity id that just completed (human-task or interactive step). */
|
|
1124
|
+
completedActivityId?: string;
|
|
1125
|
+
/** Resume outcome that completed the step (e.g. start-fill, Submitted, Saved). */
|
|
1126
|
+
resumeOutcome?: string;
|
|
1127
|
+
/** Next pending task returned by the engine / workflow manager (when known). */
|
|
1128
|
+
pendingNextTask?: AXPWorkflowTask | null;
|
|
1129
|
+
}
|
|
1130
|
+
/**
|
|
1131
|
+
* Result of a continuation prompt in the current start/resume cycle.
|
|
1132
|
+
* Used by {@link AXPWorkflowManager} to avoid duplicate dialogs in the same cycle.
|
|
1133
|
+
*/
|
|
1134
|
+
type AXPWorkflowContinuationOfferResult = 'not-offered' | 'confirmed' | 'declined';
|
|
1135
|
+
/**
|
|
1136
|
+
* Optional hook: offer the current user to continue to the next workflow step.
|
|
1137
|
+
* Implemented by workflow-management (task board UX); invoked from {@link AXPWorkflowManager}.
|
|
1138
|
+
*/
|
|
1139
|
+
interface AXPWorkflowContinuationHook {
|
|
1501
1140
|
/**
|
|
1502
|
-
*
|
|
1141
|
+
* Before running an inline interactive activity chain (sign-off, forms, etc.).
|
|
1142
|
+
* Return `declined` to skip executing that chain in this resume/start call.
|
|
1503
1143
|
*/
|
|
1504
|
-
|
|
1144
|
+
offerBeforeInteractiveFlow?(context: AXPWorkflowContinuationStepContext): Promise<AXPWorkflowContinuationOfferResult>;
|
|
1145
|
+
/** After resume/start when the next human-task is on the task board, or no before-offer ran. */
|
|
1146
|
+
offerAfterWorkflowStep?(context: AXPWorkflowContinuationStepContext): Promise<AXPWorkflowContinuationOfferResult | void>;
|
|
1147
|
+
}
|
|
1148
|
+
declare const AXP_WORKFLOW_CONTINUATION_HOOK: InjectionToken<AXPWorkflowContinuationHook>;
|
|
1149
|
+
/** When true on resume `userInput`, skips the post-step continuation dialog (auto-advance). */
|
|
1150
|
+
declare const AXP_WORKFLOW_SUPPRESS_CONTINUATION_INPUT_KEY = "_suppressWorkflowContinuation";
|
|
1151
|
+
declare function isWorkflowContinuationSuppressed(userInput: unknown): boolean;
|
|
1152
|
+
|
|
1153
|
+
/**
|
|
1154
|
+
* Frontend step executed inline (dialog/popup), not suspended on the task board.
|
|
1155
|
+
* Derived from execution mode and task-board activity types — no per-activity hardcoding.
|
|
1156
|
+
*/
|
|
1157
|
+
declare function axpIsWorkflowInlineFrontendTask(task: AXPWorkflowTask | null | undefined): boolean;
|
|
1158
|
+
/** @deprecated Use {@link axpIsWorkflowInlineFrontendTask}. */
|
|
1159
|
+
declare function axpIsWorkflowInteractiveFrontendTask(task: AXPWorkflowTask | null | undefined): boolean;
|
|
1160
|
+
/** Resolved before-interactive behavior from task metadata (set by engine from activity definition). */
|
|
1161
|
+
declare function axpResolveWorkflowContinuationBeforeInteractive(task: AXPWorkflowTask | null | undefined): AXPWorkflowContinuationBeforeInteractive;
|
|
1162
|
+
/**
|
|
1163
|
+
* Whether to skip the pre-interactive "continue?" prompt based on activity metadata.
|
|
1164
|
+
* Assignee-specific rules are applied in workflow-management (needs session).
|
|
1165
|
+
*/
|
|
1166
|
+
declare function axpShouldSkipBeforeInteractiveFromMetadata(behavior: AXPWorkflowContinuationBeforeInteractive, completedWasHumanTask: boolean): boolean;
|
|
1167
|
+
/**
|
|
1168
|
+
* Whether to show a "continue?" prompt before running inline frontend activities.
|
|
1169
|
+
* Skips when the user already resumed a task-board step (primary action / resume).
|
|
1170
|
+
*/
|
|
1171
|
+
declare function axpShouldOfferBeforeInteractiveFlow(context: AXPWorkflowContinuationStepContext): boolean;
|
|
1172
|
+
/**
|
|
1173
|
+
* Whether the workflow advanced enough to consider a continuation prompt.
|
|
1174
|
+
* Includes pending interactive steps when inbox bookmarks are already consumed.
|
|
1175
|
+
*/
|
|
1176
|
+
declare function axpShouldOfferWorkflowContinuationAfterStep(context: AXPWorkflowContinuationStepContext, activeBookmarkActivityIds: string[]): boolean;
|
|
1177
|
+
|
|
1178
|
+
/**
|
|
1179
|
+
* Workflow Category - Extends AXPCategoryEntity for consistency and performance
|
|
1180
|
+
*
|
|
1181
|
+
* Inherited properties from AXPCategoryEntity:
|
|
1182
|
+
* - id: string - Unique identifier
|
|
1183
|
+
* - title: string - Display name
|
|
1184
|
+
* - description?: string - Category description
|
|
1185
|
+
* - parentId?: string - Parent category ID
|
|
1186
|
+
* - childrenCount: number - Direct child categories count (enables lazy loading)
|
|
1187
|
+
* - itemsCount?: number - Direct workflows count
|
|
1188
|
+
* - totalChildrenCount?: number - Total nested categories (optional, for analytics)
|
|
1189
|
+
* - totalItemsCount?: number - Total workflows in tree (optional, for analytics)
|
|
1190
|
+
*/
|
|
1191
|
+
interface AXPWorkflowCategory extends AXPCategoryEntity {
|
|
1505
1192
|
}
|
|
1506
1193
|
type AXPWorkflowProviderToken = AXPWorkflowProvider | Promise<AXPWorkflowProvider>;
|
|
1507
1194
|
declare const AXP_WORKFLOW_PROVIDER: InjectionToken<AXPWorkflowProviderToken[]>;
|
|
@@ -1509,15 +1196,16 @@ interface AXPWorkflowProvider {
|
|
|
1509
1196
|
/**
|
|
1510
1197
|
* Get list of workflow definitions for a category.
|
|
1511
1198
|
* @param categoryId - Category ID to filter workflows
|
|
1512
|
-
* @returns Promise of workflow definition
|
|
1199
|
+
* @returns Promise of workflow definition array
|
|
1513
1200
|
*/
|
|
1514
|
-
getList(categoryId: string): Promise<
|
|
1201
|
+
getList(categoryId: string): Promise<AXPWorkflowDefinition[]>;
|
|
1515
1202
|
/**
|
|
1516
|
-
* Get workflow definition
|
|
1203
|
+
* Get full workflow definition by name (unique identifier).
|
|
1204
|
+
* Used by workflow engines for execution and UI for metadata.
|
|
1517
1205
|
* @param name - Workflow name (unique identifier)
|
|
1518
|
-
* @returns Promise of workflow definition
|
|
1206
|
+
* @returns Promise of full workflow definition or null if not found
|
|
1519
1207
|
*/
|
|
1520
|
-
|
|
1208
|
+
getByName(name: string): Promise<AXPWorkflowDefinition | null>;
|
|
1521
1209
|
}
|
|
1522
1210
|
type AXPWorkflowCategoryProviderToken = AXPWorkflowCategoryProvider | Promise<AXPWorkflowCategoryProvider>;
|
|
1523
1211
|
declare const AXP_WORKFLOW_CATEGORY_PROVIDER: InjectionToken<AXPWorkflowCategoryProviderToken[]>;
|
|
@@ -1588,18 +1276,18 @@ declare class AXPWorkflowDefinitionService {
|
|
|
1588
1276
|
* - Returns cached result on subsequent calls
|
|
1589
1277
|
*
|
|
1590
1278
|
* @param categoryId - Category ID to get workflow definitions from
|
|
1591
|
-
* @returns Array of workflow
|
|
1279
|
+
* @returns Array of workflow definitions
|
|
1592
1280
|
*/
|
|
1593
|
-
getWorkflowsByCategoryId(categoryId: string): Promise<
|
|
1281
|
+
getWorkflowsByCategoryId(categoryId: string): Promise<AXPWorkflowDefinition[]>;
|
|
1594
1282
|
/**
|
|
1595
|
-
* Get single workflow definition
|
|
1283
|
+
* Get single workflow definition by name with O(1) lookup
|
|
1596
1284
|
*
|
|
1597
1285
|
* Optimization: Uses Map for instant retrieval
|
|
1598
1286
|
*
|
|
1599
1287
|
* @param name - Workflow name (unique identifier)
|
|
1600
|
-
* @returns Workflow definition
|
|
1288
|
+
* @returns Workflow definition or undefined if not found
|
|
1601
1289
|
*/
|
|
1602
|
-
getWorkflowByName(name: string): Promise<
|
|
1290
|
+
getWorkflowByName(name: string): Promise<AXPWorkflowDefinition | undefined>;
|
|
1603
1291
|
/**
|
|
1604
1292
|
* Get category ID containing a specific workflow definition
|
|
1605
1293
|
*
|
|
@@ -1663,5 +1351,5 @@ declare class AXPWorkflowDefinitionService {
|
|
|
1663
1351
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXPWorkflowDefinitionService>;
|
|
1664
1352
|
}
|
|
1665
1353
|
|
|
1666
|
-
export { AXPActivityDefinitionService, AXPWorkflowAction, AXPWorkflowContext, AXPWorkflowDefinitionService, AXPWorkflowError, AXPWorkflowEventService, AXPWorkflowFunction, AXPWorkflowLocalEngine, AXPWorkflowManager, AXPWorkflowModule, AXPWorkflowRegistryService, AXPWorkflowService, AXP_ACTIVITY_CATEGORY_PROVIDER, AXP_ACTIVITY_PROVIDER, AXP_WORKFLOW_CATEGORY_PROVIDER,
|
|
1667
|
-
export type {
|
|
1354
|
+
export { AXPActivityDefinitionService, AXPWorkflowAction, AXPWorkflowContext, AXPWorkflowDefinitionService, AXPWorkflowEngineError, AXPWorkflowError, AXPWorkflowEventService, AXPWorkflowFunction, AXPWorkflowLocalEngine, AXPWorkflowManager, AXPWorkflowModule, AXPWorkflowRegistryService, AXPWorkflowService, AXP_ACTIVITY_CATEGORY_PROVIDER, AXP_ACTIVITY_PROVIDER, AXP_WORKFLOW_CATEGORY_PROVIDER, AXP_WORKFLOW_CONTINUATION_HOOK, AXP_WORKFLOW_ENGINE, AXP_WORKFLOW_ERROR_CODES, AXP_WORKFLOW_PROVIDER, AXP_WORKFLOW_SUPPRESS_CONTINUATION_INPUT_KEY, AXP_WORKFLOW_TASK_BOARD_ACTIVITY_TYPES, ActivityExecutor, WorkflowExpressionScopeService, axpIsWorkflowInlineFrontendTask, axpIsWorkflowInteractiveFrontendTask, axpIsWorkflowTaskBoardActivityType, axpResolveWorkflowContinuationBeforeInteractive, axpShouldOfferBeforeInteractiveFlow, axpShouldOfferWorkflowContinuationAfterStep, axpShouldSkipBeforeInteractiveFromMetadata, createWorkFlowEvent, getWorkflowEngineErrorCode, getWorkflowEngineErrorInfo, isWorkflowContinuationSuppressed, ofType };
|
|
1355
|
+
export type { AXPActivityCategoryProvider, AXPActivityCategoryProviderToken, AXPActivityProvider, AXPActivityProviderToken, AXPClaimWorkflowTaskRequest, AXPClaimWorkflowTaskResponse, AXPFrontActivityCompleteRequest, AXPFrontActivityCompleteResponse, AXPGetWorkflowStateRequest, AXPReassignWorkflowTaskToSelfRequest, AXPReassignWorkflowTaskToSelfResponse, AXPResumeWorkflowRequest, AXPResumeWorkflowResponse, AXPRevertResumeAfterDeclinedInteractiveContinuationRequest, AXPRevertResumeAfterDeclinedInteractiveContinuationResponse, AXPStartWorkflowRequest, AXPStartWorkflowResponse, AXPWorkflow, AXPWorkflowActionInput, AXPWorkflowCategory, AXPWorkflowCategoryProvider, AXPWorkflowCategoryProviderToken, AXPWorkflowCondition, AXPWorkflowConditionType, AXPWorkflowContinuationHook, AXPWorkflowContinuationOfferResult, AXPWorkflowContinuationStepContext, AXPWorkflowEngine, AXPWorkflowErrorCode, AXPWorkflowEvent, AXPWorkflowInstanceState, AXPWorkflowModuleConfigs, AXPWorkflowNextStep, AXPWorkflowProvider, AXPWorkflowProviderToken, AXPWorkflowStep, AXPWorkflowTask, ActivityExecutionResult, WorkflowClaimTaskResult, WorkflowCompleteResult, WorkflowExpressionContext, WorkflowReassignTaskToSelfResult, WorkflowResumeResult, WorkflowStartResult };
|