@acorex/platform 21.0.0-next.3 → 21.0.0-next.5

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.
@@ -2,12 +2,9 @@ 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 { AXPCommand } from '@acorex/platform/runtime';
6
- import * as _acorex_platform_core from '@acorex/platform/core';
7
- import { AXPExecuteCommandResult, AXPValidationRules, AXPActionMenuItem } from '@acorex/platform/core';
8
- import { AXPWidgetTypesMap, AXPWidgetNode } from '@acorex/platform/layout/widget-core';
9
- import { AXStyleColorType } from '@acorex/cdk/common';
10
- import { AXPopupSizeType } from '@acorex/components/popup';
5
+ import { AXPCommand, AXPExecuteCommandResultPromise } from '@acorex/platform/runtime';
6
+ import { AXPCategoryEntity, AXPValidationRules } from '@acorex/platform/core';
7
+ import { AXPWidgetTypesMap } from '@acorex/platform/layout/widget-core';
11
8
 
12
9
  declare class AXPWorkflowError extends Error {
13
10
  inner: Error | null;
@@ -117,7 +114,6 @@ interface AXPWorkflowModuleConfigs {
117
114
  };
118
115
  }
119
116
  declare class AXPWorkflowModule {
120
- private _commandSetup;
121
117
  static forRoot(config?: AXPWorkflowModuleConfigs): ModuleWithProviders<AXPWorkflowModule>;
122
118
  static forChild(config?: AXPWorkflowModuleConfigs): ModuleWithProviders<AXPWorkflowModule>;
123
119
  /**
@@ -407,7 +403,7 @@ interface AXPCustomProperties {
407
403
  * Matches Activity from workflow definition schema.
408
404
  * Note: This is the workflow definition format, not the frontend Activity class.
409
405
  */
410
- interface AXPActivity {
406
+ interface AXPActivity$1 {
411
407
  /**
412
408
  * Activity ID.
413
409
  */
@@ -435,7 +431,7 @@ interface AXPActivity {
435
431
  * - 'backend': Execute in backend (business logic, database operations, API calls)
436
432
  * - 'both': Execute in both frontend and backend (hybrid activities)
437
433
  *
438
- * If not specified, falls back to ActivityDescriptor's executionMode.
434
+ * If not specified, falls back to AXPActivity's executionMode.
439
435
  * This allows per-instance override of the default execution mode.
440
436
  *
441
437
  * @example
@@ -465,7 +461,7 @@ interface AXPActivity {
465
461
  * Flowchart activity (workflow definition format).
466
462
  * This is the root activity that contains all other activities.
467
463
  */
468
- interface AXPFlowchart extends AXPActivity {
464
+ interface AXPFlowchart extends AXPActivity$1 {
469
465
  /**
470
466
  * Type must be "workflow-activity:flowchart".
471
467
  */
@@ -473,7 +469,7 @@ interface AXPFlowchart extends AXPActivity {
473
469
  /**
474
470
  * Activities in this flowchart.
475
471
  */
476
- activities: AXPActivity[];
472
+ activities: AXPActivity$1[];
477
473
  /**
478
474
  * Variables in this flowchart.
479
475
  */
@@ -1090,73 +1086,44 @@ interface AXPWorkflowInstance {
1090
1086
  finishedAt?: string | null;
1091
1087
  }
1092
1088
 
1089
+ /**
1090
+ * Activity Category - Extends AXPCategoryEntity for consistency and performance
1091
+ *
1092
+ * Inherited properties from AXPCategoryEntity:
1093
+ * - id: string - Unique identifier
1094
+ * - title: string - Display name
1095
+ * - description?: string - Category description
1096
+ * - parentId?: string - Parent category ID
1097
+ * - childrenCount: number - Direct child categories count (enables lazy loading)
1098
+ * - itemsCount?: number - Direct activities count
1099
+ * - totalChildren?: number - Total nested categories (optional, for analytics)
1100
+ * - totalItems?: number - Total activities in tree (optional, for analytics)
1101
+ */
1102
+ interface AXPActivityCategory extends AXPCategoryEntity {
1103
+ }
1093
1104
  interface ActivityPropertyWidget {
1094
1105
  type: AXPWidgetTypesMap[keyof AXPWidgetTypesMap] | string;
1095
1106
  options?: Record<string, any>;
1096
1107
  }
1097
1108
  /**
1098
- * Simple activity interface - just a command with outcomes.
1099
- * All activities are AXPCommand for unified execution through Command Bus.
1109
+ * Activity Definition - Metadata for UI and tooling.
1110
+ * Contains all metadata needed for displaying activities in toolbox and designer.
1111
+ * The `name` property is used as the command key for execution.
1100
1112
  */
1101
- interface IActivity<TInput = any, TOutput = any> extends AXPCommand<TInput, {
1102
- output: TOutput;
1103
- outcomes: Record<string, any>;
1104
- }> {
1113
+ interface AXPActivityDefinition {
1105
1114
  /**
1106
- * Activity type name.
1107
- * Example: "WriteLine", "ShowDialog", "CreateUserCommand"
1108
- */
1109
- type: string;
1110
- /**
1111
- * Display name for UI.
1115
+ * Activity name - used as command key for execution.
1116
+ * This is the unique identifier for the activity.
1112
1117
  */
1113
- name?: string;
1114
- /**
1115
- * Execute the activity as a command.
1116
- * @param input - Activity input data
1117
- * @returns Promise with output and outcomes
1118
- */
1119
- execute(input: TInput): Promise<AXPExecuteCommandResult<{
1120
- output: TOutput;
1121
- outcomes: Record<string, any>;
1122
- }>>;
1123
- }
1124
- /**
1125
- * Base abstract class for activities.
1126
- * Extend this to create custom activities.
1127
- */
1128
- declare abstract class Activity<TInput = any, TOutput = any> implements IActivity<TInput, TOutput> {
1129
- type: string;
1130
- name?: string;
1131
- constructor(type: string, name?: string);
1132
- /**
1133
- * Execute the activity as a command.
1134
- * Override this method in subclasses to implement activity logic.
1135
- */
1136
- abstract execute(input: TInput): Promise<AXPExecuteCommandResult<{
1137
- output: TOutput;
1138
- outcomes: Record<string, any>;
1139
- }>>;
1140
- /**
1141
- * Helper method that returns Done outcome by default.
1142
- */
1143
- protected createResult(output: TOutput, outcome?: string): AXPExecuteCommandResult<{
1144
- output: TOutput;
1145
- outcomes: Record<string, any>;
1146
- }>;
1147
- }
1148
- /**
1149
- * Activity descriptor - metadata about an activity type.
1150
- */
1151
- interface ActivityDescriptor {
1118
+ name: string;
1152
1119
  /**
1153
- * Activity type name.
1120
+ * Activity type (e.g., "workflow-activity:check-permission").
1154
1121
  */
1155
1122
  type: string;
1156
1123
  /**
1157
1124
  * Display name for UI.
1158
1125
  */
1159
- displayName: string;
1126
+ title?: string;
1160
1127
  /**
1161
1128
  * Description of what the activity does.
1162
1129
  */
@@ -1164,7 +1131,7 @@ interface ActivityDescriptor {
1164
1131
  /**
1165
1132
  * Category for grouping in toolbox.
1166
1133
  */
1167
- category: string;
1134
+ category?: string;
1168
1135
  /**
1169
1136
  * Icon name or class.
1170
1137
  */
@@ -1181,11 +1148,11 @@ interface ActivityDescriptor {
1181
1148
  /**
1182
1149
  * Input descriptors.
1183
1150
  */
1184
- inputs: InputDescriptor[];
1151
+ inputs?: InputDescriptor[];
1185
1152
  /**
1186
1153
  * Output descriptors.
1187
1154
  */
1188
- outputs: OutputDescriptor[];
1155
+ outputs?: OutputDescriptor[];
1189
1156
  /**
1190
1157
  * Static outcomes (exit points).
1191
1158
  * Example: ['Done', 'Success', 'Failed']
@@ -1202,6 +1169,25 @@ interface ActivityDescriptor {
1202
1169
  */
1203
1170
  isContainer?: boolean;
1204
1171
  }
1172
+ /**
1173
+ * Activity - Command with specific TResult structure.
1174
+ * Extends AXPCommand with a fixed TResult that includes output and outcomes.
1175
+ * No additional properties beyond AXPCommand - pure command interface.
1176
+ */
1177
+ interface AXPActivity<TInput = any, TOutput = any> extends AXPCommand<TInput, {
1178
+ output: TOutput;
1179
+ outcomes: Record<string, any>;
1180
+ }> {
1181
+ /**
1182
+ * Execute the activity as a command.
1183
+ * @param input - Activity input data
1184
+ * @returns Promise with output and outcomes
1185
+ */
1186
+ execute(input: TInput): AXPExecuteCommandResultPromise<{
1187
+ output: TOutput;
1188
+ outcomes: Record<string, any>;
1189
+ }>;
1190
+ }
1205
1191
  /**
1206
1192
  * Input property descriptor.
1207
1193
  * Similar to AXPEntityProperty structure.
@@ -1231,158 +1217,166 @@ interface OutputDescriptor {
1231
1217
  dataType: string;
1232
1218
  };
1233
1219
  }
1220
+
1221
+ type AXPActivityProviderToken = AXPActivityProvider | Promise<AXPActivityProvider>;
1222
+ declare const AXP_ACTIVITY_PROVIDER: InjectionToken<AXPActivityProviderToken[]>;
1223
+ interface AXPActivityProvider {
1224
+ /**
1225
+ * Get list of activity definitions for a category.
1226
+ * @param categoryId - Category ID to filter activities
1227
+ * @returns Promise of activity definitions array
1228
+ */
1229
+ getList(categoryId: string): Promise<AXPActivityDefinition[]>;
1230
+ /**
1231
+ * Get activity definition by name (unique identifier).
1232
+ * The name is used as the command key for execution.
1233
+ * @param name - Activity name (unique identifier and command key)
1234
+ * @returns Promise of activity definition or undefined if not found
1235
+ */
1236
+ getById(name: string): Promise<AXPActivityDefinition | undefined>;
1237
+ }
1238
+ type AXPActivityCategoryProviderToken = AXPActivityCategoryProvider | Promise<AXPActivityCategoryProvider>;
1239
+ declare const AXP_ACTIVITY_CATEGORY_PROVIDER: InjectionToken<AXPActivityCategoryProviderToken[]>;
1240
+ interface AXPActivityCategoryProvider {
1241
+ getList(parentId?: string): Promise<AXPActivityCategory[]>;
1242
+ getById(id: string): Promise<AXPActivityCategory | undefined>;
1243
+ }
1244
+
1234
1245
  /**
1235
- * Activity registry for registering and creating activities.
1236
- */
1237
- declare class ActivityRegistry {
1238
- private registry;
1239
- private descriptors;
1246
+ * Optimized Activity Definition Service
1247
+ *
1248
+ * Manages activity definitions (metadata) for UI and tooling.
1249
+ * Similar to AXPReportDefinitionService - only handles metadata, not execution.
1250
+ *
1251
+ * Performance optimizations:
1252
+ * 1. Uses childrenCount to determine if category has children (no query needed)
1253
+ * 2. Uses itemsCount to determine if category has activities (no query needed)
1254
+ * 3. Aggressive caching prevents duplicate API calls
1255
+ * 4. Single pending request per resource prevents race conditions
1256
+ * 5. Lazy loading - only loads data when needed
1257
+ */
1258
+ declare class AXPActivityDefinitionService {
1259
+ private readonly categoryProviders;
1260
+ private readonly activityProviders;
1261
+ /** Cache for categories by id - O(1) lookup */
1262
+ private categoriesById;
1263
+ /** Cache for categories by parentId - O(1) lookup */
1264
+ private categoriesByParentId;
1265
+ /** Cache for activity definitions by categoryId - O(1) lookup */
1266
+ private activitiesByCategory;
1267
+ /** Cache for individual activity definitions by name - O(1) lookup */
1268
+ private activitiesByName;
1269
+ /** Track which provider index owns each category (by category ID) */
1270
+ private categoryOwnership;
1271
+ /** Pending API requests to prevent duplicate calls */
1272
+ private pendingCategoriesRequests;
1273
+ private pendingActivitiesRequests;
1274
+ private pendingActivityRequests;
1275
+ /**
1276
+ * Get categories by parentId with aggressive caching
1277
+ *
1278
+ * Optimization: Returns cached result immediately if available,
1279
+ * preventing unnecessary API calls during navigation
1280
+ *
1281
+ * @param parentId - Parent category ID (undefined = root categories)
1282
+ * @returns Array of categories with count metadata (childrenCount, itemsCount)
1283
+ */
1284
+ getCategories(parentId?: string): Promise<AXPActivityCategory[]>;
1240
1285
  /**
1241
- * Register an activity type.
1286
+ * Get single category by ID with O(1) lookup
1287
+ *
1288
+ * Optimization: Uses Map for instant retrieval, falls back to
1289
+ * searching cache, then providers if not found
1242
1290
  */
1243
- register(type: string, factory: () => IActivity, descriptor: ActivityDescriptor): void;
1291
+ getCategoryById(categoryId: string): Promise<AXPActivityCategory | undefined>;
1244
1292
  /**
1245
- * Create an activity instance.
1293
+ * Get category path from root to specified category
1294
+ *
1295
+ * Optimization: Builds path using cached categories only
1246
1296
  */
1247
- create(type: string): IActivity;
1297
+ getCategoriesPathById(categoryId: string): Promise<AXPActivityCategory[]>;
1248
1298
  /**
1249
- * Get activity descriptor.
1299
+ * Get activity definitions for a category with smart caching
1300
+ *
1301
+ * Optimization: Checks itemsCount before querying
1302
+ * - If itemsCount = 0, returns empty array (no API call)
1303
+ * - If itemsCount > 0, loads and caches activity definitions
1304
+ * - Returns cached result on subsequent calls
1305
+ *
1306
+ * @param categoryId - Category ID to get activity definitions from
1307
+ * @returns Array of activity definitions
1250
1308
  */
1251
- getDescriptor(type: string): ActivityDescriptor | undefined;
1309
+ getActivitiesByCategoryId(categoryId: string): Promise<AXPActivityDefinition[]>;
1252
1310
  /**
1253
- * Get all registered types.
1311
+ * Get single activity definition by name with O(1) lookup
1312
+ *
1313
+ * Optimization: Uses Map for instant retrieval
1314
+ *
1315
+ * @param name - Activity name (unique identifier and command key)
1316
+ * @returns Activity definition or undefined if not found
1254
1317
  */
1255
- getTypes(): string[];
1318
+ getActivityByName(name: string): Promise<AXPActivityDefinition | undefined>;
1256
1319
  /**
1257
- * Get all descriptors.
1320
+ * Get category ID containing a specific activity definition
1321
+ *
1322
+ * Optimization: Searches cache first, loads on-demand if needed
1258
1323
  */
1259
- getAllDescriptors(): ActivityDescriptor[];
1324
+ getCategoryIdByActivityName(activityName: string): Promise<string | undefined>;
1260
1325
  /**
1261
- * Get descriptors by category.
1326
+ * Get category path for an activity
1262
1327
  */
1263
- getDescriptorsByCategory(category: string): ActivityDescriptor[];
1264
- }
1265
-
1266
- interface ActivityCategoryDescriptor {
1267
- name: string;
1268
- displayName: string;
1269
- description?: string;
1270
- icon?: string;
1271
- color?: string;
1272
- order?: number;
1273
- isVisible?: boolean;
1274
- tags?: string[];
1275
- }
1276
- interface AXPActivityCategoryProviderContext {
1277
- registerCategories(categories: ActivityCategoryDescriptor[]): void;
1278
- }
1279
- interface AXPActivityCategoryProvider {
1280
- provide(context: AXPActivityCategoryProviderContext): Promise<void> | void;
1281
- }
1282
- /**
1283
- * Injection token for activity category providers.
1284
- */
1285
- declare const AXP_ACTIVITY_CATEGORY_PROVIDER: InjectionToken<AXPActivityCategoryProvider[]>;
1286
- declare class AXPActivityCategoryProviderService {
1287
- private parent?;
1288
- private providers;
1289
- private categories;
1290
- private isInitialized;
1291
- constructor(parent?: AXPActivityCategoryProviderService | undefined, providers?: AXPActivityCategoryProvider[]);
1292
- private initialize;
1293
- getAllCategories(): ActivityCategoryDescriptor[];
1294
- getCategory(name: string): ActivityCategoryDescriptor | undefined;
1295
- static ɵfac: i0.ɵɵFactoryDeclaration<AXPActivityCategoryProviderService, [{ optional: true; skipSelf: true; }, { optional: true; }]>;
1296
- static ɵprov: i0.ɵɵInjectableDeclaration<AXPActivityCategoryProviderService>;
1297
- }
1298
-
1299
- /**
1300
- * Context for registering activities in a provider.
1301
- */
1302
- interface AXPActivityProviderContext {
1328
+ getCategoriesPathByActivityName(activityName: string): Promise<AXPActivityCategory[]>;
1303
1329
  /**
1304
- * Register an activity with its descriptor.
1330
+ * Load categories from providers and cache results
1331
+ *
1332
+ * Optimization: Tracks provider ownership to avoid unnecessary API calls
1333
+ * - For root (parentId = undefined): Query ALL providers
1334
+ * - For children: Only query the provider that owns the parent
1305
1335
  */
1306
- registerActivity(config: {
1307
- key: string;
1308
- descriptor: ActivityDescriptor;
1309
- }): void;
1310
- }
1311
- /**
1312
- * Interface for activity providers.
1313
- * Modules implement this to register their activities.
1314
- */
1315
- interface AXPActivityProvider {
1336
+ private loadCategoriesFromProviders;
1316
1337
  /**
1317
- * Provide activities to the system.
1338
+ * Get the provider index that owns a specific category
1339
+ *
1340
+ * @returns Array with provider index, or null if ownership unknown (query all)
1318
1341
  */
1319
- provide(context: AXPActivityProviderContext): Promise<void> | void;
1320
- }
1321
- /**
1322
- * Injection token for activity providers.
1323
- */
1324
- declare const AXP_ACTIVITY_PROVIDER: InjectionToken<AXPActivityProvider[]>;
1325
- /**
1326
- * Category definition for activity categorization.
1327
- */
1328
- interface ActivityCategory {
1329
- name: string;
1330
- displayName: string;
1331
- description?: string;
1332
- icon?: string;
1333
- color?: string;
1334
- order?: number;
1335
- isVisible?: boolean;
1336
- tags?: string[];
1337
- }
1338
- /**
1339
- * Activity Provider Service.
1340
- * Collects all activity providers and manages activity registration.
1341
- */
1342
- declare class AXPActivityProviderService {
1343
- private activityDescriptors;
1344
- private categories;
1345
- private providers;
1346
- private categoryProviders;
1347
- private initialized;
1348
- private readonly commandService;
1349
- private readonly commandRegistry;
1342
+ private getProviderIndexForCategory;
1350
1343
  /**
1351
- * Register an activity provider.
1344
+ * Load activity definitions from providers and cache results
1345
+ *
1346
+ * Optimization: Only queries the provider that owns the category
1347
+ * Uses provider INDEX to match category provider with activity provider
1352
1348
  */
1353
- registerProvider(provider: AXPActivityProvider): void;
1349
+ private loadActivitiesFromProviders;
1354
1350
  /**
1355
- * Register a category provider.
1351
+ * Load single activity definition from providers and cache result
1356
1352
  */
1357
- registerCategoryProvider(provider: AXPActivityCategoryProvider): void;
1353
+ private loadActivityFromProviders;
1358
1354
  /**
1359
- * Initialize all providers.
1355
+ * Breadth-first search through category hierarchy
1360
1356
  */
1361
- initialize(): Promise<void>;
1357
+ private searchCategoryInHierarchy;
1362
1358
  /**
1363
- * Get activity descriptor by key.
1359
+ * Check if category has children (uses cached count)
1364
1360
  */
1365
- getDescriptor(key: string): ActivityDescriptor | undefined;
1361
+ categoryHasChildren(categoryId: string): boolean;
1366
1362
  /**
1367
- * Get all activity descriptors.
1363
+ * Check if category has activities (uses cached count)
1368
1364
  */
1369
- getAllDescriptors(): ActivityDescriptor[];
1365
+ categoryHasActivities(categoryId: string): boolean;
1370
1366
  /**
1371
- * Get descriptors by category.
1367
+ * Clear all caches
1372
1368
  */
1373
- getDescriptorsByCategory(category: string): ActivityDescriptor[];
1369
+ clearAllCache(): void;
1374
1370
  /**
1375
- * Get all categories.
1371
+ * Clear categories cache only
1376
1372
  */
1377
- getCategories(): ActivityCategory[];
1373
+ clearCategoriesCache(): void;
1378
1374
  /**
1379
- * Create an activity instance by key using AXPCommandService.
1375
+ * Clear activities cache only
1380
1376
  */
1381
- createActivity(key: string): Promise<IActivity | null>;
1382
- private initializeProvider;
1383
- private initializeCategoryProvider;
1384
- static ɵfac: i0.ɵɵFactoryDeclaration<AXPActivityProviderService, never>;
1385
- static ɵprov: i0.ɵɵInjectableDeclaration<AXPActivityProviderService>;
1377
+ clearActivitiesCache(): void;
1378
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXPActivityDefinitionService, never>;
1379
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXPActivityDefinitionService>;
1386
1380
  }
1387
1381
 
1388
1382
  /**
@@ -1810,634 +1804,5 @@ declare abstract class AXPWorkflowExecutionService {
1810
1804
  static ɵprov: i0.ɵɵInjectableDeclaration<AXPWorkflowExecutionService>;
1811
1805
  }
1812
1806
 
1813
- /**
1814
- * WriteLine Activity - Simple console logging activity.
1815
- *
1816
- * Usage:
1817
- * ```typescript
1818
- * const activity = new WriteLine();
1819
- * await activity.execute({ text: 'Hello World' });
1820
- * ```
1821
- */
1822
- declare class WriteLine extends Activity<{
1823
- text?: string;
1824
- }, void> {
1825
- constructor();
1826
- execute(input: {
1827
- text?: string;
1828
- }): Promise<_acorex_platform_core.AXPExecuteCommandResult<{
1829
- output: void;
1830
- outcomes: Record<string, any>;
1831
- }>>;
1832
- }
1833
-
1834
- /**
1835
- * Sequence Activity - Executes activities in sequential order.
1836
- *
1837
- * Usage:
1838
- * ```typescript
1839
- * const sequence = new Sequence();
1840
- * sequence.activities = [activity1, activity2, activity3];
1841
- * await sequence.execute({});
1842
- * ```
1843
- */
1844
- declare class Sequence extends Activity<{}, void> {
1845
- /**
1846
- * Activities to execute in sequence.
1847
- */
1848
- activities: IActivity[];
1849
- constructor();
1850
- execute(input: {}): Promise<_acorex_platform_core.AXPExecuteCommandResult<{
1851
- output: void;
1852
- outcomes: Record<string, any>;
1853
- }>>;
1854
- }
1855
-
1856
- /**
1857
- * Show Confirm Dialog Activity - Displays confirmation dialog to user.
1858
- *
1859
- * Has two outcomes:
1860
- * - 'Confirmed': User clicked confirm/yes
1861
- * - 'Cancelled': User clicked cancel/no
1862
- *
1863
- * Usage:
1864
- * ```typescript
1865
- * const dialog = new ShowConfirmDialog();
1866
- * await dialog.execute({
1867
- * title: 'Confirm Delete',
1868
- * message: 'Are you sure?',
1869
- * color: 'danger'
1870
- * });
1871
- * ```
1872
- */
1873
- declare class ShowConfirmDialog extends Activity<{
1874
- title?: string;
1875
- message?: string;
1876
- color?: AXStyleColorType;
1877
- defaultAction?: 'confirm' | 'cancel';
1878
- align?: 'horizontal' | 'vertical';
1879
- backdrop?: boolean;
1880
- }, {
1881
- result: boolean;
1882
- action: string;
1883
- }> {
1884
- private readonly dialogService;
1885
- private readonly translationService;
1886
- constructor();
1887
- execute(input: {
1888
- title?: string;
1889
- message?: string;
1890
- color?: AXStyleColorType;
1891
- defaultAction?: 'confirm' | 'cancel';
1892
- align?: 'horizontal' | 'vertical';
1893
- backdrop?: boolean;
1894
- }): Promise<_acorex_platform_core.AXPExecuteCommandResult<{
1895
- output: {
1896
- result: boolean;
1897
- action: string;
1898
- };
1899
- outcomes: Record<string, any>;
1900
- }>>;
1901
- }
1902
-
1903
- /**
1904
- * Show Alert Dialog Activity - Displays alert dialog to user.
1905
- *
1906
- * Has one outcome:
1907
- * - 'Done': User clicked OK
1908
- *
1909
- * Usage:
1910
- * ```typescript
1911
- * const dialog = new ShowAlertDialog();
1912
- * await dialog.execute({
1913
- * title: 'Alert',
1914
- * message: 'This is an alert',
1915
- * color: 'info'
1916
- * });
1917
- * ```
1918
- */
1919
- declare class ShowAlertDialog extends Activity<{
1920
- title?: string;
1921
- message?: string;
1922
- color?: AXStyleColorType;
1923
- }, {
1924
- result: boolean;
1925
- action: string;
1926
- }> {
1927
- private readonly dialogService;
1928
- private readonly translationService;
1929
- constructor();
1930
- execute(input: {
1931
- title?: string;
1932
- message?: string;
1933
- color?: AXStyleColorType;
1934
- }): Promise<_acorex_platform_core.AXPExecuteCommandResult<{
1935
- output: {
1936
- result: boolean;
1937
- action: string;
1938
- };
1939
- outcomes: Record<string, any>;
1940
- }>>;
1941
- }
1942
-
1943
- /**
1944
- * Show Dialog Layout Builder Activity - Displays dialog using Layout Builder.
1945
- *
1946
- * This activity allows you to create custom dialogs using the Layout Builder API.
1947
- * It accepts JSON-serializable content (AXPWidgetNode) and actions configuration.
1948
- *
1949
- * The content can be created using Layout Builder and then converted to JSON:
1950
- * ```typescript
1951
- * const builder = layoutBuilderService.create();
1952
- * builder.flex(flex => {
1953
- * flex.setDirection('column')
1954
- * .formField('First Name', field => {
1955
- * field.path('firstName');
1956
- * field.textBox({ placeholder: 'Enter first name' });
1957
- * });
1958
- * });
1959
- * const contentNode = builder.build();
1960
- * ```
1961
- *
1962
- * Usage in Workflow:
1963
- * ```typescript
1964
- * const dialog = new ShowDialogLayoutBuilder();
1965
- * await dialog.execute({
1966
- * title: 'User Information',
1967
- * size: 'md',
1968
- * context: { firstName: '', lastName: '' },
1969
- * content: {
1970
- * type: 'flex-layout',
1971
- * mode: 'edit',
1972
- * options: {
1973
- * flexDirection: 'column',
1974
- * gap: '16px'
1975
- * },
1976
- * children: [
1977
- * {
1978
- * type: 'form-field',
1979
- * mode: 'edit',
1980
- * options: {
1981
- * label: 'First Name',
1982
- * showLabel: true
1983
- * },
1984
- * children: [{
1985
- * type: 'text-editor',
1986
- * path: 'firstName',
1987
- * options: {
1988
- * placeholder: 'Enter first name'
1989
- * }
1990
- * }]
1991
- * }
1992
- * ]
1993
- * },
1994
- * actions: {
1995
- * cancel: '@general:actions.cancel.title',
1996
- * submit: '@general:actions.submit.title',
1997
- * custom: [{
1998
- * title: 'Save Draft',
1999
- * icon: 'fa-save',
2000
- * color: 'secondary',
2001
- * command: { name: 'save-draft' }
2002
- * }]
2003
- * }
2004
- * });
2005
- * ```
2006
- *
2007
- * Usage in JSON Workflow Definition:
2008
- * ```json
2009
- * {
2010
- * "type": "ShowDialogLayoutBuilder",
2011
- * "properties": {
2012
- * "title": "User Information",
2013
- * "size": "md",
2014
- * "context": { "firstName": "", "lastName": "" },
2015
- * "content": {
2016
- * "type": "flex-layout",
2017
- * "mode": "edit",
2018
- * "options": {
2019
- * "flexDirection": "column",
2020
- * "gap": "16px"
2021
- * },
2022
- * "children": [
2023
- * {
2024
- * "type": "form-field",
2025
- * "mode": "edit",
2026
- * "options": {
2027
- * "label": "First Name",
2028
- * "showLabel": true
2029
- * },
2030
- * "children": [{
2031
- * "type": "text-editor",
2032
- * "path": "firstName",
2033
- * "options": {
2034
- * "placeholder": "Enter first name"
2035
- * }
2036
- * }]
2037
- * }
2038
- * ]
2039
- * },
2040
- * "actions": {
2041
- * "cancel": "@general:actions.cancel.title",
2042
- * "submit": "@general:actions.submit.title"
2043
- * }
2044
- * }
2045
- * }
2046
- * ```
2047
- */
2048
- declare class ShowDialogLayoutBuilder extends Activity<{
2049
- /**
2050
- * Dialog title
2051
- */
2052
- title?: string;
2053
- /**
2054
- * Dialog size
2055
- */
2056
- size?: AXPopupSizeType;
2057
- /**
2058
- * Initial dialog context/data
2059
- */
2060
- context?: Record<string, any>;
2061
- /**
2062
- * Show close button
2063
- */
2064
- closeButton?: boolean;
2065
- /**
2066
- * Dialog message (optional, shown above content)
2067
- */
2068
- message?: string;
2069
- /**
2070
- * Dialog content as AXPWidgetNode (JSON-serializable)
2071
- * This can be created using Layout Builder and then converted to JSON.
2072
- */
2073
- content?: AXPWidgetNode;
2074
- /**
2075
- * Dialog actions configuration (JSON-serializable)
2076
- */
2077
- actions?: {
2078
- /**
2079
- * Cancel button text (optional)
2080
- */
2081
- cancel?: string;
2082
- /**
2083
- * Submit button text (optional)
2084
- */
2085
- submit?: string;
2086
- /**
2087
- * Custom actions array (optional)
2088
- */
2089
- custom?: AXPActionMenuItem[];
2090
- };
2091
- }, {
2092
- /**
2093
- * Dialog context/data after user interaction
2094
- */
2095
- context: Record<string, any>;
2096
- /**
2097
- * Action that user clicked (e.g., 'submit', 'cancel', or custom action name)
2098
- */
2099
- action: string;
2100
- /**
2101
- * Whether user cancelled the dialog
2102
- */
2103
- cancelled: boolean;
2104
- /**
2105
- * Whether user confirmed/submitted the dialog
2106
- */
2107
- confirmed: boolean;
2108
- }> {
2109
- private readonly layoutBuilder;
2110
- constructor();
2111
- execute(input: {
2112
- title?: string;
2113
- size?: AXPopupSizeType;
2114
- context?: Record<string, any>;
2115
- closeButton?: boolean;
2116
- message?: string;
2117
- content?: AXPWidgetNode;
2118
- actions?: {
2119
- cancel?: string;
2120
- submit?: string;
2121
- custom?: AXPActionMenuItem[];
2122
- };
2123
- }): Promise<AXPExecuteCommandResult<{
2124
- output: {
2125
- context: Record<string, any>;
2126
- action: string;
2127
- cancelled: boolean;
2128
- confirmed: boolean;
2129
- };
2130
- outcomes: Record<string, any>;
2131
- }>>;
2132
- }
2133
-
2134
- /**
2135
- * Show Toast Activity - Displays toast notification to user.
2136
- *
2137
- * Usage:
2138
- * ```typescript
2139
- * const toast = new ShowToast();
2140
- * await toast.execute({
2141
- * color: 'success',
2142
- * title: 'Success',
2143
- * message: 'Operation completed successfully!'
2144
- * });
2145
- * ```
2146
- */
2147
- declare class ShowToast extends Activity<{
2148
- color?: AXStyleColorType;
2149
- title?: string;
2150
- message?: string;
2151
- duration?: number;
2152
- }, void> {
2153
- private readonly toastService;
2154
- private readonly translationService;
2155
- constructor();
2156
- execute(input: {
2157
- color?: AXStyleColorType;
2158
- title?: string;
2159
- message?: string;
2160
- duration?: number;
2161
- }): Promise<_acorex_platform_core.AXPExecuteCommandResult<{
2162
- output: void;
2163
- outcomes: Record<string, any>;
2164
- }>>;
2165
- }
2166
-
2167
- /**
2168
- * Navigate Activity - Navigates to different pages/routes.
2169
- *
2170
- * Usage:
2171
- * ```typescript
2172
- * const navigate = new Navigate();
2173
- * await navigate.execute({
2174
- * mode: 'route',
2175
- * route: '/users',
2176
- * params: { id: '123' }
2177
- * });
2178
- * ```
2179
- */
2180
- declare class Navigate extends Activity<{
2181
- mode?: 'route' | 'entity-details' | 'entity-list' | 'external';
2182
- route?: string;
2183
- params?: Record<string, any>;
2184
- queryParams?: Record<string, any>;
2185
- entity?: string;
2186
- entityId?: string;
2187
- url?: string;
2188
- }, void> {
2189
- private readonly router;
2190
- constructor();
2191
- execute(input: {
2192
- mode?: 'route' | 'entity-details' | 'entity-list' | 'external';
2193
- route?: string;
2194
- params?: Record<string, any>;
2195
- queryParams?: Record<string, any>;
2196
- entity?: string;
2197
- entityId?: string;
2198
- url?: string;
2199
- }): Promise<_acorex_platform_core.AXPExecuteCommandResult<{
2200
- output: void;
2201
- outcomes: Record<string, any>;
2202
- }>>;
2203
- }
2204
-
2205
- /**
2206
- * Set Variable Activity - Sets a variable value in workflow context.
2207
- *
2208
- * Usage:
2209
- * ```typescript
2210
- * const setVar = new SetVariable();
2211
- * await setVar.execute({
2212
- * variableName: 'userId',
2213
- * value: '12345'
2214
- * });
2215
- * ```
2216
- */
2217
- declare class SetVariable extends Activity<{
2218
- variableName: string;
2219
- value: any;
2220
- }, void> {
2221
- constructor();
2222
- execute(input: {
2223
- variableName: string;
2224
- value: any;
2225
- }): Promise<_acorex_platform_core.AXPExecuteCommandResult<{
2226
- output: void;
2227
- outcomes: Record<string, any>;
2228
- }>>;
2229
- }
2230
-
2231
- /**
2232
- * Dispatch Event Activity - Dispatches an event to the system.
2233
- *
2234
- * Usage:
2235
- * ```typescript
2236
- * const dispatch = new DispatchEvent();
2237
- * await dispatch.execute({
2238
- * eventName: 'user-created',
2239
- * eventData: { userId: '123', name: 'John' }
2240
- * });
2241
- * ```
2242
- */
2243
- declare class DispatchEvent extends Activity<{
2244
- eventName: string;
2245
- eventData?: any;
2246
- }, void> {
2247
- constructor();
2248
- execute(input: {
2249
- eventName: string;
2250
- eventData?: any;
2251
- }): Promise<_acorex_platform_core.AXPExecuteCommandResult<{
2252
- output: void;
2253
- outcomes: Record<string, any>;
2254
- }>>;
2255
- }
2256
-
2257
- /**
2258
- * If Activity - Conditional execution based on a condition.
2259
- *
2260
- * Usage:
2261
- * ```typescript
2262
- * const ifActivity = new If();
2263
- * ifActivity.condition = '{{user.isAdmin}}';
2264
- * ifActivity.thenActivities = [activity1, activity2];
2265
- * ifActivity.elseActivities = [activity3];
2266
- * ```
2267
- */
2268
- declare class If extends Activity<{
2269
- condition: string | boolean;
2270
- thenActivities?: IActivity[];
2271
- elseActivities?: IActivity[];
2272
- }, any> {
2273
- constructor();
2274
- execute(input: {
2275
- condition: string | boolean;
2276
- thenActivities?: IActivity[];
2277
- elseActivities?: IActivity[];
2278
- }): Promise<_acorex_platform_core.AXPExecuteCommandResult<{
2279
- output: any;
2280
- outcomes: Record<string, any>;
2281
- }>>;
2282
- private evaluateCondition;
2283
- }
2284
-
2285
- /**
2286
- * While Activity - Loop execution while condition is true.
2287
- *
2288
- * Usage:
2289
- * ```typescript
2290
- * const whileActivity = new While();
2291
- * whileActivity.condition = '{{counter < 10}}';
2292
- * whileActivity.activities = [incrementActivity, logActivity];
2293
- * ```
2294
- */
2295
- declare class While extends Activity<{
2296
- condition: string | boolean;
2297
- activities?: IActivity[];
2298
- maxIterations?: number;
2299
- }, any> {
2300
- constructor();
2301
- execute(input: {
2302
- condition: string | boolean;
2303
- activities?: IActivity[];
2304
- maxIterations?: number;
2305
- }): Promise<_acorex_platform_core.AXPExecuteCommandResult<{
2306
- output: any;
2307
- outcomes: Record<string, any>;
2308
- }>>;
2309
- private evaluateCondition;
2310
- }
2311
-
2312
- /**
2313
- * ForEach Activity - Iterates over a collection of items.
2314
- *
2315
- * Usage:
2316
- * ```typescript
2317
- * const forEach = new ForEach();
2318
- * await forEach.execute({
2319
- * items: ['item1', 'item2', 'item3'],
2320
- * activities: [processItemActivity]
2321
- * });
2322
- * ```
2323
- */
2324
- declare class ForEach extends Activity<{
2325
- items: any[];
2326
- activities?: IActivity[];
2327
- itemVariableName?: string;
2328
- indexVariableName?: string;
2329
- }, any> {
2330
- constructor();
2331
- execute(input: {
2332
- items: any[];
2333
- activities?: IActivity[];
2334
- itemVariableName?: string;
2335
- indexVariableName?: string;
2336
- }): Promise<_acorex_platform_core.AXPExecuteCommandResult<{
2337
- output: any;
2338
- outcomes: Record<string, any>;
2339
- }>>;
2340
- }
2341
-
2342
- /**
2343
- * Execute Command Activity - Executes a command through Command Bus.
2344
- *
2345
- * Usage:
2346
- * ```typescript
2347
- * const executeCmd = new ExecuteCommand();
2348
- * await executeCmd.execute({
2349
- * commandKey: 'UserManagement.CreateUser',
2350
- * input: { name: 'John', email: 'john@example.com' }
2351
- * });
2352
- * ```
2353
- */
2354
- declare class ExecuteCommand extends Activity<{
2355
- commandKey: string;
2356
- input?: any;
2357
- }, any> {
2358
- private readonly commandService;
2359
- constructor();
2360
- execute(input: {
2361
- commandKey: string;
2362
- input?: any;
2363
- }): Promise<_acorex_platform_core.AXPExecuteCommandResult<{
2364
- output: any;
2365
- outcomes: Record<string, any>;
2366
- }>>;
2367
- }
2368
-
2369
- /**
2370
- * Execute Query Activity - Executes a query through Query Bus.
2371
- *
2372
- * Usage:
2373
- * ```typescript
2374
- * const executeQuery = new ExecuteQuery();
2375
- * await executeQuery.execute({
2376
- * queryKey: 'UserManagement.GetUsers',
2377
- * input: { page: 1, pageSize: 10 }
2378
- * });
2379
- * ```
2380
- */
2381
- declare class ExecuteQuery extends Activity<{
2382
- queryKey: string;
2383
- input?: any;
2384
- }, any> {
2385
- private readonly queryService;
2386
- constructor();
2387
- execute(input: {
2388
- queryKey: string;
2389
- input?: any;
2390
- }): Promise<_acorex_platform_core.AXPExecuteCommandResult<{
2391
- output: any;
2392
- outcomes: Record<string, any>;
2393
- }>>;
2394
- }
2395
-
2396
- /**
2397
- * Start Activity - Marks the start point of a workflow.
2398
- *
2399
- * This is a visual marker activity that doesn't perform any actual work.
2400
- * It's used in workflow designers to clearly indicate where a workflow begins.
2401
- *
2402
- * Usage:
2403
- * ```typescript
2404
- * const start = new StartActivity();
2405
- * await start.execute({});
2406
- * ```
2407
- */
2408
- declare class StartActivity extends Activity<Record<string, never>, void> {
2409
- constructor();
2410
- execute(input: Record<string, never>): Promise<_acorex_platform_core.AXPExecuteCommandResult<{
2411
- output: void;
2412
- outcomes: Record<string, any>;
2413
- }>>;
2414
- }
2415
-
2416
- /**
2417
- * End Activity - Marks the end point of a workflow.
2418
- *
2419
- * This is a visual marker activity that terminates the workflow execution.
2420
- * When this activity is reached, the workflow completes successfully.
2421
- *
2422
- * Usage:
2423
- * ```typescript
2424
- * const end = new EndActivity();
2425
- * await end.execute({});
2426
- * ```
2427
- */
2428
- declare class EndActivity extends Activity<Record<string, never>, void> {
2429
- constructor();
2430
- execute(input: Record<string, never>): Promise<_acorex_platform_core.AXPExecuteCommandResult<{
2431
- output: void;
2432
- outcomes: Record<string, any>;
2433
- }>>;
2434
- }
2435
-
2436
- /**
2437
- * Command setups for all built-in workflow activities.
2438
- * Registers activities as AXPCommand instances.
2439
- */
2440
- declare const provideWorkflowActivityCommands: () => i0.EnvironmentProviders;
2441
-
2442
- export { AXPActivityCategoryProviderService, AXPActivityProviderService, AXPWorkflowAction, AXPWorkflowContext, AXPWorkflowDefinitionRegistryService, AXPWorkflowDefinitionResolver, AXPWorkflowError, AXPWorkflowEventService, AXPWorkflowExecutionService, AXPWorkflowFunction, AXPWorkflowModule, AXPWorkflowRegistryService, AXPWorkflowService, AXP_ACTIVITY_CATEGORY_PROVIDER, AXP_ACTIVITY_PROVIDER, AXP_WORKFLOW_DEFINITION_LOADER, Activity, ActivityRegistry, DispatchEvent, EndActivity, ExecuteCommand, ExecuteQuery, ForEach, If, Navigate, Sequence, SetVariable, ShowAlertDialog, ShowConfirmDialog, ShowDialogLayoutBuilder, ShowToast, StartActivity, While, WorkflowCoordinator, WriteLine, createWorkFlowEvent, ofType, provideWorkflowActivityCommands };
2443
- 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, AXPWorkflowDefinitionJson, AXPWorkflowDefinitionLoader, AXPWorkflowDefinitionPreloader, AXPWorkflowEvent, AXPWorkflowExecutionState, AXPWorkflowFaultState, AXPWorkflowInputDefinition, AXPWorkflowInstance, AXPWorkflowModuleConfigs, AXPWorkflowNextStep, AXPWorkflowOptions, AXPWorkflowOutputDefinition, AXPWorkflowState, AXPWorkflowStatus, AXPWorkflowStep, AXPWorkflowSubStatus, AXPWorkflowTask, ActivityCategory, ActivityCategoryDescriptor, ActivityDescriptor, ActivityPropertyWidget, IActivity, InputDescriptor, OutputDescriptor, WorkflowExecutionResult };
1807
+ export { AXPActivityDefinitionService, AXPWorkflowAction, AXPWorkflowContext, AXPWorkflowDefinitionRegistryService, AXPWorkflowDefinitionResolver, AXPWorkflowError, AXPWorkflowEventService, AXPWorkflowExecutionService, AXPWorkflowFunction, AXPWorkflowModule, AXPWorkflowRegistryService, AXPWorkflowService, AXP_ACTIVITY_CATEGORY_PROVIDER, AXP_ACTIVITY_PROVIDER, AXP_WORKFLOW_DEFINITION_LOADER, WorkflowCoordinator, createWorkFlowEvent, ofType };
1808
+ export type { AXPActivity, AXPActivityCategory, AXPActivityCategoryProvider, AXPActivityCategoryProviderToken, AXPActivityDefinition, AXPActivityExecutionContextState, AXPActivityIncident, AXPActivityProvider, AXPActivityProviderToken, 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, AXPActivity$1 as AXPWorkflowActivity, AXPWorkflowCondition, AXPWorkflowConditionType, AXPWorkflowDefinition, AXPWorkflowDefinitionJson, AXPWorkflowDefinitionLoader, AXPWorkflowDefinitionPreloader, AXPWorkflowEvent, AXPWorkflowExecutionState, AXPWorkflowFaultState, AXPWorkflowInputDefinition, AXPWorkflowInstance, AXPWorkflowModuleConfigs, AXPWorkflowNextStep, AXPWorkflowOptions, AXPWorkflowOutputDefinition, AXPWorkflowState, AXPWorkflowStatus, AXPWorkflowStep, AXPWorkflowSubStatus, AXPWorkflowTask, ActivityPropertyWidget, InputDescriptor, OutputDescriptor, WorkflowExecutionResult };