@acorex/platform 20.6.0-next.0 → 20.6.0-next.10
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/common/index.d.ts +7 -2
- package/core/index.d.ts +444 -4
- package/fesm2022/acorex-platform-auth.mjs +19 -19
- package/fesm2022/acorex-platform-auth.mjs.map +1 -1
- package/fesm2022/{acorex-platform-common-common-settings.provider-9OHien_H.mjs → acorex-platform-common-common-settings.provider-zhqNP3xb.mjs} +28 -4
- package/fesm2022/acorex-platform-common-common-settings.provider-zhqNP3xb.mjs.map +1 -0
- package/fesm2022/acorex-platform-common.mjs +105 -104
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +460 -55
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-domain.mjs +37 -38
- package/fesm2022/acorex-platform-domain.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +23 -19
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-components.mjs +646 -297
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +84 -84
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/{acorex-platform-layout-entity-create-entity.command-DyXF9zAh.mjs → acorex-platform-layout-entity-create-entity.command-DGeylNSY.mjs} +4 -4
- package/fesm2022/acorex-platform-layout-entity-create-entity.command-DGeylNSY.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-entity.mjs +442 -291
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-views.mjs +37 -23
- package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widget-core.mjs +158 -124
- package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
- package/fesm2022/{acorex-platform-layout-widgets-button-widget-designer.component-C_3IWNkj.mjs → acorex-platform-layout-widgets-button-widget-designer.component-C3VoBb_b.mjs} +4 -4
- package/fesm2022/acorex-platform-layout-widgets-button-widget-designer.component-C3VoBb_b.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-CJltEgut.mjs → acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-fhhZOWul.mjs} +4 -4
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-fhhZOWul.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-pM-TIuk0.mjs → acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-C3Qbs0fz.mjs} +4 -4
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-C3Qbs0fz.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-BqI96-fU.mjs → acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-CngQBUlN.mjs} +4 -4
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-CngQBUlN.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-extra-properties-values-widget-view.component-C-AhenaM.mjs → acorex-platform-layout-widgets-extra-properties-values-widget-view.component-DSNo9e4W.mjs} +4 -4
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-view.component-DSNo9e4W.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-extra-properties-widget-edit.component-DCAya5ne.mjs → acorex-platform-layout-widgets-extra-properties-widget-edit.component-CL0CwEHX.mjs} +4 -4
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-edit.component-CL0CwEHX.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-extra-properties-widget-view.component-D-PnBqLb.mjs → acorex-platform-layout-widgets-extra-properties-widget-view.component-B6Fi0xTw.mjs} +4 -4
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-view.component-B6Fi0xTw.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-file-list-popup.component-CGEHOyKT.mjs → acorex-platform-layout-widgets-file-list-popup.component-D0y-9nE5.mjs} +7 -7
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-D0y-9nE5.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-page-widget-designer.component-Bss0xUcu.mjs → acorex-platform-layout-widgets-page-widget-designer.component-BtZMBxYp.mjs} +4 -4
- package/fesm2022/acorex-platform-layout-widgets-page-widget-designer.component-BtZMBxYp.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-tabular-data-edit-popup.component-Cy9mHnNP.mjs → acorex-platform-layout-widgets-tabular-data-edit-popup.component-C1l2KSDa.mjs} +7 -7
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-C1l2KSDa.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-tabular-data-view-popup.component-DznLtuer.mjs → acorex-platform-layout-widgets-tabular-data-view-popup.component-D-31ej0C.mjs} +4 -4
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-D-31ej0C.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-text-block-widget-designer.component-ndOUSFi9.mjs → acorex-platform-layout-widgets-text-block-widget-designer.component-Df1BFkSa.mjs} +4 -4
- package/fesm2022/acorex-platform-layout-widgets-text-block-widget-designer.component-Df1BFkSa.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets.mjs +2802 -958
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
- package/fesm2022/acorex-platform-native.mjs +7 -7
- package/fesm2022/acorex-platform-native.mjs.map +1 -1
- package/fesm2022/acorex-platform-runtime.mjs +49 -42
- package/fesm2022/acorex-platform-runtime.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-B1PT6FtZ.mjs → acorex-platform-themes-default-entity-master-create-view.component-WbPPqDON.mjs} +5 -5
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-WbPPqDON.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-CD7rJIMh.mjs +803 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-CD7rJIMh.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-modify-view.component-4g19A3eI.mjs → acorex-platform-themes-default-entity-master-modify-view.component-BTA6h7Xd.mjs} +5 -5
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BTA6h7Xd.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-B8gx5cG7.mjs → acorex-platform-themes-default-entity-master-single-view.component-B_P0a5KW.mjs} +8 -8
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-B_P0a5KW.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-error-401.component-CcvGfdhu.mjs → acorex-platform-themes-default-error-401.component-cfREo88K.mjs} +4 -4
- package/fesm2022/acorex-platform-themes-default-error-401.component-cfREo88K.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-error-404.component-4-CaEsnV.mjs → acorex-platform-themes-default-error-404.component-CdCV5ZoA.mjs} +4 -4
- package/fesm2022/acorex-platform-themes-default-error-404.component-CdCV5ZoA.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-error-offline.component-E7SzBcAt.mjs +19 -0
- package/fesm2022/acorex-platform-themes-default-error-offline.component-E7SzBcAt.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +39 -39
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-shared-icon-chooser-view.component-Dc_Txe32.mjs → acorex-platform-themes-shared-icon-chooser-view.component-9W52W6Nu.mjs} +4 -4
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-9W52W6Nu.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-shared-settings.provider-DY2xFnrv.mjs → acorex-platform-themes-shared-settings.provider-DSs1o1M6.mjs} +18 -18
- package/fesm2022/acorex-platform-themes-shared-settings.provider-DSs1o1M6.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-column.component-hgWLhhle.mjs → acorex-platform-themes-shared-theme-color-chooser-column.component-DTnfRy5f.mjs} +4 -4
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-DTnfRy5f.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-view.component-CY3JZK_W.mjs → acorex-platform-themes-shared-theme-color-chooser-view.component-DY0JtT1v.mjs} +4 -4
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-DY0JtT1v.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared.mjs +58 -58
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/fesm2022/acorex-platform-workflow.mjs +1413 -28
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
- package/layout/builder/index.d.ts +6 -2
- package/layout/components/index.d.ts +32 -2
- package/layout/entity/index.d.ts +25 -10
- package/layout/views/index.d.ts +1 -0
- package/layout/widget-core/index.d.ts +14 -0
- package/layout/widgets/index.d.ts +352 -19
- package/package.json +11 -11
- package/themes/default/index.d.ts +3 -4
- package/workflow/index.d.ts +1987 -3
- package/fesm2022/acorex-platform-common-common-settings.provider-9OHien_H.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-entity-create-entity.command-DyXF9zAh.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-button-widget-designer.component-C_3IWNkj.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-CJltEgut.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-pM-TIuk0.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-BqI96-fU.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-view.component-C-AhenaM.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-edit.component-DCAya5ne.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-view.component-D-PnBqLb.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-CGEHOyKT.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-page-widget-designer.component-Bss0xUcu.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-Cy9mHnNP.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-DznLtuer.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-text-block-widget-designer.component-ndOUSFi9.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-B1PT6FtZ.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-ccqB5ShI.mjs +0 -748
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-ccqB5ShI.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-4g19A3eI.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-B8gx5cG7.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-error-401.component-CcvGfdhu.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-error-404.component-4-CaEsnV.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-error-offline.component-BNecbFEj.mjs +0 -19
- package/fesm2022/acorex-platform-themes-default-error-offline.component-BNecbFEj.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-Dc_Txe32.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-settings.provider-DY2xFnrv.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-hgWLhhle.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-CY3JZK_W.mjs.map +0 -1
package/workflow/index.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import * as rxjs from 'rxjs';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Type, ModuleWithProviders, Injector } from '@angular/core';
|
|
4
|
+
import { Type, ModuleWithProviders, Injector, InjectionToken } from '@angular/core';
|
|
5
|
+
import { AXPCommand } from '@acorex/platform/runtime';
|
|
6
|
+
import { AXPValidationRules } from '@acorex/platform/core';
|
|
7
|
+
import { AXPWidgetTypesMap } from '@acorex/platform/layout/widget-core';
|
|
8
|
+
import { AXStyleColorType } from '@acorex/cdk/common';
|
|
5
9
|
|
|
6
10
|
declare class AXPWorkflowError extends Error {
|
|
7
11
|
inner: Error | null;
|
|
@@ -111,6 +115,7 @@ interface AXPWorkflowModuleConfigs {
|
|
|
111
115
|
};
|
|
112
116
|
}
|
|
113
117
|
declare class AXPWorkflowModule {
|
|
118
|
+
private _commandSetup;
|
|
114
119
|
static forRoot(config?: AXPWorkflowModuleConfigs): ModuleWithProviders<AXPWorkflowModule>;
|
|
115
120
|
static forChild(config?: AXPWorkflowModuleConfigs): ModuleWithProviders<AXPWorkflowModule>;
|
|
116
121
|
/**
|
|
@@ -144,5 +149,1984 @@ declare class AXPWorkflowService {
|
|
|
144
149
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXPWorkflowService>;
|
|
145
150
|
}
|
|
146
151
|
|
|
147
|
-
|
|
148
|
-
|
|
152
|
+
/**
|
|
153
|
+
* Base entity with versioning support.
|
|
154
|
+
*/
|
|
155
|
+
interface AXPVersionedEntity {
|
|
156
|
+
version: number;
|
|
157
|
+
isLatest: boolean;
|
|
158
|
+
isPublished: boolean;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Workflow definition stored in database.
|
|
162
|
+
* This is the stored format that matches Elsa backend structure.
|
|
163
|
+
*/
|
|
164
|
+
interface AXPStoredWorkflowDefinition extends AXPVersionedEntity {
|
|
165
|
+
/**
|
|
166
|
+
* Unique ID of this workflow definition version.
|
|
167
|
+
*/
|
|
168
|
+
id: string;
|
|
169
|
+
/**
|
|
170
|
+
* Logical definition ID (same across all versions).
|
|
171
|
+
*/
|
|
172
|
+
definitionId: string;
|
|
173
|
+
/**
|
|
174
|
+
* Tenant ID (nullable).
|
|
175
|
+
*/
|
|
176
|
+
tenantId?: string | null;
|
|
177
|
+
/**
|
|
178
|
+
* Human-readable name.
|
|
179
|
+
*/
|
|
180
|
+
name?: string | null;
|
|
181
|
+
/**
|
|
182
|
+
* Description of what the workflow does.
|
|
183
|
+
*/
|
|
184
|
+
description?: string | null;
|
|
185
|
+
/**
|
|
186
|
+
* Creation timestamp (ISO date-time).
|
|
187
|
+
*/
|
|
188
|
+
createdAt: string;
|
|
189
|
+
/**
|
|
190
|
+
* Version of the tool that produced this definition (e.g. "3.2.0.0").
|
|
191
|
+
*/
|
|
192
|
+
toolVersion?: string | null;
|
|
193
|
+
/**
|
|
194
|
+
* Materializer name for deserialization.
|
|
195
|
+
*/
|
|
196
|
+
materializerName?: string;
|
|
197
|
+
/**
|
|
198
|
+
* JSON data (for simple workflows).
|
|
199
|
+
*/
|
|
200
|
+
stringData?: string;
|
|
201
|
+
/**
|
|
202
|
+
* Binary data (for complex workflows).
|
|
203
|
+
*/
|
|
204
|
+
binaryData?: Uint8Array;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Variable definition.
|
|
208
|
+
* Matches VariableDefinition from workflow definition schema.
|
|
209
|
+
*/
|
|
210
|
+
interface AXPVariableDefinition {
|
|
211
|
+
/**
|
|
212
|
+
* Variable ID.
|
|
213
|
+
*/
|
|
214
|
+
id?: string;
|
|
215
|
+
/**
|
|
216
|
+
* Variable name.
|
|
217
|
+
*/
|
|
218
|
+
name: string;
|
|
219
|
+
/**
|
|
220
|
+
* Type name (e.g., "String", "Int32", "Boolean").
|
|
221
|
+
*/
|
|
222
|
+
typeName: string;
|
|
223
|
+
/**
|
|
224
|
+
* Whether this is an array type.
|
|
225
|
+
*/
|
|
226
|
+
isArray?: boolean;
|
|
227
|
+
/**
|
|
228
|
+
* Variable value (as string expression or literal).
|
|
229
|
+
*/
|
|
230
|
+
value?: string | null;
|
|
231
|
+
/**
|
|
232
|
+
* Storage driver type name (for custom storage).
|
|
233
|
+
*/
|
|
234
|
+
storageDriverTypeName?: string | null;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Workflow input definition.
|
|
238
|
+
* Matches WorkflowInputDefinition from workflow definition schema.
|
|
239
|
+
*/
|
|
240
|
+
interface AXPWorkflowInputDefinition {
|
|
241
|
+
/**
|
|
242
|
+
* Input type (e.g., "String", "Int32", "Object").
|
|
243
|
+
*/
|
|
244
|
+
type: string;
|
|
245
|
+
/**
|
|
246
|
+
* Input name.
|
|
247
|
+
*/
|
|
248
|
+
name: string;
|
|
249
|
+
/**
|
|
250
|
+
* Display name.
|
|
251
|
+
*/
|
|
252
|
+
displayName?: string;
|
|
253
|
+
/**
|
|
254
|
+
* Description.
|
|
255
|
+
*/
|
|
256
|
+
description?: string;
|
|
257
|
+
/**
|
|
258
|
+
* Category for grouping.
|
|
259
|
+
*/
|
|
260
|
+
category?: string;
|
|
261
|
+
/**
|
|
262
|
+
* UI hint (widget type).
|
|
263
|
+
*/
|
|
264
|
+
uiHint?: string;
|
|
265
|
+
/**
|
|
266
|
+
* Storage driver type (for custom storage).
|
|
267
|
+
*/
|
|
268
|
+
storageDriverType?: string | null;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Workflow output definition.
|
|
272
|
+
* Matches WorkflowOutputDefinition from workflow definition schema.
|
|
273
|
+
*/
|
|
274
|
+
interface AXPWorkflowOutputDefinition {
|
|
275
|
+
/**
|
|
276
|
+
* Output type (e.g., "String", "Int32", "Object").
|
|
277
|
+
*/
|
|
278
|
+
type: string;
|
|
279
|
+
/**
|
|
280
|
+
* Output name.
|
|
281
|
+
*/
|
|
282
|
+
name: string;
|
|
283
|
+
/**
|
|
284
|
+
* Display name.
|
|
285
|
+
*/
|
|
286
|
+
displayName?: string;
|
|
287
|
+
/**
|
|
288
|
+
* Description.
|
|
289
|
+
*/
|
|
290
|
+
description?: string;
|
|
291
|
+
/**
|
|
292
|
+
* Category for grouping.
|
|
293
|
+
*/
|
|
294
|
+
category?: string;
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Expression.
|
|
298
|
+
* Used for dynamic values in activities.
|
|
299
|
+
*/
|
|
300
|
+
interface AXPExpression {
|
|
301
|
+
/**
|
|
302
|
+
* Expression type (e.g., "Literal", "JavaScript", "Liquid").
|
|
303
|
+
*/
|
|
304
|
+
type: string;
|
|
305
|
+
/**
|
|
306
|
+
* Expression value.
|
|
307
|
+
*/
|
|
308
|
+
value?: any;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Input value wrapper.
|
|
312
|
+
* Wraps an expression with type information.
|
|
313
|
+
*/
|
|
314
|
+
interface AXPInputValue {
|
|
315
|
+
/**
|
|
316
|
+
* Type name.
|
|
317
|
+
*/
|
|
318
|
+
typeName: string;
|
|
319
|
+
/**
|
|
320
|
+
* Expression (or null).
|
|
321
|
+
*/
|
|
322
|
+
expression?: AXPExpression | null;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Output value wrapper.
|
|
326
|
+
* References memory location.
|
|
327
|
+
*/
|
|
328
|
+
interface AXPOutputValue {
|
|
329
|
+
/**
|
|
330
|
+
* Type name.
|
|
331
|
+
*/
|
|
332
|
+
typeName: string;
|
|
333
|
+
/**
|
|
334
|
+
* Memory reference (or null).
|
|
335
|
+
*/
|
|
336
|
+
memoryReference?: {
|
|
337
|
+
id: string;
|
|
338
|
+
} | null;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Position (for visual layout).
|
|
342
|
+
*/
|
|
343
|
+
interface AXPPosition {
|
|
344
|
+
x: number;
|
|
345
|
+
y: number;
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Endpoint (connection point).
|
|
349
|
+
*/
|
|
350
|
+
interface AXPEndpoint {
|
|
351
|
+
/**
|
|
352
|
+
* Activity ID.
|
|
353
|
+
*/
|
|
354
|
+
activity: string;
|
|
355
|
+
/**
|
|
356
|
+
* Port name (nullable).
|
|
357
|
+
*/
|
|
358
|
+
port?: string | null;
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Connection between activities.
|
|
362
|
+
*/
|
|
363
|
+
interface AXPConnection {
|
|
364
|
+
/**
|
|
365
|
+
* Source endpoint.
|
|
366
|
+
*/
|
|
367
|
+
source: AXPEndpoint;
|
|
368
|
+
/**
|
|
369
|
+
* Target endpoint.
|
|
370
|
+
*/
|
|
371
|
+
target: AXPEndpoint;
|
|
372
|
+
/**
|
|
373
|
+
* Connection vertices (for curved paths).
|
|
374
|
+
*/
|
|
375
|
+
vertices?: AXPPosition[];
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Variable model (for flowchart variables).
|
|
379
|
+
*/
|
|
380
|
+
interface AXPVariableModel {
|
|
381
|
+
id: string;
|
|
382
|
+
name: string;
|
|
383
|
+
typeName: string;
|
|
384
|
+
value?: string | null;
|
|
385
|
+
storageDriverTypeName?: string | null;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Metadata (designer annotations).
|
|
389
|
+
*/
|
|
390
|
+
interface AXPMetadata {
|
|
391
|
+
[key: string]: any;
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Custom properties (free-form bag).
|
|
395
|
+
*/
|
|
396
|
+
interface AXPCustomProperties {
|
|
397
|
+
/**
|
|
398
|
+
* Connections that reference non-existent activities.
|
|
399
|
+
*/
|
|
400
|
+
notFoundConnections?: AXPConnection[];
|
|
401
|
+
/**
|
|
402
|
+
* Additional custom properties.
|
|
403
|
+
*/
|
|
404
|
+
[key: string]: any;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Base activity (workflow definition format).
|
|
408
|
+
* Matches Activity from workflow definition schema.
|
|
409
|
+
* Note: This is the workflow definition format, not the frontend Activity class.
|
|
410
|
+
*/
|
|
411
|
+
interface AXPActivity {
|
|
412
|
+
/**
|
|
413
|
+
* Activity ID.
|
|
414
|
+
*/
|
|
415
|
+
id: string;
|
|
416
|
+
/**
|
|
417
|
+
* Node ID (for visual designer).
|
|
418
|
+
*/
|
|
419
|
+
nodeId: string;
|
|
420
|
+
/**
|
|
421
|
+
* Activity name.
|
|
422
|
+
*/
|
|
423
|
+
name?: string | null;
|
|
424
|
+
/**
|
|
425
|
+
* Activity type (e.g., "Elsa.WriteLine", "Elsa.If").
|
|
426
|
+
*/
|
|
427
|
+
type: string;
|
|
428
|
+
/**
|
|
429
|
+
* Activity version.
|
|
430
|
+
*/
|
|
431
|
+
version: number;
|
|
432
|
+
/**
|
|
433
|
+
* Execution mode for this activity instance.
|
|
434
|
+
* Determines where this activity should be executed:
|
|
435
|
+
* - 'frontend': Execute in browser (UI activities like dialogs, toasts, navigation)
|
|
436
|
+
* - 'backend': Execute in backend (business logic, database operations, API calls)
|
|
437
|
+
* - 'both': Execute in both frontend and backend (hybrid activities)
|
|
438
|
+
*
|
|
439
|
+
* If not specified, falls back to ActivityDescriptor's executionMode.
|
|
440
|
+
* This allows per-instance override of the default execution mode.
|
|
441
|
+
*
|
|
442
|
+
* @example
|
|
443
|
+
* ```json
|
|
444
|
+
* {
|
|
445
|
+
* "id": "show-dialog",
|
|
446
|
+
* "type": "Elsa.ShowDialog",
|
|
447
|
+
* "executionMode": "frontend"
|
|
448
|
+
* }
|
|
449
|
+
* ```
|
|
450
|
+
*/
|
|
451
|
+
executionMode?: 'frontend' | 'backend' | 'both';
|
|
452
|
+
/**
|
|
453
|
+
* Custom properties.
|
|
454
|
+
*/
|
|
455
|
+
customProperties?: AXPCustomProperties;
|
|
456
|
+
/**
|
|
457
|
+
* Metadata (designer annotations).
|
|
458
|
+
*/
|
|
459
|
+
metadata?: AXPMetadata;
|
|
460
|
+
/**
|
|
461
|
+
* Additional type-specific properties.
|
|
462
|
+
*/
|
|
463
|
+
[key: string]: any;
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Flowchart activity (workflow definition format).
|
|
467
|
+
* Matches Flowchart from workflow definition schema.
|
|
468
|
+
* This is the root activity that contains all other activities.
|
|
469
|
+
*/
|
|
470
|
+
interface AXPFlowchart extends AXPActivity {
|
|
471
|
+
/**
|
|
472
|
+
* Type must be "Elsa.Flowchart" (for Elsa backend compatibility).
|
|
473
|
+
*/
|
|
474
|
+
type: "Elsa.Flowchart";
|
|
475
|
+
/**
|
|
476
|
+
* Activities in this flowchart.
|
|
477
|
+
*/
|
|
478
|
+
activities: AXPActivity[];
|
|
479
|
+
/**
|
|
480
|
+
* Variables in this flowchart.
|
|
481
|
+
*/
|
|
482
|
+
variables?: AXPVariableModel[];
|
|
483
|
+
/**
|
|
484
|
+
* Connections between activities.
|
|
485
|
+
*/
|
|
486
|
+
connections: AXPConnection[];
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* Complete workflow definition (v3.0.0 format).
|
|
490
|
+
* This matches the Elsa Workflow Definition schema for backend compatibility.
|
|
491
|
+
* All workflow definitions use this format.
|
|
492
|
+
*/
|
|
493
|
+
interface AXPWorkflowDefinition {
|
|
494
|
+
/**
|
|
495
|
+
* Schema reference.
|
|
496
|
+
*/
|
|
497
|
+
$schema?: string;
|
|
498
|
+
/**
|
|
499
|
+
* Unique ID of this workflow definition version.
|
|
500
|
+
*/
|
|
501
|
+
id: string;
|
|
502
|
+
/**
|
|
503
|
+
* Logical definition ID (same across all versions).
|
|
504
|
+
*/
|
|
505
|
+
definitionId: string;
|
|
506
|
+
/**
|
|
507
|
+
* Tenant ID (nullable).
|
|
508
|
+
*/
|
|
509
|
+
tenantId?: string | null;
|
|
510
|
+
/**
|
|
511
|
+
* Human-readable name.
|
|
512
|
+
*/
|
|
513
|
+
name?: string | null;
|
|
514
|
+
/**
|
|
515
|
+
* Description.
|
|
516
|
+
*/
|
|
517
|
+
description?: string | null;
|
|
518
|
+
/**
|
|
519
|
+
* Creation timestamp (ISO date-time).
|
|
520
|
+
*/
|
|
521
|
+
createdAt: string;
|
|
522
|
+
/**
|
|
523
|
+
* Version number (minimum 1).
|
|
524
|
+
*/
|
|
525
|
+
version: number;
|
|
526
|
+
/**
|
|
527
|
+
* Tool version (e.g., "3.2.0.0").
|
|
528
|
+
*/
|
|
529
|
+
toolVersion?: string | null;
|
|
530
|
+
/**
|
|
531
|
+
* Workflow variables.
|
|
532
|
+
*/
|
|
533
|
+
variables?: AXPVariableDefinition[];
|
|
534
|
+
/**
|
|
535
|
+
* Workflow inputs.
|
|
536
|
+
*/
|
|
537
|
+
inputs?: AXPWorkflowInputDefinition[];
|
|
538
|
+
/**
|
|
539
|
+
* Workflow outputs.
|
|
540
|
+
*/
|
|
541
|
+
outputs?: AXPWorkflowOutputDefinition[];
|
|
542
|
+
/**
|
|
543
|
+
* Workflow outcomes.
|
|
544
|
+
*/
|
|
545
|
+
outcomes?: string[];
|
|
546
|
+
/**
|
|
547
|
+
* Custom properties.
|
|
548
|
+
*/
|
|
549
|
+
customProperties?: AXPCustomProperties;
|
|
550
|
+
/**
|
|
551
|
+
* Whether workflow is readonly.
|
|
552
|
+
*/
|
|
553
|
+
isReadonly: boolean;
|
|
554
|
+
/**
|
|
555
|
+
* Whether workflow is system workflow.
|
|
556
|
+
*/
|
|
557
|
+
isSystem: boolean;
|
|
558
|
+
/**
|
|
559
|
+
* Whether this is the latest version.
|
|
560
|
+
*/
|
|
561
|
+
isLatest: boolean;
|
|
562
|
+
/**
|
|
563
|
+
* Whether workflow is published.
|
|
564
|
+
*/
|
|
565
|
+
isPublished: boolean;
|
|
566
|
+
/**
|
|
567
|
+
* Workflow options.
|
|
568
|
+
*/
|
|
569
|
+
options?: AXPWorkflowOptions;
|
|
570
|
+
/**
|
|
571
|
+
* @deprecated Use options.usableAsActivity instead.
|
|
572
|
+
*/
|
|
573
|
+
usableAsActivity?: boolean | null;
|
|
574
|
+
/**
|
|
575
|
+
* Root activity (Flowchart).
|
|
576
|
+
*/
|
|
577
|
+
root: AXPFlowchart;
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* Workflow configuration options.
|
|
581
|
+
*/
|
|
582
|
+
interface AXPWorkflowOptions {
|
|
583
|
+
/**
|
|
584
|
+
* Activation strategy type.
|
|
585
|
+
*/
|
|
586
|
+
activationStrategyType?: string | null;
|
|
587
|
+
/**
|
|
588
|
+
* Whether workflow can be used as an activity.
|
|
589
|
+
*/
|
|
590
|
+
usableAsActivity?: boolean | null;
|
|
591
|
+
/**
|
|
592
|
+
* Auto-update consuming workflows.
|
|
593
|
+
*/
|
|
594
|
+
autoUpdateConsumingWorkflows?: boolean;
|
|
595
|
+
/**
|
|
596
|
+
* Activity category (if usable as activity).
|
|
597
|
+
*/
|
|
598
|
+
activityCategory?: string | null;
|
|
599
|
+
/**
|
|
600
|
+
* Incident strategy type.
|
|
601
|
+
*/
|
|
602
|
+
incidentStrategyType?: string | null;
|
|
603
|
+
/**
|
|
604
|
+
* Commit strategy name.
|
|
605
|
+
*/
|
|
606
|
+
commitStrategyName?: string | null;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
/**
|
|
610
|
+
* Workflow status.
|
|
611
|
+
*/
|
|
612
|
+
type AXPWorkflowStatus = 'Running' | 'Finished';
|
|
613
|
+
/**
|
|
614
|
+
* Workflow sub-status.
|
|
615
|
+
*/
|
|
616
|
+
type AXPWorkflowSubStatus = 'Pending' | 'Executing' | 'Suspended' | 'Finished' | 'Cancelled' | 'Faulted';
|
|
617
|
+
/**
|
|
618
|
+
* Activity status.
|
|
619
|
+
*/
|
|
620
|
+
type AXPActivityStatus = 'Running' | 'Completed' | 'Canceled' | 'Faulted';
|
|
621
|
+
/**
|
|
622
|
+
* Exception state.
|
|
623
|
+
*/
|
|
624
|
+
interface AXPExceptionState {
|
|
625
|
+
/**
|
|
626
|
+
* Exception type name.
|
|
627
|
+
*/
|
|
628
|
+
type: string;
|
|
629
|
+
/**
|
|
630
|
+
* Exception message.
|
|
631
|
+
*/
|
|
632
|
+
message: string;
|
|
633
|
+
/**
|
|
634
|
+
* Stack trace (nullable).
|
|
635
|
+
*/
|
|
636
|
+
stackTrace?: string | null;
|
|
637
|
+
/**
|
|
638
|
+
* Inner exception (nullable).
|
|
639
|
+
*/
|
|
640
|
+
innerException?: AXPExceptionState | null;
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* Activity incident.
|
|
644
|
+
*/
|
|
645
|
+
interface AXPActivityIncident {
|
|
646
|
+
/**
|
|
647
|
+
* Activity ID that caused the incident.
|
|
648
|
+
*/
|
|
649
|
+
activityId: string;
|
|
650
|
+
/**
|
|
651
|
+
* Activity node ID.
|
|
652
|
+
*/
|
|
653
|
+
activityNodeId: string;
|
|
654
|
+
/**
|
|
655
|
+
* Activity type.
|
|
656
|
+
*/
|
|
657
|
+
activityType: string;
|
|
658
|
+
/**
|
|
659
|
+
* Incident message.
|
|
660
|
+
*/
|
|
661
|
+
message: string;
|
|
662
|
+
/**
|
|
663
|
+
* Exception (nullable).
|
|
664
|
+
*/
|
|
665
|
+
exception?: AXPExceptionState | null;
|
|
666
|
+
/**
|
|
667
|
+
* Timestamp (ISO date-time).
|
|
668
|
+
*/
|
|
669
|
+
timestamp: string;
|
|
670
|
+
}
|
|
671
|
+
/**
|
|
672
|
+
* Workflow fault state.
|
|
673
|
+
*/
|
|
674
|
+
interface AXPWorkflowFaultState {
|
|
675
|
+
/**
|
|
676
|
+
* Exception (nullable).
|
|
677
|
+
*/
|
|
678
|
+
exception?: AXPExceptionState | null;
|
|
679
|
+
/**
|
|
680
|
+
* Fault message.
|
|
681
|
+
*/
|
|
682
|
+
message: string;
|
|
683
|
+
/**
|
|
684
|
+
* Faulted activity ID (nullable).
|
|
685
|
+
*/
|
|
686
|
+
faultedActivityId?: string | null;
|
|
687
|
+
}
|
|
688
|
+
/**
|
|
689
|
+
* Bookmark.
|
|
690
|
+
*/
|
|
691
|
+
interface AXPBookmark {
|
|
692
|
+
/**
|
|
693
|
+
* Bookmark ID.
|
|
694
|
+
*/
|
|
695
|
+
id: string;
|
|
696
|
+
/**
|
|
697
|
+
* Bookmark name.
|
|
698
|
+
*/
|
|
699
|
+
name: string;
|
|
700
|
+
/**
|
|
701
|
+
* Bookmark hash.
|
|
702
|
+
*/
|
|
703
|
+
hash: string;
|
|
704
|
+
/**
|
|
705
|
+
* Bookmark payload (nullable).
|
|
706
|
+
*/
|
|
707
|
+
payload?: any | null;
|
|
708
|
+
/**
|
|
709
|
+
* Activity node ID.
|
|
710
|
+
*/
|
|
711
|
+
activityNodeId: string;
|
|
712
|
+
/**
|
|
713
|
+
* Activity instance ID.
|
|
714
|
+
*/
|
|
715
|
+
activityInstanceId: string;
|
|
716
|
+
/**
|
|
717
|
+
* Auto burn flag.
|
|
718
|
+
*/
|
|
719
|
+
autoBurn?: boolean;
|
|
720
|
+
/**
|
|
721
|
+
* Callback method name (nullable).
|
|
722
|
+
*/
|
|
723
|
+
callbackMethodName?: string | null;
|
|
724
|
+
/**
|
|
725
|
+
* Metadata (nullable).
|
|
726
|
+
*/
|
|
727
|
+
metadata?: Record<string, string> | null;
|
|
728
|
+
}
|
|
729
|
+
/**
|
|
730
|
+
* Completion callback state.
|
|
731
|
+
*/
|
|
732
|
+
interface AXPCompletionCallbackState {
|
|
733
|
+
/**
|
|
734
|
+
* Owner activity instance ID.
|
|
735
|
+
*/
|
|
736
|
+
ownerInstanceId: string;
|
|
737
|
+
/**
|
|
738
|
+
* Child activity node ID.
|
|
739
|
+
*/
|
|
740
|
+
childNodeId: string;
|
|
741
|
+
/**
|
|
742
|
+
* Method name (nullable).
|
|
743
|
+
*/
|
|
744
|
+
methodName?: string | null;
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* Variable (for activity context).
|
|
748
|
+
*/
|
|
749
|
+
interface AXPActivityVariable {
|
|
750
|
+
/**
|
|
751
|
+
* Variable ID.
|
|
752
|
+
*/
|
|
753
|
+
id: string;
|
|
754
|
+
/**
|
|
755
|
+
* Variable name.
|
|
756
|
+
*/
|
|
757
|
+
name: string;
|
|
758
|
+
/**
|
|
759
|
+
* Type name.
|
|
760
|
+
*/
|
|
761
|
+
typeName: string;
|
|
762
|
+
/**
|
|
763
|
+
* Is array flag.
|
|
764
|
+
*/
|
|
765
|
+
isArray?: boolean;
|
|
766
|
+
/**
|
|
767
|
+
* Variable value (nullable).
|
|
768
|
+
*/
|
|
769
|
+
value?: any | null;
|
|
770
|
+
/**
|
|
771
|
+
* Storage driver type name (nullable).
|
|
772
|
+
*/
|
|
773
|
+
storageDriverTypeName?: string | null;
|
|
774
|
+
}
|
|
775
|
+
/**
|
|
776
|
+
* Activity execution context state.
|
|
777
|
+
*/
|
|
778
|
+
interface AXPActivityExecutionContextState {
|
|
779
|
+
/**
|
|
780
|
+
* Context ID (activity instance ID).
|
|
781
|
+
*/
|
|
782
|
+
id: string;
|
|
783
|
+
/**
|
|
784
|
+
* Parent context ID (nullable).
|
|
785
|
+
*/
|
|
786
|
+
parentContextId?: string | null;
|
|
787
|
+
/**
|
|
788
|
+
* Scheduled activity node ID.
|
|
789
|
+
*/
|
|
790
|
+
scheduledActivityNodeId: string;
|
|
791
|
+
/**
|
|
792
|
+
* Owner activity node ID (nullable).
|
|
793
|
+
*/
|
|
794
|
+
ownerActivityNodeId?: string | null;
|
|
795
|
+
/**
|
|
796
|
+
* Properties bag.
|
|
797
|
+
*/
|
|
798
|
+
properties: Record<string, any>;
|
|
799
|
+
/**
|
|
800
|
+
* Activity state (evaluated properties) (nullable).
|
|
801
|
+
*/
|
|
802
|
+
activityState?: Record<string, any> | null;
|
|
803
|
+
/**
|
|
804
|
+
* Dynamic variables.
|
|
805
|
+
*/
|
|
806
|
+
dynamicVariables: AXPActivityVariable[];
|
|
807
|
+
/**
|
|
808
|
+
* Activity status.
|
|
809
|
+
*/
|
|
810
|
+
status: AXPActivityStatus;
|
|
811
|
+
/**
|
|
812
|
+
* Is executing flag.
|
|
813
|
+
*/
|
|
814
|
+
isExecuting: boolean;
|
|
815
|
+
/**
|
|
816
|
+
* Fault count.
|
|
817
|
+
*/
|
|
818
|
+
faultCount: number;
|
|
819
|
+
/**
|
|
820
|
+
* Started at timestamp (ISO date-time).
|
|
821
|
+
*/
|
|
822
|
+
startedAt: string;
|
|
823
|
+
/**
|
|
824
|
+
* Completed at timestamp (ISO date-time, nullable).
|
|
825
|
+
*/
|
|
826
|
+
completedAt?: string | null;
|
|
827
|
+
/**
|
|
828
|
+
* Tag (nullable).
|
|
829
|
+
*/
|
|
830
|
+
tag?: any | null;
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* Workflow state (internal execution state).
|
|
834
|
+
*/
|
|
835
|
+
interface AXPWorkflowState {
|
|
836
|
+
/**
|
|
837
|
+
* State ID.
|
|
838
|
+
*/
|
|
839
|
+
id: string;
|
|
840
|
+
/**
|
|
841
|
+
* Workflow definition ID.
|
|
842
|
+
*/
|
|
843
|
+
definitionId: string;
|
|
844
|
+
/**
|
|
845
|
+
* Workflow definition version.
|
|
846
|
+
*/
|
|
847
|
+
definitionVersion: number;
|
|
848
|
+
/**
|
|
849
|
+
* Correlation ID (nullable).
|
|
850
|
+
*/
|
|
851
|
+
correlationId?: string | null;
|
|
852
|
+
/**
|
|
853
|
+
* Workflow status.
|
|
854
|
+
*/
|
|
855
|
+
status: AXPWorkflowStatus;
|
|
856
|
+
/**
|
|
857
|
+
* Workflow sub-status.
|
|
858
|
+
*/
|
|
859
|
+
subStatus: AXPWorkflowSubStatus;
|
|
860
|
+
/**
|
|
861
|
+
* Bookmarks.
|
|
862
|
+
*/
|
|
863
|
+
bookmarks: AXPBookmark[];
|
|
864
|
+
/**
|
|
865
|
+
* Incidents.
|
|
866
|
+
*/
|
|
867
|
+
incidents: AXPActivityIncident[];
|
|
868
|
+
/**
|
|
869
|
+
* Fault (nullable).
|
|
870
|
+
*/
|
|
871
|
+
fault?: AXPWorkflowFaultState | null;
|
|
872
|
+
/**
|
|
873
|
+
* Completion callbacks.
|
|
874
|
+
*/
|
|
875
|
+
completionCallbacks: AXPCompletionCallbackState[];
|
|
876
|
+
/**
|
|
877
|
+
* Activity execution contexts.
|
|
878
|
+
*/
|
|
879
|
+
activityExecutionContexts: AXPActivityExecutionContextState[];
|
|
880
|
+
/**
|
|
881
|
+
* Input data.
|
|
882
|
+
*/
|
|
883
|
+
input: Record<string, any>;
|
|
884
|
+
/**
|
|
885
|
+
* Output data.
|
|
886
|
+
*/
|
|
887
|
+
output: Record<string, any>;
|
|
888
|
+
/**
|
|
889
|
+
* Properties bag.
|
|
890
|
+
*/
|
|
891
|
+
properties: Record<string, any>;
|
|
892
|
+
/**
|
|
893
|
+
* Created at timestamp (ISO date-time).
|
|
894
|
+
*/
|
|
895
|
+
createdAt: string;
|
|
896
|
+
/**
|
|
897
|
+
* Updated at timestamp (ISO date-time).
|
|
898
|
+
*/
|
|
899
|
+
updatedAt: string;
|
|
900
|
+
/**
|
|
901
|
+
* Finished at timestamp (ISO date-time, nullable).
|
|
902
|
+
*/
|
|
903
|
+
finishedAt?: string | null;
|
|
904
|
+
}
|
|
905
|
+
/**
|
|
906
|
+
* Workflow instance (stored in database).
|
|
907
|
+
* This matches the Elsa Workflow Instance schema for backend compatibility.
|
|
908
|
+
*/
|
|
909
|
+
interface AXPWorkflowInstance {
|
|
910
|
+
/**
|
|
911
|
+
* Schema reference.
|
|
912
|
+
*/
|
|
913
|
+
$schema?: string;
|
|
914
|
+
/**
|
|
915
|
+
* Unique instance ID.
|
|
916
|
+
*/
|
|
917
|
+
id: string;
|
|
918
|
+
/**
|
|
919
|
+
* Workflow definition ID.
|
|
920
|
+
*/
|
|
921
|
+
definitionId: string;
|
|
922
|
+
/**
|
|
923
|
+
* Workflow definition version ID.
|
|
924
|
+
*/
|
|
925
|
+
definitionVersionId: string;
|
|
926
|
+
/**
|
|
927
|
+
* Workflow definition version number.
|
|
928
|
+
*/
|
|
929
|
+
version: number;
|
|
930
|
+
/**
|
|
931
|
+
* Parent workflow instance ID (nullable, for child workflows).
|
|
932
|
+
*/
|
|
933
|
+
parentWorkflowInstanceId?: string | null;
|
|
934
|
+
/**
|
|
935
|
+
* Workflow state (internal execution state).
|
|
936
|
+
*/
|
|
937
|
+
workflowState: AXPWorkflowState;
|
|
938
|
+
/**
|
|
939
|
+
* Workflow status.
|
|
940
|
+
*/
|
|
941
|
+
status: AXPWorkflowStatus;
|
|
942
|
+
/**
|
|
943
|
+
* Workflow sub-status.
|
|
944
|
+
*/
|
|
945
|
+
subStatus: AXPWorkflowSubStatus;
|
|
946
|
+
/**
|
|
947
|
+
* Correlation ID (nullable).
|
|
948
|
+
*/
|
|
949
|
+
correlationId?: string | null;
|
|
950
|
+
/**
|
|
951
|
+
* Instance name (nullable).
|
|
952
|
+
*/
|
|
953
|
+
name?: string | null;
|
|
954
|
+
/**
|
|
955
|
+
* Incident count.
|
|
956
|
+
*/
|
|
957
|
+
incidentCount: number;
|
|
958
|
+
/**
|
|
959
|
+
* Created at timestamp (ISO date-time).
|
|
960
|
+
*/
|
|
961
|
+
createdAt: string;
|
|
962
|
+
/**
|
|
963
|
+
* Updated at timestamp (ISO date-time).
|
|
964
|
+
*/
|
|
965
|
+
updatedAt: string;
|
|
966
|
+
/**
|
|
967
|
+
* Finished at timestamp (ISO date-time, nullable).
|
|
968
|
+
*/
|
|
969
|
+
finishedAt?: string | null;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
interface ActivityPropertyWidget {
|
|
973
|
+
type: AXPWidgetTypesMap[keyof AXPWidgetTypesMap] | string;
|
|
974
|
+
options?: Record<string, any>;
|
|
975
|
+
}
|
|
976
|
+
/**
|
|
977
|
+
* Simple activity interface - just a command with outcomes.
|
|
978
|
+
* All activities are AXPCommand for unified execution through Command Bus.
|
|
979
|
+
*/
|
|
980
|
+
interface IActivity<TInput = any, TOutput = any> extends AXPCommand<TInput, {
|
|
981
|
+
output: TOutput;
|
|
982
|
+
outcomes: Record<string, any>;
|
|
983
|
+
}> {
|
|
984
|
+
/**
|
|
985
|
+
* Activity type name.
|
|
986
|
+
* Example: "WriteLine", "ShowDialog", "CreateUserCommand"
|
|
987
|
+
*/
|
|
988
|
+
type: string;
|
|
989
|
+
/**
|
|
990
|
+
* Display name for UI.
|
|
991
|
+
*/
|
|
992
|
+
name?: string;
|
|
993
|
+
/**
|
|
994
|
+
* Execute the activity as a command.
|
|
995
|
+
* @param input - Activity input data
|
|
996
|
+
* @returns Promise with output and outcomes
|
|
997
|
+
*/
|
|
998
|
+
execute(input: TInput): Promise<{
|
|
999
|
+
output: TOutput;
|
|
1000
|
+
outcomes: Record<string, any>;
|
|
1001
|
+
}>;
|
|
1002
|
+
}
|
|
1003
|
+
/**
|
|
1004
|
+
* Base abstract class for activities.
|
|
1005
|
+
* Extend this to create custom activities.
|
|
1006
|
+
*/
|
|
1007
|
+
declare abstract class Activity<TInput = any, TOutput = any> implements IActivity<TInput, TOutput> {
|
|
1008
|
+
type: string;
|
|
1009
|
+
name?: string;
|
|
1010
|
+
constructor(type: string, name?: string);
|
|
1011
|
+
/**
|
|
1012
|
+
* Execute the activity as a command.
|
|
1013
|
+
* Override this method in subclasses to implement activity logic.
|
|
1014
|
+
*/
|
|
1015
|
+
abstract execute(input: TInput): Promise<{
|
|
1016
|
+
output: TOutput;
|
|
1017
|
+
outcomes: Record<string, any>;
|
|
1018
|
+
}>;
|
|
1019
|
+
/**
|
|
1020
|
+
* Helper method that returns Done outcome by default.
|
|
1021
|
+
*/
|
|
1022
|
+
protected createResult(output: TOutput, outcome?: string): {
|
|
1023
|
+
output: TOutput;
|
|
1024
|
+
outcomes: Record<string, any>;
|
|
1025
|
+
};
|
|
1026
|
+
}
|
|
1027
|
+
/**
|
|
1028
|
+
* Activity descriptor - metadata about an activity type.
|
|
1029
|
+
*/
|
|
1030
|
+
interface ActivityDescriptor {
|
|
1031
|
+
/**
|
|
1032
|
+
* Activity type name.
|
|
1033
|
+
*/
|
|
1034
|
+
type: string;
|
|
1035
|
+
/**
|
|
1036
|
+
* Display name for UI.
|
|
1037
|
+
*/
|
|
1038
|
+
displayName: string;
|
|
1039
|
+
/**
|
|
1040
|
+
* Description of what the activity does.
|
|
1041
|
+
*/
|
|
1042
|
+
description?: string;
|
|
1043
|
+
/**
|
|
1044
|
+
* Category for grouping in toolbox.
|
|
1045
|
+
*/
|
|
1046
|
+
category: string;
|
|
1047
|
+
/**
|
|
1048
|
+
* Icon name or class.
|
|
1049
|
+
*/
|
|
1050
|
+
icon?: string;
|
|
1051
|
+
/**
|
|
1052
|
+
* Where this activity should be executed.
|
|
1053
|
+
* - 'frontend': Execute in browser (UI activities, console, events)
|
|
1054
|
+
* - 'backend': Execute in backend (business logic, API calls)
|
|
1055
|
+
* - 'both': Execute in both frontend and backend (hybrid activities)
|
|
1056
|
+
*
|
|
1057
|
+
* Default: 'frontend'
|
|
1058
|
+
*/
|
|
1059
|
+
executionMode?: 'frontend' | 'backend' | 'both';
|
|
1060
|
+
/**
|
|
1061
|
+
* Input descriptors.
|
|
1062
|
+
*/
|
|
1063
|
+
inputs: InputDescriptor[];
|
|
1064
|
+
/**
|
|
1065
|
+
* Output descriptors.
|
|
1066
|
+
*/
|
|
1067
|
+
outputs: OutputDescriptor[];
|
|
1068
|
+
/**
|
|
1069
|
+
* Static outcomes (exit points).
|
|
1070
|
+
* Example: ['Done', 'Success', 'Failed']
|
|
1071
|
+
*/
|
|
1072
|
+
outcomes?: string[];
|
|
1073
|
+
/**
|
|
1074
|
+
* Whether this activity is browsable in the toolbox.
|
|
1075
|
+
* Default: true
|
|
1076
|
+
*/
|
|
1077
|
+
isBrowsable?: boolean;
|
|
1078
|
+
/**
|
|
1079
|
+
* Whether this activity is a container (can have children).
|
|
1080
|
+
* Default: false
|
|
1081
|
+
*/
|
|
1082
|
+
isContainer?: boolean;
|
|
1083
|
+
}
|
|
1084
|
+
/**
|
|
1085
|
+
* Input property descriptor.
|
|
1086
|
+
* Similar to AXPEntityProperty structure.
|
|
1087
|
+
*/
|
|
1088
|
+
interface InputDescriptor {
|
|
1089
|
+
name: string;
|
|
1090
|
+
title: string;
|
|
1091
|
+
description?: string;
|
|
1092
|
+
schema: {
|
|
1093
|
+
dataType: string;
|
|
1094
|
+
nullable?: boolean;
|
|
1095
|
+
readonly?: boolean;
|
|
1096
|
+
hidden?: boolean | string;
|
|
1097
|
+
defaultValue?: any | string | ((context: any | null) => any);
|
|
1098
|
+
interface?: ActivityPropertyWidget;
|
|
1099
|
+
};
|
|
1100
|
+
validations?: AXPValidationRules;
|
|
1101
|
+
}
|
|
1102
|
+
/**
|
|
1103
|
+
* Output property descriptor.
|
|
1104
|
+
*/
|
|
1105
|
+
interface OutputDescriptor {
|
|
1106
|
+
name: string;
|
|
1107
|
+
title: string;
|
|
1108
|
+
description?: string;
|
|
1109
|
+
schema: {
|
|
1110
|
+
dataType: string;
|
|
1111
|
+
};
|
|
1112
|
+
}
|
|
1113
|
+
/**
|
|
1114
|
+
* Activity registry for registering and creating activities.
|
|
1115
|
+
*/
|
|
1116
|
+
declare class ActivityRegistry {
|
|
1117
|
+
private registry;
|
|
1118
|
+
private descriptors;
|
|
1119
|
+
/**
|
|
1120
|
+
* Register an activity type.
|
|
1121
|
+
*/
|
|
1122
|
+
register(type: string, factory: () => IActivity, descriptor: ActivityDescriptor): void;
|
|
1123
|
+
/**
|
|
1124
|
+
* Create an activity instance.
|
|
1125
|
+
*/
|
|
1126
|
+
create(type: string): IActivity;
|
|
1127
|
+
/**
|
|
1128
|
+
* Get activity descriptor.
|
|
1129
|
+
*/
|
|
1130
|
+
getDescriptor(type: string): ActivityDescriptor | undefined;
|
|
1131
|
+
/**
|
|
1132
|
+
* Get all registered types.
|
|
1133
|
+
*/
|
|
1134
|
+
getTypes(): string[];
|
|
1135
|
+
/**
|
|
1136
|
+
* Get all descriptors.
|
|
1137
|
+
*/
|
|
1138
|
+
getAllDescriptors(): ActivityDescriptor[];
|
|
1139
|
+
/**
|
|
1140
|
+
* Get descriptors by category.
|
|
1141
|
+
*/
|
|
1142
|
+
getDescriptorsByCategory(category: string): ActivityDescriptor[];
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
interface ActivityCategoryDescriptor {
|
|
1146
|
+
name: string;
|
|
1147
|
+
displayName: string;
|
|
1148
|
+
description?: string;
|
|
1149
|
+
icon?: string;
|
|
1150
|
+
color?: string;
|
|
1151
|
+
order?: number;
|
|
1152
|
+
isVisible?: boolean;
|
|
1153
|
+
tags?: string[];
|
|
1154
|
+
}
|
|
1155
|
+
interface AXPActivityCategoryProviderContext {
|
|
1156
|
+
registerCategories(categories: ActivityCategoryDescriptor[]): void;
|
|
1157
|
+
}
|
|
1158
|
+
interface AXPActivityCategoryProvider {
|
|
1159
|
+
provide(context: AXPActivityCategoryProviderContext): Promise<void> | void;
|
|
1160
|
+
}
|
|
1161
|
+
/**
|
|
1162
|
+
* Injection token for activity category providers.
|
|
1163
|
+
*/
|
|
1164
|
+
declare const AXP_ACTIVITY_CATEGORY_PROVIDER: InjectionToken<AXPActivityCategoryProvider[]>;
|
|
1165
|
+
declare class AXPActivityCategoryProviderService {
|
|
1166
|
+
private parent?;
|
|
1167
|
+
private providers;
|
|
1168
|
+
private categories;
|
|
1169
|
+
private isInitialized;
|
|
1170
|
+
constructor(parent?: AXPActivityCategoryProviderService | undefined, providers?: AXPActivityCategoryProvider[]);
|
|
1171
|
+
private initialize;
|
|
1172
|
+
getAllCategories(): ActivityCategoryDescriptor[];
|
|
1173
|
+
getCategory(name: string): ActivityCategoryDescriptor | undefined;
|
|
1174
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXPActivityCategoryProviderService, [{ optional: true; skipSelf: true; }, { optional: true; }]>;
|
|
1175
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXPActivityCategoryProviderService>;
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
/**
|
|
1179
|
+
* Context for registering activities in a provider.
|
|
1180
|
+
*/
|
|
1181
|
+
interface AXPActivityProviderContext {
|
|
1182
|
+
/**
|
|
1183
|
+
* Register an activity with its descriptor.
|
|
1184
|
+
*/
|
|
1185
|
+
registerActivity(config: {
|
|
1186
|
+
key: string;
|
|
1187
|
+
descriptor: ActivityDescriptor;
|
|
1188
|
+
}): void;
|
|
1189
|
+
}
|
|
1190
|
+
/**
|
|
1191
|
+
* Interface for activity providers.
|
|
1192
|
+
* Modules implement this to register their activities.
|
|
1193
|
+
*/
|
|
1194
|
+
interface AXPActivityProvider {
|
|
1195
|
+
/**
|
|
1196
|
+
* Provide activities to the system.
|
|
1197
|
+
*/
|
|
1198
|
+
provide(context: AXPActivityProviderContext): Promise<void> | void;
|
|
1199
|
+
}
|
|
1200
|
+
/**
|
|
1201
|
+
* Injection token for activity providers.
|
|
1202
|
+
*/
|
|
1203
|
+
declare const AXP_ACTIVITY_PROVIDER: InjectionToken<AXPActivityProvider[]>;
|
|
1204
|
+
/**
|
|
1205
|
+
* Category definition for activity categorization.
|
|
1206
|
+
*/
|
|
1207
|
+
interface ActivityCategory {
|
|
1208
|
+
name: string;
|
|
1209
|
+
displayName: string;
|
|
1210
|
+
description?: string;
|
|
1211
|
+
icon?: string;
|
|
1212
|
+
color?: string;
|
|
1213
|
+
order?: number;
|
|
1214
|
+
isVisible?: boolean;
|
|
1215
|
+
tags?: string[];
|
|
1216
|
+
}
|
|
1217
|
+
/**
|
|
1218
|
+
* Activity Provider Service.
|
|
1219
|
+
* Collects all activity providers and manages activity registration.
|
|
1220
|
+
*/
|
|
1221
|
+
declare class AXPActivityProviderService {
|
|
1222
|
+
private activityDescriptors;
|
|
1223
|
+
private categories;
|
|
1224
|
+
private providers;
|
|
1225
|
+
private categoryProviders;
|
|
1226
|
+
private initialized;
|
|
1227
|
+
private readonly commandService;
|
|
1228
|
+
private readonly commandRegistry;
|
|
1229
|
+
/**
|
|
1230
|
+
* Register an activity provider.
|
|
1231
|
+
*/
|
|
1232
|
+
registerProvider(provider: AXPActivityProvider): void;
|
|
1233
|
+
/**
|
|
1234
|
+
* Register a category provider.
|
|
1235
|
+
*/
|
|
1236
|
+
registerCategoryProvider(provider: AXPActivityCategoryProvider): void;
|
|
1237
|
+
/**
|
|
1238
|
+
* Initialize all providers.
|
|
1239
|
+
*/
|
|
1240
|
+
initialize(): Promise<void>;
|
|
1241
|
+
/**
|
|
1242
|
+
* Get activity descriptor by key.
|
|
1243
|
+
*/
|
|
1244
|
+
getDescriptor(key: string): ActivityDescriptor | undefined;
|
|
1245
|
+
/**
|
|
1246
|
+
* Get all activity descriptors.
|
|
1247
|
+
*/
|
|
1248
|
+
getAllDescriptors(): ActivityDescriptor[];
|
|
1249
|
+
/**
|
|
1250
|
+
* Get descriptors by category.
|
|
1251
|
+
*/
|
|
1252
|
+
getDescriptorsByCategory(category: string): ActivityDescriptor[];
|
|
1253
|
+
/**
|
|
1254
|
+
* Get all categories.
|
|
1255
|
+
*/
|
|
1256
|
+
getCategories(): ActivityCategory[];
|
|
1257
|
+
/**
|
|
1258
|
+
* Create an activity instance by key using AXPCommandService.
|
|
1259
|
+
*/
|
|
1260
|
+
createActivity(key: string): Promise<IActivity | null>;
|
|
1261
|
+
private initializeProvider;
|
|
1262
|
+
private initializeCategoryProvider;
|
|
1263
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXPActivityProviderService, never>;
|
|
1264
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXPActivityProviderService>;
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
/**
|
|
1268
|
+
* Types and interfaces for Workflow Execution Service.
|
|
1269
|
+
*/
|
|
1270
|
+
|
|
1271
|
+
/**
|
|
1272
|
+
* Represents a workflow task that needs to be executed.
|
|
1273
|
+
* Inspired by Temporal's Activity Tasks and Camunda's External Tasks.
|
|
1274
|
+
*/
|
|
1275
|
+
interface AXPWorkflowTask {
|
|
1276
|
+
/**
|
|
1277
|
+
* Unique token for this task (used for completion/security).
|
|
1278
|
+
*/
|
|
1279
|
+
taskToken: string;
|
|
1280
|
+
/**
|
|
1281
|
+
* Activity ID from workflow definition.
|
|
1282
|
+
*/
|
|
1283
|
+
activityId: string;
|
|
1284
|
+
/**
|
|
1285
|
+
* Activity type (e.g., 'workflow-activity:show-toast').
|
|
1286
|
+
*/
|
|
1287
|
+
activityType: string;
|
|
1288
|
+
/**
|
|
1289
|
+
* Human-readable activity name.
|
|
1290
|
+
*/
|
|
1291
|
+
activityName?: string;
|
|
1292
|
+
/**
|
|
1293
|
+
* Where this task should be executed.
|
|
1294
|
+
* - 'frontend': Execute in browser (UI activities, console, events)
|
|
1295
|
+
* - 'backend': Execute in backend (business logic, API calls)
|
|
1296
|
+
* - 'both': Execute in both frontend and backend (hybrid activities)
|
|
1297
|
+
*/
|
|
1298
|
+
executionMode: 'frontend' | 'backend' | 'both';
|
|
1299
|
+
/**
|
|
1300
|
+
* Input data for the activity (for frontend activities).
|
|
1301
|
+
*/
|
|
1302
|
+
input?: Record<string, any>;
|
|
1303
|
+
/**
|
|
1304
|
+
* Configuration for the activity (for frontend activities).
|
|
1305
|
+
*/
|
|
1306
|
+
config?: Record<string, any>;
|
|
1307
|
+
}
|
|
1308
|
+
/**
|
|
1309
|
+
* Request to start a workflow execution.
|
|
1310
|
+
*/
|
|
1311
|
+
interface AXPStartWorkflowExecutionRequest {
|
|
1312
|
+
/**
|
|
1313
|
+
* Workflow ID to execute.
|
|
1314
|
+
*/
|
|
1315
|
+
workflowId: string;
|
|
1316
|
+
/**
|
|
1317
|
+
* Initial input data for workflow.
|
|
1318
|
+
*/
|
|
1319
|
+
input: Record<string, any>;
|
|
1320
|
+
}
|
|
1321
|
+
/**
|
|
1322
|
+
* Response after starting workflow execution.
|
|
1323
|
+
*/
|
|
1324
|
+
interface AXPStartWorkflowExecutionResponse {
|
|
1325
|
+
/**
|
|
1326
|
+
* Unique execution ID for this workflow run.
|
|
1327
|
+
*/
|
|
1328
|
+
executionId: string;
|
|
1329
|
+
/**
|
|
1330
|
+
* Current workflow state.
|
|
1331
|
+
*/
|
|
1332
|
+
state: AXPWorkflowExecutionState;
|
|
1333
|
+
/**
|
|
1334
|
+
* First task to execute (determined by backend).
|
|
1335
|
+
* Client should execute this task based on executionMode.
|
|
1336
|
+
*/
|
|
1337
|
+
pendingTask?: AXPWorkflowTask | null;
|
|
1338
|
+
}
|
|
1339
|
+
/**
|
|
1340
|
+
* Request to resume a suspended workflow.
|
|
1341
|
+
*/
|
|
1342
|
+
interface AXPResumeWorkflowExecutionRequest {
|
|
1343
|
+
/**
|
|
1344
|
+
* Execution ID.
|
|
1345
|
+
*/
|
|
1346
|
+
executionId: string;
|
|
1347
|
+
/**
|
|
1348
|
+
* Step ID that was waiting for user input.
|
|
1349
|
+
*/
|
|
1350
|
+
stepId: string;
|
|
1351
|
+
/**
|
|
1352
|
+
* Secure task token issued with the pending task.
|
|
1353
|
+
* Backend validates and resolves the step using this token.
|
|
1354
|
+
*/
|
|
1355
|
+
taskToken: string;
|
|
1356
|
+
/**
|
|
1357
|
+
* User action outcome (e.g., 'Confirmed', 'Cancelled').
|
|
1358
|
+
*/
|
|
1359
|
+
outcome: string;
|
|
1360
|
+
/**
|
|
1361
|
+
* Optional user input data.
|
|
1362
|
+
*/
|
|
1363
|
+
userInput?: any;
|
|
1364
|
+
}
|
|
1365
|
+
/**
|
|
1366
|
+
* Response after resuming workflow.
|
|
1367
|
+
*/
|
|
1368
|
+
interface AXPResumeWorkflowExecutionResponse {
|
|
1369
|
+
/**
|
|
1370
|
+
* Activity execution output.
|
|
1371
|
+
*/
|
|
1372
|
+
output: any;
|
|
1373
|
+
/**
|
|
1374
|
+
* Activity execution outcomes.
|
|
1375
|
+
*/
|
|
1376
|
+
outcomes: Record<string, any>;
|
|
1377
|
+
/**
|
|
1378
|
+
* Next task to execute (if any).
|
|
1379
|
+
*/
|
|
1380
|
+
nextTask?: AXPWorkflowTask | null;
|
|
1381
|
+
/**
|
|
1382
|
+
* Updated workflow state.
|
|
1383
|
+
*/
|
|
1384
|
+
state: AXPWorkflowExecutionState;
|
|
1385
|
+
}
|
|
1386
|
+
/**
|
|
1387
|
+
* Request to get workflow execution state.
|
|
1388
|
+
*/
|
|
1389
|
+
interface AXPGetWorkflowExecutionStateRequest {
|
|
1390
|
+
/**
|
|
1391
|
+
* Execution ID.
|
|
1392
|
+
*/
|
|
1393
|
+
executionId: string;
|
|
1394
|
+
}
|
|
1395
|
+
/**
|
|
1396
|
+
* Request to get workflow definition.
|
|
1397
|
+
*/
|
|
1398
|
+
interface AXPGetWorkflowDefinitionRequest {
|
|
1399
|
+
/**
|
|
1400
|
+
* Workflow ID or definition ID.
|
|
1401
|
+
*/
|
|
1402
|
+
workflowId: string;
|
|
1403
|
+
}
|
|
1404
|
+
/**
|
|
1405
|
+
* Response with workflow definition.
|
|
1406
|
+
*/
|
|
1407
|
+
interface AXPGetWorkflowDefinitionResponse {
|
|
1408
|
+
/**
|
|
1409
|
+
* Workflow definition.
|
|
1410
|
+
*/
|
|
1411
|
+
workflow: AXPWorkflowDefinition;
|
|
1412
|
+
}
|
|
1413
|
+
/**
|
|
1414
|
+
* Workflow execution state (managed by backend, cached in client).
|
|
1415
|
+
*/
|
|
1416
|
+
interface AXPWorkflowExecutionState {
|
|
1417
|
+
/**
|
|
1418
|
+
* Unique execution ID.
|
|
1419
|
+
*/
|
|
1420
|
+
executionId: string;
|
|
1421
|
+
/**
|
|
1422
|
+
* Workflow ID.
|
|
1423
|
+
*/
|
|
1424
|
+
workflowId: string;
|
|
1425
|
+
/**
|
|
1426
|
+
* Current execution status.
|
|
1427
|
+
*/
|
|
1428
|
+
status: 'running' | 'completed' | 'suspended' | 'error';
|
|
1429
|
+
/**
|
|
1430
|
+
* Current step ID (if suspended or running).
|
|
1431
|
+
*/
|
|
1432
|
+
currentStepId?: string;
|
|
1433
|
+
/**
|
|
1434
|
+
* Workflow variables (state).
|
|
1435
|
+
*/
|
|
1436
|
+
variables: Record<string, any>;
|
|
1437
|
+
/**
|
|
1438
|
+
* Initial input data.
|
|
1439
|
+
*/
|
|
1440
|
+
input: Record<string, any>;
|
|
1441
|
+
/**
|
|
1442
|
+
* Final output data (if completed).
|
|
1443
|
+
*/
|
|
1444
|
+
output?: Record<string, any>;
|
|
1445
|
+
/**
|
|
1446
|
+
* Last update timestamp.
|
|
1447
|
+
*/
|
|
1448
|
+
lastUpdated: Date;
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
/**
|
|
1452
|
+
* Workflow execution result.
|
|
1453
|
+
*/
|
|
1454
|
+
interface WorkflowExecutionResult {
|
|
1455
|
+
success: boolean;
|
|
1456
|
+
output?: any;
|
|
1457
|
+
error?: string;
|
|
1458
|
+
nextTask?: AXPWorkflowTask | null;
|
|
1459
|
+
executionId?: string;
|
|
1460
|
+
state?: AXPWorkflowExecutionState;
|
|
1461
|
+
}
|
|
1462
|
+
/**
|
|
1463
|
+
* Production Workflow Coordinator.
|
|
1464
|
+
*
|
|
1465
|
+
* Separates frontend/backend execution:
|
|
1466
|
+
* - Frontend activities: Execute with AXPCommand in browser
|
|
1467
|
+
* - Backend activities: Execute via API calls to backend
|
|
1468
|
+
* - State caching: Caches workflow state in client for performance
|
|
1469
|
+
*
|
|
1470
|
+
* ✅ Suitable for production use.
|
|
1471
|
+
*/
|
|
1472
|
+
declare class WorkflowCoordinator {
|
|
1473
|
+
private readonly workflowExecutionService;
|
|
1474
|
+
private readonly commandService;
|
|
1475
|
+
/**
|
|
1476
|
+
* Cache workflow states in memory for quick access.
|
|
1477
|
+
* Key: executionId
|
|
1478
|
+
* Value: AXPWorkflowExecutionState
|
|
1479
|
+
*/
|
|
1480
|
+
private stateCache;
|
|
1481
|
+
/**
|
|
1482
|
+
* Start workflow execution in backend.
|
|
1483
|
+
*
|
|
1484
|
+
* Backend decides what to do: returns pendingTask or indicates completion.
|
|
1485
|
+
* Frontend only calls API - no business logic here.
|
|
1486
|
+
*
|
|
1487
|
+
* @param workflowId - Workflow ID
|
|
1488
|
+
* @param input - Initial input data
|
|
1489
|
+
* @returns Execution result with pendingTask (if any)
|
|
1490
|
+
*
|
|
1491
|
+
* @example
|
|
1492
|
+
* ```typescript
|
|
1493
|
+
* const result = await coordinator.startWorkflow('my-workflow', { userId: '123' });
|
|
1494
|
+
*
|
|
1495
|
+
* if (result.pendingTask) {
|
|
1496
|
+
* // Execute task if frontend, or wait for backend to complete
|
|
1497
|
+
* if (result.pendingTask.executionMode === 'frontend') {
|
|
1498
|
+
* await coordinator.executeTask(result.pendingTask);
|
|
1499
|
+
* await coordinator.completeTask(result.executionId, result.pendingTask, outcome, output);
|
|
1500
|
+
* }
|
|
1501
|
+
* }
|
|
1502
|
+
* ```
|
|
1503
|
+
*/
|
|
1504
|
+
startWorkflow(workflowId: string, input?: Record<string, any>): Promise<WorkflowExecutionResult>;
|
|
1505
|
+
/**
|
|
1506
|
+
* Execute a frontend task using AXPCommand.
|
|
1507
|
+
*
|
|
1508
|
+
* Only executes if task.executionMode is 'frontend' or 'both'.
|
|
1509
|
+
* Backend tasks are handled automatically by backend.
|
|
1510
|
+
*
|
|
1511
|
+
* @param task - Task to execute
|
|
1512
|
+
* @returns Execution result with output and outcome
|
|
1513
|
+
*/
|
|
1514
|
+
executeTask(task: AXPWorkflowTask): Promise<{
|
|
1515
|
+
output: any;
|
|
1516
|
+
outcome: string;
|
|
1517
|
+
}>;
|
|
1518
|
+
/**
|
|
1519
|
+
* Complete a task and get next task from backend.
|
|
1520
|
+
*
|
|
1521
|
+
* Sends task result to backend API.
|
|
1522
|
+
* Backend decides: next task, fail, or complete workflow.
|
|
1523
|
+
*
|
|
1524
|
+
* @param executionId - Execution ID
|
|
1525
|
+
* @param task - Completed task
|
|
1526
|
+
* @param outcome - Task outcome (e.g., 'Done', 'Confirmed', 'Cancelled')
|
|
1527
|
+
* @param output - Task output/result
|
|
1528
|
+
* @returns Next task from backend (if any)
|
|
1529
|
+
*/
|
|
1530
|
+
completeTask(executionId: string, task: AXPWorkflowTask, outcome: string, output?: any): Promise<WorkflowExecutionResult>;
|
|
1531
|
+
/**
|
|
1532
|
+
* Execute workflow by ID (backward compatibility).
|
|
1533
|
+
*
|
|
1534
|
+
* @deprecated Use startWorkflow + executeTask + completeTask pattern instead.
|
|
1535
|
+
* This method is kept for backward compatibility but will be removed.
|
|
1536
|
+
*/
|
|
1537
|
+
executeWorkflowById(workflowId: string, input?: Record<string, any>): Promise<WorkflowExecutionResult>;
|
|
1538
|
+
/**
|
|
1539
|
+
* Resume a suspended workflow (e.g., after user interaction).
|
|
1540
|
+
*
|
|
1541
|
+
* Backend determines nextStep based on outcome and outcomeConnections.
|
|
1542
|
+
* Client only provides executionId, stepId, outcome, and optional userInput.
|
|
1543
|
+
*
|
|
1544
|
+
* @param executionId - Workflow execution ID
|
|
1545
|
+
* @param stepId - Step ID that was waiting for user input
|
|
1546
|
+
* @param outcome - User action outcome (e.g., 'Confirmed', 'Cancelled', 'Submitted')
|
|
1547
|
+
* @param userInput - Optional user input data
|
|
1548
|
+
*/
|
|
1549
|
+
resumeWorkflow(executionId: string, stepId: string, outcome: string, userInput?: any, taskToken?: string): Promise<WorkflowExecutionResult>;
|
|
1550
|
+
/**
|
|
1551
|
+
* Get workflow execution state (from cache or backend).
|
|
1552
|
+
*/
|
|
1553
|
+
getWorkflowState(executionId: string): Promise<AXPWorkflowExecutionState | null>;
|
|
1554
|
+
/**
|
|
1555
|
+
* Execute a frontend activity using CommandBus.
|
|
1556
|
+
*
|
|
1557
|
+
* Frontend activities are executed in the browser using AXPCommandService.
|
|
1558
|
+
* Activities can also be executed in both frontend and backend (hybrid mode).
|
|
1559
|
+
*
|
|
1560
|
+
* @param task - Frontend task to execute
|
|
1561
|
+
* @returns Execution result with output and outcome
|
|
1562
|
+
*/
|
|
1563
|
+
private executeFrontendActivity;
|
|
1564
|
+
/**
|
|
1565
|
+
* Start workflow execution in backend.
|
|
1566
|
+
* Backend returns executionId, initial state, and first task to execute.
|
|
1567
|
+
*/
|
|
1568
|
+
private startWorkflowExecution;
|
|
1569
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<WorkflowCoordinator, never>;
|
|
1570
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<WorkflowCoordinator>;
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
/**
|
|
1574
|
+
* Abstract service for workflow execution operations.
|
|
1575
|
+
*
|
|
1576
|
+
* This service handles communication with backend for workflow execution.
|
|
1577
|
+
*
|
|
1578
|
+
* Implementation should be provided in connectivity layer:
|
|
1579
|
+
* - Mock implementation: @acorex/connectivity/mock
|
|
1580
|
+
* - API implementation: @acorex/connectivity/api
|
|
1581
|
+
*
|
|
1582
|
+
* @example
|
|
1583
|
+
* ```typescript
|
|
1584
|
+
* // In connectivity/mock
|
|
1585
|
+
* @Injectable()
|
|
1586
|
+
* export class AXCWorkflowExecutionService implements AXPWorkflowExecutionService {
|
|
1587
|
+
* async startExecution(request: AXPStartWorkflowExecutionRequest): Promise<AXPStartWorkflowExecutionResponse> {
|
|
1588
|
+
* // Mock implementation
|
|
1589
|
+
* }
|
|
1590
|
+
* }
|
|
1591
|
+
*
|
|
1592
|
+
* // In connectivity/api
|
|
1593
|
+
* @Injectable()
|
|
1594
|
+
* export class AXCWorkflowExecutionService implements AXPWorkflowExecutionService {
|
|
1595
|
+
* constructor(private http: HttpClient) {}
|
|
1596
|
+
*
|
|
1597
|
+
* async startExecution(request: AXPStartWorkflowExecutionRequest): Promise<AXPStartWorkflowExecutionResponse> {
|
|
1598
|
+
* return firstValueFrom(
|
|
1599
|
+
* this.http.post<AXPStartWorkflowExecutionResponse>(
|
|
1600
|
+
* `${this.config.baseUrl}/api/workflows/${request.workflowId}/start`,
|
|
1601
|
+
* { input: request.input }
|
|
1602
|
+
* )
|
|
1603
|
+
* );
|
|
1604
|
+
* }
|
|
1605
|
+
* }
|
|
1606
|
+
* ```
|
|
1607
|
+
*/
|
|
1608
|
+
declare abstract class AXPWorkflowExecutionService {
|
|
1609
|
+
/**
|
|
1610
|
+
* Start a new workflow execution.
|
|
1611
|
+
*
|
|
1612
|
+
* Creates a new workflow execution instance in backend and returns execution ID.
|
|
1613
|
+
*
|
|
1614
|
+
* @param request - Start execution request
|
|
1615
|
+
* @returns Execution response with executionId and initial state
|
|
1616
|
+
*
|
|
1617
|
+
* @example
|
|
1618
|
+
* ```typescript
|
|
1619
|
+
* const response = await workflowExecutionService.startExecution({
|
|
1620
|
+
* workflowId: 'my-workflow',
|
|
1621
|
+
* input: { userId: '123', action: 'create' }
|
|
1622
|
+
* });
|
|
1623
|
+
*
|
|
1624
|
+
* console.log('Execution ID:', response.executionId);
|
|
1625
|
+
* console.log('Initial State:', response.state);
|
|
1626
|
+
* ```
|
|
1627
|
+
*/
|
|
1628
|
+
abstract startExecution(request: AXPStartWorkflowExecutionRequest): Promise<AXPStartWorkflowExecutionResponse>;
|
|
1629
|
+
/**
|
|
1630
|
+
* Resume a suspended workflow execution.
|
|
1631
|
+
*
|
|
1632
|
+
* Resumes workflow execution after user interaction (e.g., after show-dialog).
|
|
1633
|
+
*
|
|
1634
|
+
* @param request - Resume execution request
|
|
1635
|
+
* @returns Resume response with next step and updated state
|
|
1636
|
+
*
|
|
1637
|
+
* @example
|
|
1638
|
+
* ```typescript
|
|
1639
|
+
* const response = await workflowExecutionService.resumeExecution({
|
|
1640
|
+
* executionId: 'exec-123',
|
|
1641
|
+
* stepId: 'step-dialog-1',
|
|
1642
|
+
* taskToken: 'sec-task-token',
|
|
1643
|
+
* outcome: 'Confirmed',
|
|
1644
|
+
* userInput: { confirmed: true }
|
|
1645
|
+
* });
|
|
1646
|
+
*
|
|
1647
|
+
* console.log('Next Step:', response.nextStep);
|
|
1648
|
+
* console.log('Updated State:', response.state);
|
|
1649
|
+
* ```
|
|
1650
|
+
*/
|
|
1651
|
+
abstract resumeExecution(request: AXPResumeWorkflowExecutionRequest): Promise<AXPResumeWorkflowExecutionResponse>;
|
|
1652
|
+
/**
|
|
1653
|
+
* Get current workflow execution state.
|
|
1654
|
+
*
|
|
1655
|
+
* Retrieves current state of a workflow execution from backend.
|
|
1656
|
+
*
|
|
1657
|
+
* @param request - Get state request
|
|
1658
|
+
* @returns Current workflow execution state
|
|
1659
|
+
*
|
|
1660
|
+
* @example
|
|
1661
|
+
* ```typescript
|
|
1662
|
+
* const state = await workflowExecutionService.getExecutionState({
|
|
1663
|
+
* executionId: 'exec-123'
|
|
1664
|
+
* });
|
|
1665
|
+
*
|
|
1666
|
+
* console.log('Status:', state.status);
|
|
1667
|
+
* console.log('Variables:', state.variables);
|
|
1668
|
+
* ```
|
|
1669
|
+
*/
|
|
1670
|
+
abstract getExecutionState(request: AXPGetWorkflowExecutionStateRequest): Promise<AXPWorkflowExecutionState>;
|
|
1671
|
+
/**
|
|
1672
|
+
* Get workflow definition by ID.
|
|
1673
|
+
*
|
|
1674
|
+
* Retrieves workflow definition from backend.
|
|
1675
|
+
*
|
|
1676
|
+
* @param request - Get workflow definition request
|
|
1677
|
+
* @returns Workflow definition in executable format
|
|
1678
|
+
*
|
|
1679
|
+
* @example
|
|
1680
|
+
* ```typescript
|
|
1681
|
+
* const response = await workflowExecutionService.getWorkflowDefinition({
|
|
1682
|
+
* workflowId: 'my-workflow'
|
|
1683
|
+
* });
|
|
1684
|
+
*
|
|
1685
|
+
* console.log('Workflow:', response.workflow);
|
|
1686
|
+
* ```
|
|
1687
|
+
*/
|
|
1688
|
+
abstract getWorkflowDefinition(request: AXPGetWorkflowDefinitionRequest): Promise<AXPGetWorkflowDefinitionResponse>;
|
|
1689
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXPWorkflowExecutionService, never>;
|
|
1690
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXPWorkflowExecutionService>;
|
|
1691
|
+
}
|
|
1692
|
+
|
|
1693
|
+
/**
|
|
1694
|
+
* WriteLine Activity - Simple console logging activity.
|
|
1695
|
+
*
|
|
1696
|
+
* Usage:
|
|
1697
|
+
* ```typescript
|
|
1698
|
+
* const activity = new WriteLine();
|
|
1699
|
+
* await activity.execute({ text: 'Hello World' });
|
|
1700
|
+
* ```
|
|
1701
|
+
*/
|
|
1702
|
+
declare class WriteLine extends Activity<{
|
|
1703
|
+
text?: string;
|
|
1704
|
+
}, void> {
|
|
1705
|
+
constructor();
|
|
1706
|
+
execute(input: {
|
|
1707
|
+
text?: string;
|
|
1708
|
+
}): Promise<{
|
|
1709
|
+
output: void;
|
|
1710
|
+
outcomes: Record<string, any>;
|
|
1711
|
+
}>;
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
/**
|
|
1715
|
+
* Sequence Activity - Executes activities in sequential order.
|
|
1716
|
+
*
|
|
1717
|
+
* Usage:
|
|
1718
|
+
* ```typescript
|
|
1719
|
+
* const sequence = new Sequence();
|
|
1720
|
+
* sequence.activities = [activity1, activity2, activity3];
|
|
1721
|
+
* await sequence.execute({});
|
|
1722
|
+
* ```
|
|
1723
|
+
*/
|
|
1724
|
+
declare class Sequence extends Activity<{}, void> {
|
|
1725
|
+
/**
|
|
1726
|
+
* Activities to execute in sequence.
|
|
1727
|
+
*/
|
|
1728
|
+
activities: IActivity[];
|
|
1729
|
+
constructor();
|
|
1730
|
+
execute(input: {}): Promise<{
|
|
1731
|
+
output: void;
|
|
1732
|
+
outcomes: Record<string, any>;
|
|
1733
|
+
}>;
|
|
1734
|
+
}
|
|
1735
|
+
|
|
1736
|
+
/**
|
|
1737
|
+
* Show Confirm Dialog Activity - Displays confirmation dialog to user.
|
|
1738
|
+
*
|
|
1739
|
+
* Has two outcomes:
|
|
1740
|
+
* - 'Confirmed': User clicked confirm/yes
|
|
1741
|
+
* - 'Cancelled': User clicked cancel/no
|
|
1742
|
+
*
|
|
1743
|
+
* Usage:
|
|
1744
|
+
* ```typescript
|
|
1745
|
+
* const dialog = new ShowConfirmDialog();
|
|
1746
|
+
* await dialog.execute({
|
|
1747
|
+
* title: 'Confirm Delete',
|
|
1748
|
+
* message: 'Are you sure?',
|
|
1749
|
+
* color: 'danger'
|
|
1750
|
+
* });
|
|
1751
|
+
* ```
|
|
1752
|
+
*/
|
|
1753
|
+
declare class ShowConfirmDialog extends Activity<{
|
|
1754
|
+
title?: string;
|
|
1755
|
+
message?: string;
|
|
1756
|
+
color?: AXStyleColorType;
|
|
1757
|
+
defaultAction?: 'confirm' | 'cancel';
|
|
1758
|
+
align?: 'horizontal' | 'vertical';
|
|
1759
|
+
backdrop?: boolean;
|
|
1760
|
+
}, {
|
|
1761
|
+
result: boolean;
|
|
1762
|
+
action: string;
|
|
1763
|
+
}> {
|
|
1764
|
+
private readonly dialogService;
|
|
1765
|
+
private readonly translationService;
|
|
1766
|
+
constructor();
|
|
1767
|
+
execute(input: {
|
|
1768
|
+
title?: string;
|
|
1769
|
+
message?: string;
|
|
1770
|
+
color?: AXStyleColorType;
|
|
1771
|
+
defaultAction?: 'confirm' | 'cancel';
|
|
1772
|
+
align?: 'horizontal' | 'vertical';
|
|
1773
|
+
backdrop?: boolean;
|
|
1774
|
+
}): Promise<{
|
|
1775
|
+
output: {
|
|
1776
|
+
result: boolean;
|
|
1777
|
+
action: string;
|
|
1778
|
+
};
|
|
1779
|
+
outcomes: Record<string, any>;
|
|
1780
|
+
}>;
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1783
|
+
/**
|
|
1784
|
+
* Show Alert Dialog Activity - Displays alert dialog to user.
|
|
1785
|
+
*
|
|
1786
|
+
* Has one outcome:
|
|
1787
|
+
* - 'Done': User clicked OK
|
|
1788
|
+
*
|
|
1789
|
+
* Usage:
|
|
1790
|
+
* ```typescript
|
|
1791
|
+
* const dialog = new ShowAlertDialog();
|
|
1792
|
+
* await dialog.execute({
|
|
1793
|
+
* title: 'Alert',
|
|
1794
|
+
* message: 'This is an alert',
|
|
1795
|
+
* color: 'info'
|
|
1796
|
+
* });
|
|
1797
|
+
* ```
|
|
1798
|
+
*/
|
|
1799
|
+
declare class ShowAlertDialog extends Activity<{
|
|
1800
|
+
title?: string;
|
|
1801
|
+
message?: string;
|
|
1802
|
+
color?: AXStyleColorType;
|
|
1803
|
+
}, {
|
|
1804
|
+
result: boolean;
|
|
1805
|
+
action: string;
|
|
1806
|
+
}> {
|
|
1807
|
+
private readonly dialogService;
|
|
1808
|
+
private readonly translationService;
|
|
1809
|
+
constructor();
|
|
1810
|
+
execute(input: {
|
|
1811
|
+
title?: string;
|
|
1812
|
+
message?: string;
|
|
1813
|
+
color?: AXStyleColorType;
|
|
1814
|
+
}): Promise<{
|
|
1815
|
+
output: {
|
|
1816
|
+
result: boolean;
|
|
1817
|
+
action: string;
|
|
1818
|
+
};
|
|
1819
|
+
outcomes: Record<string, any>;
|
|
1820
|
+
}>;
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
/**
|
|
1824
|
+
* Show Toast Activity - Displays toast notification to user.
|
|
1825
|
+
*
|
|
1826
|
+
* Usage:
|
|
1827
|
+
* ```typescript
|
|
1828
|
+
* const toast = new ShowToast();
|
|
1829
|
+
* await toast.execute({
|
|
1830
|
+
* color: 'success',
|
|
1831
|
+
* title: 'Success',
|
|
1832
|
+
* message: 'Operation completed successfully!'
|
|
1833
|
+
* });
|
|
1834
|
+
* ```
|
|
1835
|
+
*/
|
|
1836
|
+
declare class ShowToast extends Activity<{
|
|
1837
|
+
color?: AXStyleColorType;
|
|
1838
|
+
title?: string;
|
|
1839
|
+
message?: string;
|
|
1840
|
+
duration?: number;
|
|
1841
|
+
}, void> {
|
|
1842
|
+
private readonly toastService;
|
|
1843
|
+
private readonly translationService;
|
|
1844
|
+
constructor();
|
|
1845
|
+
execute(input: {
|
|
1846
|
+
color?: AXStyleColorType;
|
|
1847
|
+
title?: string;
|
|
1848
|
+
message?: string;
|
|
1849
|
+
duration?: number;
|
|
1850
|
+
}): Promise<{
|
|
1851
|
+
output: void;
|
|
1852
|
+
outcomes: Record<string, any>;
|
|
1853
|
+
}>;
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
/**
|
|
1857
|
+
* Navigate Activity - Navigates to different pages/routes.
|
|
1858
|
+
*
|
|
1859
|
+
* Usage:
|
|
1860
|
+
* ```typescript
|
|
1861
|
+
* const navigate = new Navigate();
|
|
1862
|
+
* await navigate.execute({
|
|
1863
|
+
* mode: 'route',
|
|
1864
|
+
* route: '/users',
|
|
1865
|
+
* params: { id: '123' }
|
|
1866
|
+
* });
|
|
1867
|
+
* ```
|
|
1868
|
+
*/
|
|
1869
|
+
declare class Navigate extends Activity<{
|
|
1870
|
+
mode?: 'route' | 'entity-details' | 'entity-list' | 'external';
|
|
1871
|
+
route?: string;
|
|
1872
|
+
params?: Record<string, any>;
|
|
1873
|
+
queryParams?: Record<string, any>;
|
|
1874
|
+
entity?: string;
|
|
1875
|
+
entityId?: string;
|
|
1876
|
+
url?: string;
|
|
1877
|
+
}, void> {
|
|
1878
|
+
private readonly router;
|
|
1879
|
+
constructor();
|
|
1880
|
+
execute(input: {
|
|
1881
|
+
mode?: 'route' | 'entity-details' | 'entity-list' | 'external';
|
|
1882
|
+
route?: string;
|
|
1883
|
+
params?: Record<string, any>;
|
|
1884
|
+
queryParams?: Record<string, any>;
|
|
1885
|
+
entity?: string;
|
|
1886
|
+
entityId?: string;
|
|
1887
|
+
url?: string;
|
|
1888
|
+
}): Promise<{
|
|
1889
|
+
output: void;
|
|
1890
|
+
outcomes: Record<string, any>;
|
|
1891
|
+
}>;
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
/**
|
|
1895
|
+
* Set Variable Activity - Sets a variable value in workflow context.
|
|
1896
|
+
*
|
|
1897
|
+
* Usage:
|
|
1898
|
+
* ```typescript
|
|
1899
|
+
* const setVar = new SetVariable();
|
|
1900
|
+
* await setVar.execute({
|
|
1901
|
+
* variableName: 'userId',
|
|
1902
|
+
* value: '12345'
|
|
1903
|
+
* });
|
|
1904
|
+
* ```
|
|
1905
|
+
*/
|
|
1906
|
+
declare class SetVariable extends Activity<{
|
|
1907
|
+
variableName: string;
|
|
1908
|
+
value: any;
|
|
1909
|
+
}, void> {
|
|
1910
|
+
constructor();
|
|
1911
|
+
execute(input: {
|
|
1912
|
+
variableName: string;
|
|
1913
|
+
value: any;
|
|
1914
|
+
}): Promise<{
|
|
1915
|
+
output: void;
|
|
1916
|
+
outcomes: Record<string, any>;
|
|
1917
|
+
}>;
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
/**
|
|
1921
|
+
* Dispatch Event Activity - Dispatches an event to the system.
|
|
1922
|
+
*
|
|
1923
|
+
* Usage:
|
|
1924
|
+
* ```typescript
|
|
1925
|
+
* const dispatch = new DispatchEvent();
|
|
1926
|
+
* await dispatch.execute({
|
|
1927
|
+
* eventName: 'user-created',
|
|
1928
|
+
* eventData: { userId: '123', name: 'John' }
|
|
1929
|
+
* });
|
|
1930
|
+
* ```
|
|
1931
|
+
*/
|
|
1932
|
+
declare class DispatchEvent extends Activity<{
|
|
1933
|
+
eventName: string;
|
|
1934
|
+
eventData?: any;
|
|
1935
|
+
}, void> {
|
|
1936
|
+
constructor();
|
|
1937
|
+
execute(input: {
|
|
1938
|
+
eventName: string;
|
|
1939
|
+
eventData?: any;
|
|
1940
|
+
}): Promise<{
|
|
1941
|
+
output: void;
|
|
1942
|
+
outcomes: Record<string, any>;
|
|
1943
|
+
}>;
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
/**
|
|
1947
|
+
* If Activity - Conditional execution based on a condition.
|
|
1948
|
+
*
|
|
1949
|
+
* Usage:
|
|
1950
|
+
* ```typescript
|
|
1951
|
+
* const ifActivity = new If();
|
|
1952
|
+
* ifActivity.condition = '{{user.isAdmin}}';
|
|
1953
|
+
* ifActivity.thenActivities = [activity1, activity2];
|
|
1954
|
+
* ifActivity.elseActivities = [activity3];
|
|
1955
|
+
* ```
|
|
1956
|
+
*/
|
|
1957
|
+
declare class If extends Activity<{
|
|
1958
|
+
condition: string | boolean;
|
|
1959
|
+
thenActivities?: IActivity[];
|
|
1960
|
+
elseActivities?: IActivity[];
|
|
1961
|
+
}, any> {
|
|
1962
|
+
constructor();
|
|
1963
|
+
execute(input: {
|
|
1964
|
+
condition: string | boolean;
|
|
1965
|
+
thenActivities?: IActivity[];
|
|
1966
|
+
elseActivities?: IActivity[];
|
|
1967
|
+
}): Promise<{
|
|
1968
|
+
output: any;
|
|
1969
|
+
outcomes: Record<string, any>;
|
|
1970
|
+
}>;
|
|
1971
|
+
private evaluateCondition;
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1974
|
+
/**
|
|
1975
|
+
* While Activity - Loop execution while condition is true.
|
|
1976
|
+
*
|
|
1977
|
+
* Usage:
|
|
1978
|
+
* ```typescript
|
|
1979
|
+
* const whileActivity = new While();
|
|
1980
|
+
* whileActivity.condition = '{{counter < 10}}';
|
|
1981
|
+
* whileActivity.activities = [incrementActivity, logActivity];
|
|
1982
|
+
* ```
|
|
1983
|
+
*/
|
|
1984
|
+
declare class While extends Activity<{
|
|
1985
|
+
condition: string | boolean;
|
|
1986
|
+
activities?: IActivity[];
|
|
1987
|
+
maxIterations?: number;
|
|
1988
|
+
}, any> {
|
|
1989
|
+
constructor();
|
|
1990
|
+
execute(input: {
|
|
1991
|
+
condition: string | boolean;
|
|
1992
|
+
activities?: IActivity[];
|
|
1993
|
+
maxIterations?: number;
|
|
1994
|
+
}): Promise<{
|
|
1995
|
+
output: any;
|
|
1996
|
+
outcomes: Record<string, any>;
|
|
1997
|
+
}>;
|
|
1998
|
+
private evaluateCondition;
|
|
1999
|
+
}
|
|
2000
|
+
|
|
2001
|
+
/**
|
|
2002
|
+
* ForEach Activity - Iterates over a collection of items.
|
|
2003
|
+
*
|
|
2004
|
+
* Usage:
|
|
2005
|
+
* ```typescript
|
|
2006
|
+
* const forEach = new ForEach();
|
|
2007
|
+
* await forEach.execute({
|
|
2008
|
+
* items: ['item1', 'item2', 'item3'],
|
|
2009
|
+
* activities: [processItemActivity]
|
|
2010
|
+
* });
|
|
2011
|
+
* ```
|
|
2012
|
+
*/
|
|
2013
|
+
declare class ForEach extends Activity<{
|
|
2014
|
+
items: any[];
|
|
2015
|
+
activities?: IActivity[];
|
|
2016
|
+
itemVariableName?: string;
|
|
2017
|
+
indexVariableName?: string;
|
|
2018
|
+
}, any> {
|
|
2019
|
+
constructor();
|
|
2020
|
+
execute(input: {
|
|
2021
|
+
items: any[];
|
|
2022
|
+
activities?: IActivity[];
|
|
2023
|
+
itemVariableName?: string;
|
|
2024
|
+
indexVariableName?: string;
|
|
2025
|
+
}): Promise<{
|
|
2026
|
+
output: any;
|
|
2027
|
+
outcomes: Record<string, any>;
|
|
2028
|
+
}>;
|
|
2029
|
+
}
|
|
2030
|
+
|
|
2031
|
+
/**
|
|
2032
|
+
* Execute Command Activity - Executes a command through Command Bus.
|
|
2033
|
+
*
|
|
2034
|
+
* Usage:
|
|
2035
|
+
* ```typescript
|
|
2036
|
+
* const executeCmd = new ExecuteCommand();
|
|
2037
|
+
* await executeCmd.execute({
|
|
2038
|
+
* commandKey: 'UserManagement.CreateUser',
|
|
2039
|
+
* input: { name: 'John', email: 'john@example.com' }
|
|
2040
|
+
* });
|
|
2041
|
+
* ```
|
|
2042
|
+
*/
|
|
2043
|
+
declare class ExecuteCommand extends Activity<{
|
|
2044
|
+
commandKey: string;
|
|
2045
|
+
input?: any;
|
|
2046
|
+
}, any> {
|
|
2047
|
+
private readonly commandService;
|
|
2048
|
+
constructor();
|
|
2049
|
+
execute(input: {
|
|
2050
|
+
commandKey: string;
|
|
2051
|
+
input?: any;
|
|
2052
|
+
}): Promise<{
|
|
2053
|
+
output: any;
|
|
2054
|
+
outcomes: Record<string, any>;
|
|
2055
|
+
}>;
|
|
2056
|
+
}
|
|
2057
|
+
|
|
2058
|
+
/**
|
|
2059
|
+
* Execute Query Activity - Executes a query through Query Bus.
|
|
2060
|
+
*
|
|
2061
|
+
* Usage:
|
|
2062
|
+
* ```typescript
|
|
2063
|
+
* const executeQuery = new ExecuteQuery();
|
|
2064
|
+
* await executeQuery.execute({
|
|
2065
|
+
* queryKey: 'UserManagement.GetUsers',
|
|
2066
|
+
* input: { page: 1, pageSize: 10 }
|
|
2067
|
+
* });
|
|
2068
|
+
* ```
|
|
2069
|
+
*/
|
|
2070
|
+
declare class ExecuteQuery extends Activity<{
|
|
2071
|
+
queryKey: string;
|
|
2072
|
+
input?: any;
|
|
2073
|
+
}, any> {
|
|
2074
|
+
private readonly queryService;
|
|
2075
|
+
constructor();
|
|
2076
|
+
execute(input: {
|
|
2077
|
+
queryKey: string;
|
|
2078
|
+
input?: any;
|
|
2079
|
+
}): Promise<{
|
|
2080
|
+
output: any;
|
|
2081
|
+
outcomes: Record<string, any>;
|
|
2082
|
+
}>;
|
|
2083
|
+
}
|
|
2084
|
+
|
|
2085
|
+
/**
|
|
2086
|
+
* Start Activity - Marks the start point of a workflow.
|
|
2087
|
+
*
|
|
2088
|
+
* This is a visual marker activity that doesn't perform any actual work.
|
|
2089
|
+
* It's used in workflow designers to clearly indicate where a workflow begins.
|
|
2090
|
+
*
|
|
2091
|
+
* Usage:
|
|
2092
|
+
* ```typescript
|
|
2093
|
+
* const start = new StartActivity();
|
|
2094
|
+
* await start.execute({});
|
|
2095
|
+
* ```
|
|
2096
|
+
*/
|
|
2097
|
+
declare class StartActivity extends Activity<Record<string, never>, void> {
|
|
2098
|
+
constructor();
|
|
2099
|
+
execute(input: Record<string, never>): Promise<{
|
|
2100
|
+
output: void;
|
|
2101
|
+
outcomes: Record<string, any>;
|
|
2102
|
+
}>;
|
|
2103
|
+
}
|
|
2104
|
+
|
|
2105
|
+
/**
|
|
2106
|
+
* End Activity - Marks the end point of a workflow.
|
|
2107
|
+
*
|
|
2108
|
+
* This is a visual marker activity that terminates the workflow execution.
|
|
2109
|
+
* When this activity is reached, the workflow completes successfully.
|
|
2110
|
+
*
|
|
2111
|
+
* Usage:
|
|
2112
|
+
* ```typescript
|
|
2113
|
+
* const end = new EndActivity();
|
|
2114
|
+
* await end.execute({});
|
|
2115
|
+
* ```
|
|
2116
|
+
*/
|
|
2117
|
+
declare class EndActivity extends Activity<Record<string, never>, void> {
|
|
2118
|
+
constructor();
|
|
2119
|
+
execute(input: Record<string, never>): Promise<{
|
|
2120
|
+
output: void;
|
|
2121
|
+
outcomes: Record<string, any>;
|
|
2122
|
+
}>;
|
|
2123
|
+
}
|
|
2124
|
+
|
|
2125
|
+
/**
|
|
2126
|
+
* Command setups for all built-in workflow activities.
|
|
2127
|
+
* Registers activities as AXPCommand instances.
|
|
2128
|
+
*/
|
|
2129
|
+
declare const provideWorkflowActivityCommands: () => i0.EnvironmentProviders;
|
|
2130
|
+
|
|
2131
|
+
export { AXPActivityCategoryProviderService, AXPActivityProviderService, AXPWorkflowAction, AXPWorkflowContext, AXPWorkflowError, AXPWorkflowEventService, AXPWorkflowExecutionService, AXPWorkflowFunction, AXPWorkflowModule, AXPWorkflowRegistryService, AXPWorkflowService, AXP_ACTIVITY_CATEGORY_PROVIDER, AXP_ACTIVITY_PROVIDER, Activity, ActivityRegistry, DispatchEvent, EndActivity, ExecuteCommand, ExecuteQuery, ForEach, If, Navigate, Sequence, SetVariable, ShowAlertDialog, ShowConfirmDialog, ShowToast, StartActivity, While, WorkflowCoordinator, WriteLine, createWorkFlowEvent, ofType, provideWorkflowActivityCommands };
|
|
2132
|
+
export type { AXPActivity, AXPActivityCategoryProvider, AXPActivityCategoryProviderContext, AXPActivityExecutionContextState, AXPActivityIncident, AXPActivityProvider, AXPActivityProviderContext, AXPActivityStatus, AXPActivityVariable, AXPBookmark, AXPCompletionCallbackState, AXPConnection, AXPCustomProperties, AXPEndpoint, AXPExceptionState, AXPExpression, AXPFlowchart, AXPGetWorkflowDefinitionRequest, AXPGetWorkflowDefinitionResponse, AXPGetWorkflowExecutionStateRequest, AXPInputValue, AXPMetadata, AXPOutputValue, AXPPosition, AXPResumeWorkflowExecutionRequest, AXPResumeWorkflowExecutionResponse, AXPStartWorkflowExecutionRequest, AXPStartWorkflowExecutionResponse, AXPStoredWorkflowDefinition, AXPVariableDefinition, AXPVariableModel, AXPVersionedEntity, AXPWorkflow, AXPWorkflowActionInput, AXPWorkflowCondition, AXPWorkflowConditionType, AXPWorkflowDefinition, AXPWorkflowEvent, AXPWorkflowExecutionState, AXPWorkflowFaultState, AXPWorkflowInputDefinition, AXPWorkflowInstance, AXPWorkflowModuleConfigs, AXPWorkflowNextStep, AXPWorkflowOptions, AXPWorkflowOutputDefinition, AXPWorkflowState, AXPWorkflowStatus, AXPWorkflowStep, AXPWorkflowSubStatus, AXPWorkflowTask, ActivityCategory, ActivityCategoryDescriptor, ActivityDescriptor, ActivityPropertyWidget, IActivity, InputDescriptor, OutputDescriptor, WorkflowExecutionResult };
|