@almadar/std 14.27.0 → 14.28.0

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.
Files changed (25) hide show
  1. package/behaviors/registry/app/atoms/std-approval-chain.orb +106 -0
  2. package/behaviors/registry/app/atoms/std-multi-party-transaction.orb +130 -0
  3. package/behaviors/registry/app/atoms/std-pipeline.orb +139 -0
  4. package/behaviors/registry/app/atoms/std-recurring-schedule.orb +94 -0
  5. package/behaviors/registry/app/atoms/std-timeline.orb +108 -0
  6. package/behaviors/registry/app/atoms/std-wizard-branching.orb +129 -0
  7. package/behaviors/registry/core/atoms/std-board.orb +1367 -0
  8. package/behaviors/registry/core/atoms/std-event-log.orb +777 -0
  9. package/behaviors/registry/core/atoms/std-multi-party-flow.orb +1313 -0
  10. package/behaviors/registry/core/atoms/std-recurrence.orb +937 -0
  11. package/behaviors/registry/core/atoms/std-step-flow.orb +1155 -0
  12. package/behaviors/registry/core/atoms/std-wizard.orb +1085 -0
  13. package/dist/behaviors/registry/app/atoms/std-approval-chain.orb +106 -0
  14. package/dist/behaviors/registry/app/atoms/std-multi-party-transaction.orb +130 -0
  15. package/dist/behaviors/registry/app/atoms/std-pipeline.orb +139 -0
  16. package/dist/behaviors/registry/app/atoms/std-recurring-schedule.orb +94 -0
  17. package/dist/behaviors/registry/app/atoms/std-timeline.orb +108 -0
  18. package/dist/behaviors/registry/app/atoms/std-wizard-branching.orb +129 -0
  19. package/dist/behaviors/registry/core/atoms/std-board.orb +1367 -0
  20. package/dist/behaviors/registry/core/atoms/std-event-log.orb +777 -0
  21. package/dist/behaviors/registry/core/atoms/std-multi-party-flow.orb +1313 -0
  22. package/dist/behaviors/registry/core/atoms/std-recurrence.orb +937 -0
  23. package/dist/behaviors/registry/core/atoms/std-step-flow.orb +1155 -0
  24. package/dist/behaviors/registry/core/atoms/std-wizard.orb +1085 -0
  25. package/package.json +1 -1
