@acorex/platform 20.6.0-next.2 → 20.6.0-next.4
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 +2 -1
- package/core/index.d.ts +2 -2
- package/fesm2022/{acorex-platform-common-common-settings.provider-CLb2KMfv.mjs → acorex-platform-common-common-settings.provider-CGVarshJ.mjs} +25 -1
- package/fesm2022/acorex-platform-common-common-settings.provider-CGVarshJ.mjs.map +1 -0
- package/fesm2022/acorex-platform-common.mjs +3 -2
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-components.mjs +207 -40
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +294 -145
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-views.mjs +17 -3
- package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widget-core.mjs +12 -0
- package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
- package/fesm2022/{acorex-platform-layout-widgets-file-list-popup.component-BOP7jFp4.mjs → acorex-platform-layout-widgets-file-list-popup.component-2q4whXBx.mjs} +3 -3
- package/fesm2022/{acorex-platform-layout-widgets-file-list-popup.component-BOP7jFp4.mjs.map → acorex-platform-layout-widgets-file-list-popup.component-2q4whXBx.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-layout-widgets-tabular-data-edit-popup.component-fr77M8Z0.mjs → acorex-platform-layout-widgets-tabular-data-edit-popup.component-DGDLHbaR.mjs} +3 -3
- package/fesm2022/{acorex-platform-layout-widgets-tabular-data-edit-popup.component-fr77M8Z0.mjs.map → acorex-platform-layout-widgets-tabular-data-edit-popup.component-DGDLHbaR.mjs.map} +1 -1
- package/fesm2022/acorex-platform-layout-widgets.mjs +866 -260
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-BkY9HXcT.mjs → acorex-platform-themes-default-entity-master-list-view.component-Beba9db5.mjs} +29 -8
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-Beba9db5.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +3 -3
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-shared.mjs +2 -2
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/fesm2022/acorex-platform-workflow.mjs +13 -76
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
- package/layout/components/index.d.ts +7 -1
- package/layout/entity/index.d.ts +25 -10
- package/layout/views/index.d.ts +1 -0
- package/layout/widget-core/index.d.ts +6 -0
- package/layout/widgets/index.d.ts +139 -28
- package/package.json +5 -5
- package/workflow/index.d.ts +884 -433
- package/fesm2022/acorex-platform-common-common-settings.provider-CLb2KMfv.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-BkY9HXcT.mjs.map +0 -1
package/workflow/index.d.ts
CHANGED
|
@@ -2,8 +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 { AXPValidationRules } from '@acorex/platform/core';
|
|
6
5
|
import { AXPCommand } from '@acorex/platform/runtime';
|
|
6
|
+
import { AXPValidationRules } from '@acorex/platform/core';
|
|
7
7
|
import { AXPWidgetTypesMap } from '@acorex/platform/layout/widget-core';
|
|
8
8
|
import { AXStyleColorType } from '@acorex/cdk/common';
|
|
9
9
|
|
|
@@ -149,230 +149,943 @@ declare class AXPWorkflowService {
|
|
|
149
149
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXPWorkflowService>;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
152
|
+
/**
|
|
153
|
+
* Base entity with versioning support.
|
|
154
|
+
*/
|
|
155
|
+
interface AXPVersionedEntity {
|
|
156
|
+
version: number;
|
|
157
|
+
isLatest: boolean;
|
|
158
|
+
isPublished: boolean;
|
|
155
159
|
}
|
|
156
160
|
/**
|
|
157
|
-
*
|
|
158
|
-
*
|
|
161
|
+
* Workflow definition stored in database.
|
|
162
|
+
* This is the stored format that matches Elsa backend structure.
|
|
159
163
|
*/
|
|
160
|
-
interface
|
|
161
|
-
output: TOutput;
|
|
162
|
-
outcomes: Record<string, any>;
|
|
163
|
-
}> {
|
|
164
|
+
interface AXPStoredWorkflowDefinition extends AXPVersionedEntity {
|
|
164
165
|
/**
|
|
165
|
-
*
|
|
166
|
-
* Example: "WriteLine", "ShowDialog", "CreateUserCommand"
|
|
166
|
+
* Unique ID of this workflow definition version.
|
|
167
167
|
*/
|
|
168
|
-
|
|
168
|
+
id: string;
|
|
169
169
|
/**
|
|
170
|
-
*
|
|
170
|
+
* Logical definition ID (same across all versions).
|
|
171
171
|
*/
|
|
172
|
-
|
|
172
|
+
definitionId: string;
|
|
173
173
|
/**
|
|
174
|
-
*
|
|
175
|
-
* @param input - Activity input data
|
|
176
|
-
* @returns Promise with output and outcomes
|
|
174
|
+
* Tenant ID (nullable).
|
|
177
175
|
*/
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
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;
|
|
182
205
|
}
|
|
183
206
|
/**
|
|
184
|
-
*
|
|
185
|
-
*
|
|
207
|
+
* Variable definition.
|
|
208
|
+
* Matches VariableDefinition from workflow definition schema.
|
|
186
209
|
*/
|
|
187
|
-
|
|
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
|
+
*/
|
|
188
244
|
type: string;
|
|
189
|
-
name?: string;
|
|
190
|
-
constructor(type: string, name?: string);
|
|
191
245
|
/**
|
|
192
|
-
*
|
|
193
|
-
* Override this method in subclasses to implement activity logic.
|
|
246
|
+
* Input name.
|
|
194
247
|
*/
|
|
195
|
-
|
|
196
|
-
output: TOutput;
|
|
197
|
-
outcomes: Record<string, any>;
|
|
198
|
-
}>;
|
|
248
|
+
name: string;
|
|
199
249
|
/**
|
|
200
|
-
*
|
|
250
|
+
* Display name.
|
|
201
251
|
*/
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
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;
|
|
206
269
|
}
|
|
207
270
|
/**
|
|
208
|
-
*
|
|
271
|
+
* Workflow output definition.
|
|
272
|
+
* Matches WorkflowOutputDefinition from workflow definition schema.
|
|
209
273
|
*/
|
|
210
|
-
interface
|
|
274
|
+
interface AXPWorkflowOutputDefinition {
|
|
211
275
|
/**
|
|
212
|
-
*
|
|
276
|
+
* Output type (e.g., "String", "Int32", "Object").
|
|
213
277
|
*/
|
|
214
278
|
type: string;
|
|
215
279
|
/**
|
|
216
|
-
*
|
|
280
|
+
* Output name.
|
|
217
281
|
*/
|
|
218
|
-
|
|
282
|
+
name: string;
|
|
219
283
|
/**
|
|
220
|
-
*
|
|
284
|
+
* Display name.
|
|
285
|
+
*/
|
|
286
|
+
displayName?: string;
|
|
287
|
+
/**
|
|
288
|
+
* Description.
|
|
221
289
|
*/
|
|
222
290
|
description?: string;
|
|
223
291
|
/**
|
|
224
|
-
* Category for grouping
|
|
292
|
+
* Category for grouping.
|
|
225
293
|
*/
|
|
226
|
-
category
|
|
294
|
+
category?: string;
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Expression.
|
|
298
|
+
* Used for dynamic values in activities.
|
|
299
|
+
*/
|
|
300
|
+
interface AXPExpression {
|
|
227
301
|
/**
|
|
228
|
-
*
|
|
302
|
+
* Expression type (e.g., "Literal", "JavaScript", "Liquid").
|
|
229
303
|
*/
|
|
230
|
-
|
|
304
|
+
type: string;
|
|
231
305
|
/**
|
|
232
|
-
*
|
|
233
|
-
* - 'frontend': Execute in browser (UI activities, console, events)
|
|
234
|
-
* - 'backend': Execute in backend (business logic, API calls)
|
|
235
|
-
* - 'both': Execute in both frontend and backend (hybrid activities)
|
|
236
|
-
*
|
|
237
|
-
* Default: 'frontend'
|
|
306
|
+
* Expression value.
|
|
238
307
|
*/
|
|
239
|
-
|
|
308
|
+
value?: any;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Input value wrapper.
|
|
312
|
+
* Wraps an expression with type information.
|
|
313
|
+
*/
|
|
314
|
+
interface AXPInputValue {
|
|
240
315
|
/**
|
|
241
|
-
*
|
|
316
|
+
* Type name.
|
|
242
317
|
*/
|
|
243
|
-
|
|
318
|
+
typeName: string;
|
|
244
319
|
/**
|
|
245
|
-
*
|
|
320
|
+
* Expression (or null).
|
|
246
321
|
*/
|
|
247
|
-
|
|
322
|
+
expression?: AXPExpression | null;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Output value wrapper.
|
|
326
|
+
* References memory location.
|
|
327
|
+
*/
|
|
328
|
+
interface AXPOutputValue {
|
|
248
329
|
/**
|
|
249
|
-
*
|
|
250
|
-
* Example: ['Done', 'Success', 'Failed']
|
|
330
|
+
* Type name.
|
|
251
331
|
*/
|
|
252
|
-
|
|
332
|
+
typeName: string;
|
|
253
333
|
/**
|
|
254
|
-
*
|
|
255
|
-
* Default: true
|
|
334
|
+
* Memory reference (or null).
|
|
256
335
|
*/
|
|
257
|
-
|
|
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 {
|
|
258
351
|
/**
|
|
259
|
-
*
|
|
260
|
-
* Default: false
|
|
352
|
+
* Activity ID.
|
|
261
353
|
*/
|
|
262
|
-
|
|
354
|
+
activity: string;
|
|
355
|
+
/**
|
|
356
|
+
* Port name (nullable).
|
|
357
|
+
*/
|
|
358
|
+
port?: string | null;
|
|
263
359
|
}
|
|
264
360
|
/**
|
|
265
|
-
*
|
|
266
|
-
* Similar to AXPEntityProperty structure.
|
|
361
|
+
* Connection between activities.
|
|
267
362
|
*/
|
|
268
|
-
interface
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
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[];
|
|
281
376
|
}
|
|
282
377
|
/**
|
|
283
|
-
*
|
|
378
|
+
* Variable model (for flowchart variables).
|
|
284
379
|
*/
|
|
285
|
-
interface
|
|
380
|
+
interface AXPVariableModel {
|
|
381
|
+
id: string;
|
|
286
382
|
name: string;
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
dataType: string;
|
|
291
|
-
};
|
|
383
|
+
typeName: string;
|
|
384
|
+
value?: string | null;
|
|
385
|
+
storageDriverTypeName?: string | null;
|
|
292
386
|
}
|
|
293
387
|
/**
|
|
294
|
-
*
|
|
388
|
+
* Metadata (designer annotations).
|
|
295
389
|
*/
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
390
|
+
interface AXPMetadata {
|
|
391
|
+
[key: string]: any;
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Custom properties (free-form bag).
|
|
395
|
+
*/
|
|
396
|
+
interface AXPCustomProperties {
|
|
299
397
|
/**
|
|
300
|
-
*
|
|
398
|
+
* Connections that reference non-existent activities.
|
|
301
399
|
*/
|
|
302
|
-
|
|
400
|
+
notFoundConnections?: AXPConnection[];
|
|
303
401
|
/**
|
|
304
|
-
*
|
|
402
|
+
* Additional custom properties.
|
|
305
403
|
*/
|
|
306
|
-
|
|
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 {
|
|
307
412
|
/**
|
|
308
|
-
*
|
|
413
|
+
* Activity ID.
|
|
309
414
|
*/
|
|
310
|
-
|
|
415
|
+
id: string;
|
|
311
416
|
/**
|
|
312
|
-
*
|
|
417
|
+
* Node ID (for visual designer).
|
|
313
418
|
*/
|
|
314
|
-
|
|
419
|
+
nodeId: string;
|
|
315
420
|
/**
|
|
316
|
-
*
|
|
421
|
+
* Activity name.
|
|
317
422
|
*/
|
|
318
|
-
|
|
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;
|
|
319
1047
|
/**
|
|
320
|
-
*
|
|
1048
|
+
* Icon name or class.
|
|
321
1049
|
*/
|
|
322
|
-
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
/**
|
|
326
|
-
* Base entity with versioning support.
|
|
327
|
-
*/
|
|
328
|
-
interface VersionedEntity {
|
|
329
|
-
version: number;
|
|
330
|
-
isLatest: boolean;
|
|
331
|
-
isPublished: boolean;
|
|
332
|
-
}
|
|
333
|
-
/**
|
|
334
|
-
* Simple workflow definition stored in database.
|
|
335
|
-
*/
|
|
336
|
-
interface WorkflowDefinition extends VersionedEntity {
|
|
1050
|
+
icon?: string;
|
|
337
1051
|
/**
|
|
338
|
-
*
|
|
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'
|
|
339
1058
|
*/
|
|
340
|
-
|
|
1059
|
+
executionMode?: 'frontend' | 'backend' | 'both';
|
|
341
1060
|
/**
|
|
342
|
-
*
|
|
1061
|
+
* Input descriptors.
|
|
343
1062
|
*/
|
|
344
|
-
|
|
1063
|
+
inputs: InputDescriptor[];
|
|
345
1064
|
/**
|
|
346
|
-
*
|
|
1065
|
+
* Output descriptors.
|
|
347
1066
|
*/
|
|
348
|
-
|
|
1067
|
+
outputs: OutputDescriptor[];
|
|
349
1068
|
/**
|
|
350
|
-
*
|
|
1069
|
+
* Static outcomes (exit points).
|
|
1070
|
+
* Example: ['Done', 'Success', 'Failed']
|
|
351
1071
|
*/
|
|
352
|
-
|
|
1072
|
+
outcomes?: string[];
|
|
353
1073
|
/**
|
|
354
|
-
*
|
|
1074
|
+
* Whether this activity is browsable in the toolbox.
|
|
1075
|
+
* Default: true
|
|
355
1076
|
*/
|
|
356
|
-
|
|
1077
|
+
isBrowsable?: boolean;
|
|
357
1078
|
/**
|
|
358
|
-
*
|
|
1079
|
+
* Whether this activity is a container (can have children).
|
|
1080
|
+
* Default: false
|
|
359
1081
|
*/
|
|
360
|
-
|
|
361
|
-
}
|
|
362
|
-
/**
|
|
363
|
-
* Simple variable definition.
|
|
364
|
-
*/
|
|
365
|
-
interface Variable {
|
|
366
|
-
id: string;
|
|
367
|
-
name: string;
|
|
368
|
-
typeName: string;
|
|
369
|
-
value?: any;
|
|
1082
|
+
isContainer?: boolean;
|
|
370
1083
|
}
|
|
371
1084
|
/**
|
|
372
|
-
*
|
|
1085
|
+
* Input property descriptor.
|
|
373
1086
|
* Similar to AXPEntityProperty structure.
|
|
374
1087
|
*/
|
|
375
|
-
interface
|
|
1088
|
+
interface InputDescriptor {
|
|
376
1089
|
name: string;
|
|
377
1090
|
title: string;
|
|
378
1091
|
description?: string;
|
|
@@ -387,9 +1100,9 @@ interface InputDefinition {
|
|
|
387
1100
|
validations?: AXPValidationRules;
|
|
388
1101
|
}
|
|
389
1102
|
/**
|
|
390
|
-
*
|
|
1103
|
+
* Output property descriptor.
|
|
391
1104
|
*/
|
|
392
|
-
interface
|
|
1105
|
+
interface OutputDescriptor {
|
|
393
1106
|
name: string;
|
|
394
1107
|
title: string;
|
|
395
1108
|
description?: string;
|
|
@@ -398,104 +1111,35 @@ interface OutputDefinition {
|
|
|
398
1111
|
};
|
|
399
1112
|
}
|
|
400
1113
|
/**
|
|
401
|
-
*
|
|
402
|
-
*/
|
|
403
|
-
interface WorkflowCommon {
|
|
404
|
-
options: WorkflowOptions;
|
|
405
|
-
variables: Variable[];
|
|
406
|
-
inputs: InputDefinition[];
|
|
407
|
-
outputs: OutputDefinition[];
|
|
408
|
-
outcomes: string[];
|
|
409
|
-
customProperties: Record<string, any>;
|
|
410
|
-
isReadonly: boolean;
|
|
411
|
-
isSystem: boolean;
|
|
412
|
-
}
|
|
413
|
-
/**
|
|
414
|
-
* Workflow configuration options.
|
|
415
|
-
*/
|
|
416
|
-
interface WorkflowOptions {
|
|
417
|
-
usableAsActivity: boolean;
|
|
418
|
-
autoUpdateConsumingWorkflows: boolean;
|
|
419
|
-
activationStrategyType?: string;
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
/**
|
|
423
|
-
* Simple workflow definition - just a tree of activities.
|
|
424
|
-
*/
|
|
425
|
-
interface AXPWorkflowEngine {
|
|
426
|
-
/**
|
|
427
|
-
* Workflow ID.
|
|
428
|
-
*/
|
|
429
|
-
id: string;
|
|
430
|
-
/**
|
|
431
|
-
* Workflow name.
|
|
432
|
-
*/
|
|
433
|
-
name: string;
|
|
434
|
-
/**
|
|
435
|
-
* Workflow description.
|
|
436
|
-
*/
|
|
437
|
-
description?: string;
|
|
438
|
-
/**
|
|
439
|
-
* Workflow version.
|
|
440
|
-
*/
|
|
441
|
-
version: number;
|
|
442
|
-
/**
|
|
443
|
-
* Root activity to execute.
|
|
444
|
-
*/
|
|
445
|
-
root: IActivity;
|
|
446
|
-
/**
|
|
447
|
-
* All activities in this workflow (flat list for easy access).
|
|
448
|
-
*/
|
|
449
|
-
activities: IActivity[];
|
|
450
|
-
}
|
|
451
|
-
/**
|
|
452
|
-
* Simple workflow step - for backward compatibility with old system.
|
|
1114
|
+
* Activity registry for registering and creating activities.
|
|
453
1115
|
*/
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
*/
|
|
458
|
-
id: string;
|
|
459
|
-
/**
|
|
460
|
-
* Activity type to execute.
|
|
461
|
-
*/
|
|
462
|
-
type: string;
|
|
463
|
-
/**
|
|
464
|
-
* Activity name.
|
|
465
|
-
*/
|
|
466
|
-
name?: string;
|
|
1116
|
+
declare class ActivityRegistry {
|
|
1117
|
+
private registry;
|
|
1118
|
+
private descriptors;
|
|
467
1119
|
/**
|
|
468
|
-
*
|
|
1120
|
+
* Register an activity type.
|
|
469
1121
|
*/
|
|
470
|
-
|
|
1122
|
+
register(type: string, factory: () => IActivity, descriptor: ActivityDescriptor): void;
|
|
471
1123
|
/**
|
|
472
|
-
*
|
|
1124
|
+
* Create an activity instance.
|
|
473
1125
|
*/
|
|
474
|
-
|
|
475
|
-
outcome: string;
|
|
476
|
-
stepId: string;
|
|
477
|
-
}[];
|
|
478
|
-
}
|
|
479
|
-
/**
|
|
480
|
-
* Simple workflow definition for backward compatibility.
|
|
481
|
-
*/
|
|
482
|
-
interface AXPSimpleWorkflowEngine {
|
|
1126
|
+
create(type: string): IActivity;
|
|
483
1127
|
/**
|
|
484
|
-
*
|
|
1128
|
+
* Get activity descriptor.
|
|
485
1129
|
*/
|
|
486
|
-
|
|
1130
|
+
getDescriptor(type: string): ActivityDescriptor | undefined;
|
|
487
1131
|
/**
|
|
488
|
-
*
|
|
1132
|
+
* Get all registered types.
|
|
489
1133
|
*/
|
|
490
|
-
|
|
1134
|
+
getTypes(): string[];
|
|
491
1135
|
/**
|
|
492
|
-
*
|
|
1136
|
+
* Get all descriptors.
|
|
493
1137
|
*/
|
|
494
|
-
|
|
1138
|
+
getAllDescriptors(): ActivityDescriptor[];
|
|
495
1139
|
/**
|
|
496
|
-
*
|
|
1140
|
+
* Get descriptors by category.
|
|
497
1141
|
*/
|
|
498
|
-
|
|
1142
|
+
getDescriptorsByCategory(category: string): ActivityDescriptor[];
|
|
499
1143
|
}
|
|
500
1144
|
|
|
501
1145
|
interface ActivityCategoryDescriptor {
|
|
@@ -692,56 +1336,6 @@ interface AXPStartWorkflowExecutionResponse {
|
|
|
692
1336
|
*/
|
|
693
1337
|
pendingTask?: AXPWorkflowTask | null;
|
|
694
1338
|
}
|
|
695
|
-
/**
|
|
696
|
-
* Request to execute a backend activity.
|
|
697
|
-
*/
|
|
698
|
-
interface AXPExecuteBackendActivityRequest {
|
|
699
|
-
/**
|
|
700
|
-
* Workflow ID.
|
|
701
|
-
*/
|
|
702
|
-
workflowId: string;
|
|
703
|
-
/**
|
|
704
|
-
* Execution ID.
|
|
705
|
-
*/
|
|
706
|
-
executionId: string;
|
|
707
|
-
/**
|
|
708
|
-
* Activity type (e.g., 'workflow-activity:execute-command').
|
|
709
|
-
*/
|
|
710
|
-
activityType: string;
|
|
711
|
-
/**
|
|
712
|
-
* Activity ID from workflow definition.
|
|
713
|
-
*/
|
|
714
|
-
activityId: string;
|
|
715
|
-
/**
|
|
716
|
-
* Activity properties (input data).
|
|
717
|
-
*/
|
|
718
|
-
properties: Record<string, any>;
|
|
719
|
-
/**
|
|
720
|
-
* Current workflow state (optional, for context).
|
|
721
|
-
*/
|
|
722
|
-
workflowState?: Partial<AXPWorkflowExecutionState>;
|
|
723
|
-
}
|
|
724
|
-
/**
|
|
725
|
-
* Response after executing backend activity.
|
|
726
|
-
*/
|
|
727
|
-
interface AXPExecuteBackendActivityResponse {
|
|
728
|
-
/**
|
|
729
|
-
* Activity execution output.
|
|
730
|
-
*/
|
|
731
|
-
output: any;
|
|
732
|
-
/**
|
|
733
|
-
* Activity execution outcomes.
|
|
734
|
-
*/
|
|
735
|
-
outcomes: Record<string, any>;
|
|
736
|
-
/**
|
|
737
|
-
* Next task to execute (if any).
|
|
738
|
-
*/
|
|
739
|
-
nextTask?: AXPWorkflowTask | null;
|
|
740
|
-
/**
|
|
741
|
-
* Updated workflow state.
|
|
742
|
-
*/
|
|
743
|
-
state: AXPWorkflowExecutionState;
|
|
744
|
-
}
|
|
745
1339
|
/**
|
|
746
1340
|
* Request to resume a suspended workflow.
|
|
747
1341
|
*/
|
|
@@ -754,6 +1348,11 @@ interface AXPResumeWorkflowExecutionRequest {
|
|
|
754
1348
|
* Step ID that was waiting for user input.
|
|
755
1349
|
*/
|
|
756
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;
|
|
757
1356
|
/**
|
|
758
1357
|
* User action outcome (e.g., 'Confirmed', 'Cancelled').
|
|
759
1358
|
*/
|
|
@@ -793,36 +1392,6 @@ interface AXPGetWorkflowExecutionStateRequest {
|
|
|
793
1392
|
*/
|
|
794
1393
|
executionId: string;
|
|
795
1394
|
}
|
|
796
|
-
/**
|
|
797
|
-
* Request to execute current step from execution state.
|
|
798
|
-
*/
|
|
799
|
-
interface AXPExecuteCurrentStepRequest {
|
|
800
|
-
/**
|
|
801
|
-
* Execution ID.
|
|
802
|
-
*/
|
|
803
|
-
executionId: string;
|
|
804
|
-
}
|
|
805
|
-
/**
|
|
806
|
-
* Response after executing current step.
|
|
807
|
-
*/
|
|
808
|
-
interface AXPExecuteCurrentStepResponse {
|
|
809
|
-
/**
|
|
810
|
-
* Step execution output.
|
|
811
|
-
*/
|
|
812
|
-
output: any;
|
|
813
|
-
/**
|
|
814
|
-
* Step execution outcomes.
|
|
815
|
-
*/
|
|
816
|
-
outcomes: Record<string, any>;
|
|
817
|
-
/**
|
|
818
|
-
* Next task to execute (if any, determined by backend from outcomeConnections).
|
|
819
|
-
*/
|
|
820
|
-
nextTask?: AXPWorkflowTask | null;
|
|
821
|
-
/**
|
|
822
|
-
* Updated workflow state.
|
|
823
|
-
*/
|
|
824
|
-
state: AXPWorkflowExecutionState;
|
|
825
|
-
}
|
|
826
1395
|
/**
|
|
827
1396
|
* Request to get workflow definition.
|
|
828
1397
|
*/
|
|
@@ -837,9 +1406,9 @@ interface AXPGetWorkflowDefinitionRequest {
|
|
|
837
1406
|
*/
|
|
838
1407
|
interface AXPGetWorkflowDefinitionResponse {
|
|
839
1408
|
/**
|
|
840
|
-
* Workflow definition
|
|
1409
|
+
* Workflow definition.
|
|
841
1410
|
*/
|
|
842
|
-
workflow:
|
|
1411
|
+
workflow: AXPWorkflowDefinition;
|
|
843
1412
|
}
|
|
844
1413
|
/**
|
|
845
1414
|
* Workflow execution state (managed by backend, cached in client).
|
|
@@ -878,36 +1447,6 @@ interface AXPWorkflowExecutionState {
|
|
|
878
1447
|
*/
|
|
879
1448
|
lastUpdated: Date;
|
|
880
1449
|
}
|
|
881
|
-
/**
|
|
882
|
-
* Request to complete a task.
|
|
883
|
-
*/
|
|
884
|
-
interface AXPCompleteTaskRequest {
|
|
885
|
-
/**
|
|
886
|
-
* Task token from the pending task.
|
|
887
|
-
*/
|
|
888
|
-
taskToken: string;
|
|
889
|
-
/**
|
|
890
|
-
* Task execution result.
|
|
891
|
-
*/
|
|
892
|
-
result?: any;
|
|
893
|
-
/**
|
|
894
|
-
* Error message if task failed.
|
|
895
|
-
*/
|
|
896
|
-
error?: string;
|
|
897
|
-
}
|
|
898
|
-
/**
|
|
899
|
-
* Response after completing a task.
|
|
900
|
-
*/
|
|
901
|
-
interface AXPCompleteTaskResponse {
|
|
902
|
-
/**
|
|
903
|
-
* Updated workflow state.
|
|
904
|
-
*/
|
|
905
|
-
state: AXPWorkflowExecutionState;
|
|
906
|
-
/**
|
|
907
|
-
* Next task to execute (if any).
|
|
908
|
-
*/
|
|
909
|
-
nextTask?: AXPWorkflowTask | null;
|
|
910
|
-
}
|
|
911
1450
|
|
|
912
1451
|
/**
|
|
913
1452
|
* Workflow execution result.
|
|
@@ -1007,49 +1546,11 @@ declare class WorkflowCoordinator {
|
|
|
1007
1546
|
* @param outcome - User action outcome (e.g., 'Confirmed', 'Cancelled', 'Submitted')
|
|
1008
1547
|
* @param userInput - Optional user input data
|
|
1009
1548
|
*/
|
|
1010
|
-
resumeWorkflow(executionId: string, stepId: string, outcome: string, userInput?: any): Promise<WorkflowExecutionResult>;
|
|
1549
|
+
resumeWorkflow(executionId: string, stepId: string, outcome: string, userInput?: any, taskToken?: string): Promise<WorkflowExecutionResult>;
|
|
1011
1550
|
/**
|
|
1012
1551
|
* Get workflow execution state (from cache or backend).
|
|
1013
1552
|
*/
|
|
1014
1553
|
getWorkflowState(executionId: string): Promise<AXPWorkflowExecutionState | null>;
|
|
1015
|
-
/**
|
|
1016
|
-
* Start step-based execution (only current step, not full workflow).
|
|
1017
|
-
*
|
|
1018
|
-
* Use this when you only need to execute one step at a time.
|
|
1019
|
-
* Perfect for form-based workflows where user interacts with forms.
|
|
1020
|
-
*
|
|
1021
|
-
* @param workflowId - Workflow ID
|
|
1022
|
-
* @param stepId - Initial step ID to execute
|
|
1023
|
-
* @param input - Initial input data
|
|
1024
|
-
* @returns Execution info with executionId and initial state
|
|
1025
|
-
*
|
|
1026
|
-
* @example
|
|
1027
|
-
* ```typescript
|
|
1028
|
-
* // Start login form step
|
|
1029
|
-
* const execution = await coordinator.startStepExecution(
|
|
1030
|
-
* 'login-workflow',
|
|
1031
|
-
* 'login-form-step',
|
|
1032
|
-
* {}
|
|
1033
|
-
* );
|
|
1034
|
-
*
|
|
1035
|
-
* // Save executionId for resume after refresh
|
|
1036
|
-
* localStorage.setItem('execution-id', execution.executionId);
|
|
1037
|
-
* ```
|
|
1038
|
-
*/
|
|
1039
|
-
startStepExecution(workflowId: string, stepId: string, input?: Record<string, any>): Promise<{
|
|
1040
|
-
executionId: string;
|
|
1041
|
-
state: AXPWorkflowExecutionState;
|
|
1042
|
-
}>;
|
|
1043
|
-
/**
|
|
1044
|
-
* Get next task from backend after backend task completion.
|
|
1045
|
-
*
|
|
1046
|
-
* Use this when backend task completes - backend will return next task.
|
|
1047
|
-
* For frontend tasks, use executeTask + completeTask instead.
|
|
1048
|
-
*
|
|
1049
|
-
* @param executionId - Execution ID
|
|
1050
|
-
* @returns Next task from backend (if any)
|
|
1051
|
-
*/
|
|
1052
|
-
getNextTask(executionId: string): Promise<WorkflowExecutionResult>;
|
|
1053
1554
|
/**
|
|
1054
1555
|
* Execute a frontend activity using CommandBus.
|
|
1055
1556
|
*
|
|
@@ -1125,33 +1626,6 @@ declare abstract class AXPWorkflowExecutionService {
|
|
|
1125
1626
|
* ```
|
|
1126
1627
|
*/
|
|
1127
1628
|
abstract startExecution(request: AXPStartWorkflowExecutionRequest): Promise<AXPStartWorkflowExecutionResponse>;
|
|
1128
|
-
/**
|
|
1129
|
-
* Execute a backend activity.
|
|
1130
|
-
*
|
|
1131
|
-
* Executes an activity that should run in backend (e.g., execute-command, execute-query, set-variable).
|
|
1132
|
-
*
|
|
1133
|
-
* @param request - Backend activity execution request
|
|
1134
|
-
* @returns Activity execution response with output and updated state
|
|
1135
|
-
*
|
|
1136
|
-
* @example
|
|
1137
|
-
* ```typescript
|
|
1138
|
-
* const response = await workflowExecutionService.executeBackendActivity({
|
|
1139
|
-
* workflowId: 'my-workflow',
|
|
1140
|
-
* executionId: 'exec-123',
|
|
1141
|
-
* activityType: 'workflow-activity:execute-command',
|
|
1142
|
-
* activityId: 'cmd-1',
|
|
1143
|
-
* properties: {
|
|
1144
|
-
* commandKey: 'Entity:Create',
|
|
1145
|
-
* input: { entity: 'User', data: {...} }
|
|
1146
|
-
* },
|
|
1147
|
-
* workflowState: { variables: {...} }
|
|
1148
|
-
* });
|
|
1149
|
-
*
|
|
1150
|
-
* console.log('Output:', response.output);
|
|
1151
|
-
* console.log('Updated State:', response.state);
|
|
1152
|
-
* ```
|
|
1153
|
-
*/
|
|
1154
|
-
abstract executeBackendActivity(request: AXPExecuteBackendActivityRequest): Promise<AXPExecuteBackendActivityResponse>;
|
|
1155
1629
|
/**
|
|
1156
1630
|
* Resume a suspended workflow execution.
|
|
1157
1631
|
*
|
|
@@ -1165,6 +1639,7 @@ declare abstract class AXPWorkflowExecutionService {
|
|
|
1165
1639
|
* const response = await workflowExecutionService.resumeExecution({
|
|
1166
1640
|
* executionId: 'exec-123',
|
|
1167
1641
|
* stepId: 'step-dialog-1',
|
|
1642
|
+
* taskToken: 'sec-task-token',
|
|
1168
1643
|
* outcome: 'Confirmed',
|
|
1169
1644
|
* userInput: { confirmed: true }
|
|
1170
1645
|
* });
|
|
@@ -1211,30 +1686,6 @@ declare abstract class AXPWorkflowExecutionService {
|
|
|
1211
1686
|
* ```
|
|
1212
1687
|
*/
|
|
1213
1688
|
abstract getWorkflowDefinition(request: AXPGetWorkflowDefinitionRequest): Promise<AXPGetWorkflowDefinitionResponse>;
|
|
1214
|
-
/**
|
|
1215
|
-
* Execute current step from execution state.
|
|
1216
|
-
*
|
|
1217
|
-
* Backend handles everything:
|
|
1218
|
-
* - Gets execution state
|
|
1219
|
-
* - Gets workflow definition
|
|
1220
|
-
* - Finds current step
|
|
1221
|
-
* - Executes step (or returns step info for frontend execution)
|
|
1222
|
-
* - Determines next step based on outcomeConnections
|
|
1223
|
-
*
|
|
1224
|
-
* @param request - Execute current step request
|
|
1225
|
-
* @returns Step execution response with output, outcomes, and next step
|
|
1226
|
-
*
|
|
1227
|
-
* @example
|
|
1228
|
-
* ```typescript
|
|
1229
|
-
* const response = await workflowExecutionService.executeCurrentStep({
|
|
1230
|
-
* executionId: 'exec-123'
|
|
1231
|
-
* });
|
|
1232
|
-
*
|
|
1233
|
-
* console.log('Output:', response.output);
|
|
1234
|
-
* console.log('Next Step:', response.nextStep);
|
|
1235
|
-
* ```
|
|
1236
|
-
*/
|
|
1237
|
-
abstract executeCurrentStep(request: AXPExecuteCurrentStepRequest): Promise<AXPExecuteCurrentStepResponse>;
|
|
1238
1689
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXPWorkflowExecutionService, never>;
|
|
1239
1690
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXPWorkflowExecutionService>;
|
|
1240
1691
|
}
|
|
@@ -1678,4 +2129,4 @@ declare class EndActivity extends Activity<Record<string, never>, void> {
|
|
|
1678
2129
|
declare const provideWorkflowActivityCommands: () => i0.EnvironmentProviders;
|
|
1679
2130
|
|
|
1680
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 };
|
|
1681
|
-
export type { AXPActivityCategoryProvider, AXPActivityCategoryProviderContext, AXPActivityProvider, AXPActivityProviderContext,
|
|
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 };
|