@@ -0,0 +1,1155 @@
1
+ {
2
+ "name": "std-step-flow",
3
+ "version": "2.0.0",
4
+ "description": "std-step-flow — generic N-step sequential decision chain (approval/review/sign-off). `config.steps` is an array of step definitions; @entity.currentStepIndex walks through them; ADVANCE self-loops to the next step, COMPLETE/REJECT/ESCALATE terminate. Topology = loading / running / approved / rejected / escalated / error — the running state owns N via data, not states.",
5
+ "orbitals": [
6
+ {
7
+ "name": "StepFlowOrbital",
8
+ "entity": {
9
+ "name": "StepFlowView",
10
+ "persistence": "runtime",
11
+ "fields": [
12
+ {
13
+ "name": "id",
14
+ "type": "string",
15
+ "required": true
16
+ },
17
+ {
18
+ "name": "steps",
19
+ "type": "array",
20
+ "default": [],
21
+ "items": {
22
+ "type": "object",
23
+ "properties": {
24
+ "description": {
25
+ "name": "description",
26
+ "type": "string"
27
+ },
28
+ "key": {
29
+ "name": "key",
30
+ "type": "string"
31
+ },
32
+ "label": {
33
+ "name": "label",
34
+ "type": "string"
35
+ },
36
+ "icon": {
37
+ "name": "icon",
38
+ "type": "string"
39
+ },
40
+ "number": {
41
+ "name": "number",
42
+ "type": "number"
43
+ },
44
+ "status": {
45
+ "name": "status",
46
+ "type": "string",
47
+ "values": [
48
+ "pending",
49
+ "current",
50
+ "approved"
51
+ ]
52
+ }
53
+ }
54
+ }
55
+ },
56
+ {
57
+ "name": "currentStepIndex",
58
+ "type": "number",
59
+ "default": 0.0
60
+ },
61
+ {
62
+ "name": "totalSteps",
63
+ "type": "number",
64
+ "default": 0.0
65
+ },
66
+ {
67
+ "name": "finalStatus",
68
+ "type": "string",
69
+ "default": "",
70
+ "values": [
71
+ "approved",
72
+ "rejected",
73
+ "escalated",
74
+ ""
75
+ ]
76
+ },
77
+ {
78
+ "name": "rejectionReason",
79
+ "type": "string",
80
+ "default": ""
81
+ },
82
+ {
83
+ "name": "errorMessage",
84
+ "type": "string",
85
+ "default": ""
86
+ }
87
+ ]
88
+ },
89
+ "traits": [
90
+ {
91
+ "name": "StepFlowReview",
92
+ "category": "interaction",
93
+ "linkedEntity": "StepFlowView",
94
+ "emits": [
95
+ {
96
+ "event": "ADVANCE",
97
+ "payloadSchema": [
98
+ {
99
+ "name": "id",
100
+ "type": "string"
101
+ },
102
+ {
103
+ "name": "stepKey",
104
+ "type": "string"
105
+ }
106
+ ]
107
+ },
108
+ {
109
+ "event": "COMPLETE",
110
+ "payloadSchema": [
111
+ {
112
+ "name": "id",
113
+ "type": "string"
114
+ }
115
+ ]
116
+ },
117
+ {
118
+ "event": "REJECT",
119
+ "payloadSchema": [
120
+ {
121
+ "name": "id",
122
+ "type": "string"
123
+ },
124
+ {
125
+ "name": "reason",
126
+ "type": "string"
127
+ }
128
+ ]
129
+ },
130
+ {
131
+ "event": "ESCALATE",
132
+ "payloadSchema": [
133
+ {
134
+ "name": "id",
135
+ "type": "string"
136
+ },
137
+ {
138
+ "name": "reason",
139
+ "type": "string"
140
+ }
141
+ ]
142
+ },
143
+ {
144
+ "event": "RESTART",
145
+ "payloadSchema": [
146
+ {
147
+ "name": "id",
148
+ "type": "string"
149
+ }
150
+ ]
151
+ },
152
+ {
153
+ "event": "StepItemsLoaded",
154
+ "payloadSchema": [
155
+ {
156
+ "name": "data",
157
+ "type": "[object]"
158
+ }
159
+ ]
160
+ },
161
+ {
162
+ "event": "StepItemsLoadFailed",
163
+ "payloadSchema": [
164
+ {
165
+ "name": "error",
166
+ "type": "string"
167
+ },
168
+ {
169
+ "name": "code",
170
+ "type": "string"
171
+ }
172
+ ]
173
+ }
174
+ ],
175
+ "stateMachine": {
176
+ "states": [
177
+ {
178
+ "name": "loading",
179
+ "isInitial": true
180
+ },
181
+ {
182
+ "name": "running"
183
+ },
184
+ {
185
+ "name": "approved"
186
+ },
187
+ {
188
+ "name": "rejected"
189
+ },
190
+ {
191
+ "name": "escalated"
192
+ },
193
+ {
194
+ "name": "error"
195
+ }
196
+ ],
197
+ "events": [
198
+ {
199
+ "key": "INIT",
200
+ "name": "Initialize"
201
+ },
202
+ {
203
+ "key": "StepItemsLoaded",
204
+ "name": "Step items loaded",
205
+ "payloadSchema": [
206
+ {
207
+ "name": "data",
208
+ "type": "[object]"
209
+ }
210
+ ]
211
+ },
212
+ {
213
+ "key": "StepItemsLoadFailed",
214
+ "name": "Step items load failed",
215
+ "payloadSchema": [
216
+ {
217
+ "name": "error",
218
+ "type": "string"
219
+ },
220
+ {
221
+ "name": "code",
222
+ "type": "string"
223
+ }
224
+ ]
225
+ },
226
+ {
227
+ "key": "StepItemsSaved",
228
+ "name": "Step items saved",
229
+ "payloadSchema": [
230
+ {
231
+ "name": "row",
232
+ "type": "object"
233
+ }
234
+ ]
235
+ },
236
+ {
237
+ "key": "StepItemsSaveFailed",
238
+ "name": "Step items save failed",
239
+ "payloadSchema": [
240
+ {
241
+ "name": "error",
242
+ "type": "string"
243
+ },
244
+ {
245
+ "name": "code",
246
+ "type": "string"
247
+ }
248
+ ]
249
+ },
250
+ {
251
+ "key": "ADVANCE",
252
+ "name": "Advance",
253
+ "payloadSchema": [
254
+ {
255
+ "name": "id",
256
+ "type": "string"
257
+ },
258
+ {
259
+ "name": "stepKey",
260
+ "type": "string"
261
+ }
262
+ ]
263
+ },
264
+ {
265
+ "key": "COMPLETE",
266
+ "name": "Complete",
267
+ "payloadSchema": [
268
+ {
269
+ "name": "id",
270
+ "type": "string"
271
+ }
272
+ ]
273
+ },
274
+ {
275
+ "key": "REJECT",
276
+ "name": "Reject",
277
+ "payloadSchema": [
278
+ {
279
+ "name": "id",
280
+ "type": "string"
281
+ },
282
+ {
283
+ "name": "reason",
284
+ "type": "string"
285
+ }
286
+ ]
287
+ },
288
+ {
289
+ "key": "ESCALATE",
290
+ "name": "Escalate",
291
+ "payloadSchema": [
292
+ {
293
+ "name": "id",
294
+ "type": "string"
295
+ },
296
+ {
297
+ "name": "reason",
298
+ "type": "string"
299
+ }
300
+ ]
301
+ },
302
+ {
303
+ "key": "RESTART",
304
+ "name": "Restart",
305
+ "payloadSchema": [
306
+ {
307
+ "name": "id",
308
+ "type": "string"
309
+ }
310
+ ]
311
+ }
312
+ ],
313
+ "transitions": [
314
+ {
315
+ "from": "loading",
316
+ "to": "loading",
317
+ "event": "INIT",
318
+ "effects": [
319
+ [
320
+ "fetch",
321
+ "StepFlowView",
322
+ {
323
+ "emit": {
324
+ "failure": "StepItemsLoadFailed",
325
+ "success": "StepItemsLoaded"
326
+ }
327
+ }
328
+ ],
329
+ [
330
+ "render-ui",
331
+ "main",
332
+ {
333
+ "title": "Loading review…",
334
+ "type": "loading-state"
335
+ }
336
+ ]
337
+ ]
338
+ },
339
+ {
340
+ "from": "loading",
341
+ "to": "running",
342
+ "event": "StepItemsLoaded",
343
+ "effects": [
344
+ [
345
+ "set",
346
+ "@entity.currentStepIndex",
347
+ 0.0
348
+ ],
349
+ [
350
+ "set",
351
+ "@entity.totalSteps",
352
+ [
353
+ "array/len",
354
+ "@config.steps"
355
+ ]
356
+ ],
357
+ [
358
+ "set",
359
+ "@entity.steps",
360
+ [
361
+ "array/map",
362
+ "@config.steps",
363
+ [
364
+ "fn",
365
+ "step",
366
+ {
367
+ "key": [
368
+ "object/get",
369
+ "@step",
370
+ "key"
371
+ ],
372
+ "label": [
373
+ "object/get",
374
+ "@step",
375
+ "label"
376
+ ],
377
+ "icon": [
378
+ "object/get",
379
+ "@step",
380
+ "icon",
381
+ "user"
382
+ ],
383
+ "number": 1.0,
384
+ "description": [
385
+ "object/get",
386
+ "@step",
387
+ "description",
388
+ ""
389
+ ],
390
+ "status": "current"
391
+ }
392
+ ]
393
+ ]
394
+ ],
395
+ [
396
+ "render-ui",
397
+ "main",
398
+ {
399
+ "children": [
400
+ {
401
+ "direction": "horizontal",
402
+ "type": "stack",
403
+ "align": "center",
404
+ "children": [
405
+ {
406
+ "name": "shield-check",
407
+ "type": "icon"
408
+ },
409
+ {
410
+ "type": "typography",
411
+ "content": "@config.title",
412
+ "variant": "h3"
413
+ }
414
+ ],
415
+ "gap": "sm"
416
+ },
417
+ {
418
+ "type": "divider"
419
+ },
420
+ {
421
+ "gap": "sm",
422
+ "fields": [],
423
+ "entity": "@entity.steps",
424
+ "type": "data-list",
425
+ "renderItem": [
426
+ "fn",
427
+ "step",
428
+ {
429
+ "type": "card",
430
+ "children": [
431
+ {
432
+ "children": [
433
+ {
434
+ "type": "icon",
435
+ "name": "@step.icon"
436
+ },
437
+ {
438
+ "gap": "xs",
439
+ "type": "stack",
440
+ "direction": "vertical",
441
+ "children": [
442
+ {
443
+ "content": "@step.label",
444
+ "type": "typography",
445
+ "variant": "h4"
446
+ },
447
+ {
448
+ "variant": "caption",
449
+ "content": "@step.description",
450
+ "type": "typography",
451
+ "color": "muted"
452
+ }
453
+ ]
454
+ },
455
+ {
456
+ "variant": "primary",
457
+ "type": "badge",
458
+ "label": "@step.status"
459
+ }
460
+ ],
461
+ "align": "center",
462
+ "type": "stack",
463
+ "direction": "horizontal",
464
+ "gap": "sm"
465
+ }
466
+ ]
467
+ }
468
+ ]
469
+ },
470
+ {
471
+ "direction": "horizontal",
472
+ "gap": "sm",
473
+ "type": "stack",
474
+ "children": [
475
+ {
476
+ "action": "ADVANCE",
477
+ "variant": "primary",
478
+ "type": "button",
479
+ "label": "Approve Step",
480
+ "icon": "check"
481
+ },
482
+ {
483
+ "icon": "check-circle",
484
+ "label": "Finalize Approval",
485
+ "action": "COMPLETE",
486
+ "type": "button",
487
+ "variant": "success"
488
+ },
489
+ {
490
+ "label": "Reject",
491
+ "variant": "danger",
492
+ "type": "button",
493
+ "action": "REJECT",
494
+ "icon": "x"
495
+ },
496
+ {
497
+ "variant": "secondary",
498
+ "type": "button",
499
+ "action": "ESCALATE",
500
+ "icon": "alert-triangle",
501
+ "label": "Escalate"
502
+ }
503
+ ],
504
+ "align": "center"
505
+ }
506
+ ],
507
+ "direction": "vertical",
508
+ "gap": "md",
509
+ "type": "stack"
510
+ }
511
+ ]
512
+ ]
513
+ },
514
+ {
515
+ "from": "loading",
516
+ "to": "error",
517
+ "event": "StepItemsLoadFailed",
518
+ "effects": [
519
+ [
520
+ "set",
521
+ "@entity.errorMessage",
522
+ "@payload.error"
523
+ ],
524
+ [
525
+ "render-ui",
526
+ "main",
527
+ {
528
+ "title": "Failed to load",
529
+ "type": "error-state",
530
+ "message": "@entity.errorMessage"
531
+ }
532
+ ]
533
+ ]
534
+ },
535
+ {
536
+ "from": "loading",
537
+ "to": "running",
538
+ "event": "StepItemsSaved",
539
+ "effects": [
540
+ [
541
+ "render-ui",
542
+ "main",
543
+ {
544
+ "title": "Refreshing…",
545
+ "type": "loading-state"
546
+ }
547
+ ]
548
+ ]
549
+ },
550
+ {
551
+ "from": "loading",
552
+ "to": "error",
553
+ "event": "StepItemsSaveFailed",
554
+ "effects": [
555
+ [
556
+ "set",
557
+ "@entity.errorMessage",
558
+ "@payload.error"
559
+ ],
560
+ [
561
+ "render-ui",
562
+ "main",
563
+ {
564
+ "type": "error-state",
565
+ "title": "Save failed",
566
+ "message": "@entity.errorMessage"
567
+ }
568
+ ]
569
+ ]
570
+ },
571
+ {
572
+ "from": "running",
573
+ "to": "running",
574
+ "event": "ADVANCE",
575
+ "effects": [
576
+ [
577
+ "set",
578
+ "@entity.currentStepIndex",
579
+ [
580
+ "+",
581
+ "@entity.currentStepIndex",
582
+ 1.0
583
+ ]
584
+ ],
585
+ [
586
+ "set",
587
+ "@entity.steps",
588
+ [
589
+ "array/map",
590
+ "@config.steps",
591
+ [
592
+ "fn",
593
+ "step",
594
+ {
595
+ "label": [
596
+ "object/get",
597
+ "@step",
598
+ "label"
599
+ ],
600
+ "icon": [
601
+ "object/get",
602
+ "@step",
603
+ "icon",
604
+ "user"
605
+ ],
606
+ "key": [
607
+ "object/get",
608
+ "@step",
609
+ "key"
610
+ ],
611
+ "number": 1.0,
612
+ "status": "current",
613
+ "description": [
614
+ "object/get",
615
+ "@step",
616
+ "description",
617
+ ""
618
+ ]
619
+ }
620
+ ]
621
+ ]
622
+ ],
623
+ [
624
+ "render-ui",
625
+ "main",
626
+ {
627
+ "type": "stack",
628
+ "direction": "vertical",
629
+ "children": [
630
+ {
631
+ "align": "center",
632
+ "children": [
633
+ {
634
+ "name": "shield-check",
635
+ "type": "icon"
636
+ },
637
+ {
638
+ "variant": "h3",
639
+ "type": "typography",
640
+ "content": "@config.title"
641
+ }
642
+ ],
643
+ "gap": "sm",
644
+ "direction": "horizontal",
645
+ "type": "stack"
646
+ },
647
+ {
648
+ "type": "divider"
649
+ },
650
+ {
651
+ "type": "data-list",
652
+ "gap": "sm",
653
+ "fields": [],
654
+ "renderItem": [
655
+ "fn",
656
+ "step",
657
+ {
658
+ "type": "card",
659
+ "children": [
660
+ {
661
+ "type": "stack",
662
+ "direction": "horizontal",
663
+ "align": "center",
664
+ "children": [
665
+ {
666
+ "name": "@step.icon",
667
+ "type": "icon"
668
+ },
669
+ {
670
+ "gap": "xs",
671
+ "direction": "vertical",
672
+ "children": [
673
+ {
674
+ "variant": "h4",
675
+ "type": "typography",
676
+ "content": "@step.label"
677
+ },
678
+ {
679
+ "type": "typography",
680
+ "color": "muted",
681
+ "content": "@step.description",
682
+ "variant": "caption"
683
+ }
684
+ ],
685
+ "type": "stack"
686
+ },
687
+ {
688
+ "variant": "primary",
689
+ "label": "@step.status",
690
+ "type": "badge"
691
+ }
692
+ ],
693
+ "gap": "sm"
694
+ }
695
+ ]
696
+ }
697
+ ],
698
+ "entity": "@entity.steps"
699
+ },
700
+ {
701
+ "gap": "sm",
702
+ "direction": "horizontal",
703
+ "type": "stack",
704
+ "children": [
705
+ {
706
+ "type": "button",
707
+ "variant": "primary",
708
+ "icon": "check",
709
+ "label": "Approve Step",
710
+ "action": "ADVANCE"
711
+ },
712
+ {
713
+ "label": "Finalize Approval",
714
+ "icon": "check-circle",
715
+ "action": "COMPLETE",
716
+ "type": "button",
717
+ "variant": "success"
718
+ },
719
+ {
720
+ "icon": "x",
721
+ "variant": "danger",
722
+ "type": "button",
723
+ "action": "REJECT",
724
+ "label": "Reject"
725
+ },
726
+ {
727
+ "icon": "alert-triangle",
728
+ "variant": "secondary",
729
+ "label": "Escalate",
730
+ "action": "ESCALATE",
731
+ "type": "button"
732
+ }
733
+ ],
734
+ "align": "center"
735
+ }
736
+ ],
737
+ "gap": "md"
738
+ }
739
+ ]
740
+ ]
741
+ },
742
+ {
743
+ "from": "running",
744
+ "to": "approved",
745
+ "event": "COMPLETE",
746
+ "effects": [
747
+ [
748
+ "set",
749
+ "@entity.finalStatus",
750
+ "approved"
751
+ ],
752
+ [
753
+ "set",
754
+ "@entity.steps",
755
+ [
756
+ "array/map",
757
+ "@config.steps",
758
+ [
759
+ "fn",
760
+ "step",
761
+ {
762
+ "label": [
763
+ "object/get",
764
+ "@step",
765
+ "label"
766
+ ],
767
+ "icon": [
768
+ "object/get",
769
+ "@step",
770
+ "icon",
771
+ "user"
772
+ ],
773
+ "status": "approved",
774
+ "key": [
775
+ "object/get",
776
+ "@step",
777
+ "key"
778
+ ],
779
+ "description": [
780
+ "object/get",
781
+ "@step",
782
+ "description",
783
+ ""
784
+ ],
785
+ "number": 1.0
786
+ }
787
+ ]
788
+ ]
789
+ ],
790
+ [
791
+ "render-ui",
792
+ "main",
793
+ {
794
+ "direction": "vertical",
795
+ "children": [
796
+ {
797
+ "gap": "sm",
798
+ "type": "stack",
799
+ "children": [
800
+ {
801
+ "type": "icon",
802
+ "name": "check-circle"
803
+ },
804
+ {
805
+ "variant": "h3",
806
+ "type": "typography",
807
+ "content": "Approved"
808
+ }
809
+ ],
810
+ "direction": "horizontal",
811
+ "align": "center"
812
+ },
813
+ {
814
+ "type": "divider"
815
+ },
816
+ {
817
+ "type": "data-list",
818
+ "entity": "@entity.steps",
819
+ "fields": [],
820
+ "renderItem": [
821
+ "fn",
822
+ "step",
823
+ {
824
+ "children": [
825
+ {
826
+ "children": [
827
+ {
828
+ "name": "@step.icon",
829
+ "type": "icon"
830
+ },
831
+ {
832
+ "direction": "vertical",
833
+ "type": "stack",
834
+ "children": [
835
+ {
836
+ "content": "@step.label",
837
+ "variant": "h4",
838
+ "type": "typography"
839
+ },
840
+ {
841
+ "color": "muted",
842
+ "content": "@step.description",
843
+ "type": "typography",
844
+ "variant": "caption"
845
+ }
846
+ ],
847
+ "gap": "xs"
848
+ },
849
+ {
850
+ "type": "badge",
851
+ "variant": "success",
852
+ "label": "@step.status"
853
+ }
854
+ ],
855
+ "gap": "sm",
856
+ "type": "stack",
857
+ "direction": "horizontal",
858
+ "align": "center"
859
+ }
860
+ ],
861
+ "type": "card"
862
+ }
863
+ ],
864
+ "gap": "sm"
865
+ },
866
+ {
867
+ "variant": "secondary",
868
+ "action": "RESTART",
869
+ "type": "button",
870
+ "label": "Restart",
871
+ "icon": "rotate-ccw"
872
+ }
873
+ ],
874
+ "type": "stack",
875
+ "gap": "md"
876
+ }
877
+ ]
878
+ ]
879
+ },
880
+ {
881
+ "from": "running",
882
+ "to": "rejected",
883
+ "event": "REJECT",
884
+ "effects": [
885
+ [
886
+ "set",
887
+ "@entity.finalStatus",
888
+ "rejected"
889
+ ],
890
+ [
891
+ "set",
892
+ "@entity.rejectionReason",
893
+ "@payload.reason"
894
+ ],
895
+ [
896
+ "render-ui",
897
+ "main",
898
+ {
899
+ "type": "stack",
900
+ "direction": "vertical",
901
+ "gap": "md",
902
+ "children": [
903
+ {
904
+ "type": "stack",
905
+ "direction": "horizontal",
906
+ "children": [
907
+ {
908
+ "name": "x-circle",
909
+ "type": "icon"
910
+ },
911
+ {
912
+ "variant": "h3",
913
+ "type": "typography",
914
+ "content": "Rejected"
915
+ }
916
+ ],
917
+ "gap": "sm",
918
+ "align": "center"
919
+ },
920
+ {
921
+ "type": "divider"
922
+ },
923
+ {
924
+ "type": "card",
925
+ "children": [
926
+ {
927
+ "gap": "sm",
928
+ "type": "stack",
929
+ "children": [
930
+ {
931
+ "variant": "caption",
932
+ "type": "typography",
933
+ "color": "muted",
934
+ "content": "Reason"
935
+ },
936
+ {
937
+ "variant": "body",
938
+ "content": "@entity.rejectionReason",
939
+ "type": "typography"
940
+ }
941
+ ],
942
+ "direction": "vertical"
943
+ }
944
+ ]
945
+ },
946
+ {
947
+ "action": "RESTART",
948
+ "type": "button",
949
+ "label": "Restart",
950
+ "variant": "secondary",
951
+ "icon": "rotate-ccw"
952
+ }
953
+ ]
954
+ }
955
+ ]
956
+ ]
957
+ },
958
+ {
959
+ "from": "running",
960
+ "to": "escalated",
961
+ "event": "ESCALATE",
962
+ "effects": [
963
+ [
964
+ "set",
965
+ "@entity.finalStatus",
966
+ "escalated"
967
+ ],
968
+ [
969
+ "render-ui",
970
+ "main",
971
+ {
972
+ "type": "stack",
973
+ "gap": "md",
974
+ "direction": "vertical",
975
+ "children": [
976
+ {
977
+ "gap": "sm",
978
+ "direction": "horizontal",
979
+ "children": [
980
+ {
981
+ "type": "icon",
982
+ "name": "alert-triangle"
983
+ },
984
+ {
985
+ "content": "Escalated",
986
+ "type": "typography",
987
+ "variant": "h3"
988
+ }
989
+ ],
990
+ "type": "stack",
991
+ "align": "center"
992
+ },
993
+ {
994
+ "type": "divider"
995
+ },
996
+ {
997
+ "variant": "body",
998
+ "content": "This item has been escalated for further review.",
999
+ "type": "typography"
1000
+ },
1001
+ {
1002
+ "variant": "secondary",
1003
+ "label": "Restart",
1004
+ "action": "RESTART",
1005
+ "icon": "rotate-ccw",
1006
+ "type": "button"
1007
+ }
1008
+ ]
1009
+ }
1010
+ ]
1011
+ ]
1012
+ },
1013
+ {
1014
+ "from": "approved",
1015
+ "to": "loading",
1016
+ "event": "RESTART",
1017
+ "effects": [
1018
+ [
1019
+ "set",
1020
+ "@entity.finalStatus",
1021
+ ""
1022
+ ],
1023
+ [
1024
+ "set",
1025
+ "@entity.currentStepIndex",
1026
+ 0.0
1027
+ ],
1028
+ [
1029
+ "render-ui",
1030
+ "main",
1031
+ {
1032
+ "title": "Restarting…",
1033
+ "type": "loading-state"
1034
+ }
1035
+ ]
1036
+ ]
1037
+ },
1038
+ {
1039
+ "from": "rejected",
1040
+ "to": "loading",
1041
+ "event": "RESTART",
1042
+ "effects": [
1043
+ [
1044
+ "set",
1045
+ "@entity.finalStatus",
1046
+ ""
1047
+ ],
1048
+ [
1049
+ "set",
1050
+ "@entity.currentStepIndex",
1051
+ 0.0
1052
+ ],
1053
+ [
1054
+ "set",
1055
+ "@entity.rejectionReason",
1056
+ ""
1057
+ ],
1058
+ [
1059
+ "render-ui",
1060
+ "main",
1061
+ {
1062
+ "title": "Restarting…",
1063
+ "type": "loading-state"
1064
+ }
1065
+ ]
1066
+ ]
1067
+ },
1068
+ {
1069
+ "from": "escalated",
1070
+ "to": "loading",
1071
+ "event": "RESTART",
1072
+ "effects": [
1073
+ [
1074
+ "set",
1075
+ "@entity.finalStatus",
1076
+ ""
1077
+ ],
1078
+ [
1079
+ "set",
1080
+ "@entity.currentStepIndex",
1081
+ 0.0
1082
+ ],
1083
+ [
1084
+ "render-ui",
1085
+ "main",
1086
+ {
1087
+ "type": "loading-state",
1088
+ "title": "Restarting…"
1089
+ }
1090
+ ]
1091
+ ]
1092
+ },
1093
+ {
1094
+ "from": "error",
1095
+ "to": "loading",
1096
+ "event": "INIT",
1097
+ "effects": [
1098
+ [
1099
+ "render-ui",
1100
+ "main",
1101
+ {
1102
+ "type": "loading-state",
1103
+ "title": "Retrying…"
1104
+ }
1105
+ ]
1106
+ ]
1107
+ }
1108
+ ]
1109
+ },
1110
+ "config": {
1111
+ "steps": {
1112
+ "type": "[object]",
1113
+ "default": [
1114
+ {
1115
+ "label": "Manager Review",
1116
+ "description": "Initial review by direct manager",
1117
+ "key": "manager",
1118
+ "icon": "user"
1119
+ },
1120
+ {
1121
+ "label": "Director Approval",
1122
+ "description": "Department director sign-off",
1123
+ "icon": "users",
1124
+ "key": "director"
1125
+ },
1126
+ {
1127
+ "key": "executive",
1128
+ "label": "Executive Sign-off",
1129
+ "description": "Final executive approval",
1130
+ "icon": "shield"
1131
+ }
1132
+ ]
1133
+ },
1134
+ "title": {
1135
+ "type": "string",
1136
+ "default": "Review"
1137
+ }
1138
+ },
1139
+ "scope": "instance"
1140
+ }
1141
+ ],
1142
+ "pages": [
1143
+ {
1144
+ "name": "StepFlowPage",
1145
+ "path": "/step-flow",
1146
+ "traits": [
1147
+ {
1148
+ "ref": "StepFlowReview"
1149
+ }
1150
+ ]
1151
+ }
1152
+ ]
1153
+ }
1154
+ ]
1155
+ }