@digicatapult/sqnc-process-management 2.2.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 (32) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +213 -0
  3. package/build/package.json +64 -0
  4. package/build/src/index.d.ts +2 -0
  5. package/build/src/index.js +127 -0
  6. package/build/src/lib/process/_tests_/unit.test.d.ts +1 -0
  7. package/build/src/lib/process/_tests_/unit.test.js +112 -0
  8. package/build/src/lib/process/api.d.ts +7 -0
  9. package/build/src/lib/process/api.js +112 -0
  10. package/build/src/lib/process/constants.d.ts +3 -0
  11. package/build/src/lib/process/constants.js +3 -0
  12. package/build/src/lib/process/hex.d.ts +2 -0
  13. package/build/src/lib/process/hex.js +9 -0
  14. package/build/src/lib/process/index.d.ts +21 -0
  15. package/build/src/lib/process/index.js +205 -0
  16. package/build/src/lib/types/error.d.ts +14 -0
  17. package/build/src/lib/types/error.js +26 -0
  18. package/build/src/lib/types/validation.d.ts +5472 -0
  19. package/build/src/lib/types/validation.js +128 -0
  20. package/build/src/lib/utils/polkadot.d.ts +1 -0
  21. package/build/src/lib/utils/polkadot.js +25 -0
  22. package/build/src/version.d.ts +2 -0
  23. package/build/src/version.js +3 -0
  24. package/build/tests/fixtures/processes.d.ts +281 -0
  25. package/build/tests/fixtures/processes.js +1066 -0
  26. package/build/tests/fixtures/programs.d.ts +14 -0
  27. package/build/tests/fixtures/programs.js +211 -0
  28. package/build/tests/helpers/substrateHelper.d.ts +2 -0
  29. package/build/tests/helpers/substrateHelper.js +25 -0
  30. package/build/tests/integration/command-functions.test.d.ts +1 -0
  31. package/build/tests/integration/command-functions.test.js +327 -0
  32. package/package.json +64 -0
@@ -0,0 +1,1066 @@
1
+ export default [
2
+ {
3
+ "name": "test-program-create",
4
+ "version": 1,
5
+ "program": [
6
+ {
7
+ "Restriction": {
8
+ "FixedNumberOfInputs": {
9
+ "num_inputs": 0
10
+ }
11
+ }
12
+ },
13
+ {
14
+ "Restriction": {
15
+ "FixedNumberOfOutputs": {
16
+ "num_outputs": 1
17
+ }
18
+ }
19
+ },
20
+ { "Op": "And" },
21
+ {
22
+ "Restriction": {
23
+ "FixedOutputMetadataValue": {
24
+ "index": 0,
25
+ "metadata_key": "type",
26
+ "metadata_value": {
27
+ "Literal": "DEMAND"
28
+ }
29
+ }
30
+ }
31
+ },
32
+ { "Op": "And" },
33
+ {
34
+ "Restriction": {
35
+ "FixedOutputMetadataValue": {
36
+ "index": 0,
37
+ "metadata_key": "version",
38
+ "metadata_value": {
39
+ "Literal": "1"
40
+ }
41
+ }
42
+ }
43
+ },
44
+ { "Op": "And" },
45
+ {
46
+ "Restriction": {
47
+ "FixedOutputMetadataValue": {
48
+ "index": 0,
49
+ "metadata_key": "state",
50
+ "metadata_value": {
51
+ "Literal": "created"
52
+ }
53
+ }
54
+ }
55
+ },
56
+ { "Op": "And" },
57
+ {
58
+ "Restriction": {
59
+ "FixedOutputMetadataValueType": {
60
+ "index": 0,
61
+ "metadata_key": "parameters",
62
+ "metadata_value_type": "File"
63
+ }
64
+ }
65
+ },
66
+ { "Op": "And" },
67
+ {
68
+ "Restriction": {
69
+ "FixedOutputMetadataValue": {
70
+ "index": 0,
71
+ "metadata_key": "subtype",
72
+ "metadata_value": {
73
+ "Literal": "demand_a"
74
+ }
75
+ }
76
+ }
77
+ },
78
+ {
79
+ "Restriction": {
80
+ "FixedOutputMetadataValue": {
81
+ "index": 0,
82
+ "metadata_key": "subtype",
83
+ "metadata_value": {
84
+ "Literal": "demand_b"
85
+ }
86
+ }
87
+ }
88
+ },
89
+ { "Op": "Or" },
90
+ { "Op": "And" },
91
+ {
92
+ "Restriction": {
93
+ "OutputHasMetadata": {
94
+ "index": 0,
95
+ "metadata_key": "originalId"
96
+ }
97
+ }
98
+ },
99
+ {
100
+ "Restriction": "None"
101
+ },
102
+ { "Op": "NotL" },
103
+ { "Op": "And" },
104
+ {
105
+ "Restriction": {
106
+ "SenderHasOutputRole": {
107
+ "index": 0,
108
+ "role_key": "Owner"
109
+ }
110
+ }
111
+ },
112
+ { "Op": "And" }
113
+ ]
114
+ },
115
+ {
116
+ "name": "test-program-propose",
117
+ "version": 1,
118
+ "program": [
119
+ {
120
+ "Restriction": {
121
+ "FixedNumberOfInputs": {
122
+ "num_inputs": 2
123
+ }
124
+ }
125
+ },
126
+ {
127
+ "Restriction": {
128
+ "FixedNumberOfOutputs": {
129
+ "num_outputs": 3
130
+ }
131
+ }
132
+ },
133
+ { "Op": "And" },
134
+ {
135
+ "Restriction": {
136
+ "FixedInputMetadataValue": {
137
+ "index": 0,
138
+ "metadata_key": "type",
139
+ "metadata_value": {
140
+ "Literal": "DEMAND"
141
+ }
142
+ }
143
+ }
144
+ },
145
+ { "Op": "And" },
146
+ {
147
+ "Restriction": {
148
+ "FixedInputMetadataValue": {
149
+ "index": 0,
150
+ "metadata_key": "version",
151
+ "metadata_value": {
152
+ "Literal": "1"
153
+ }
154
+ }
155
+ }
156
+ },
157
+ { "Op": "And" },
158
+ {
159
+ "Restriction": {
160
+ "FixedInputMetadataValue": {
161
+ "index": 0,
162
+ "metadata_key": "subtype",
163
+ "metadata_value": {
164
+ "Literal": "demand_a"
165
+ }
166
+ }
167
+ }
168
+ },
169
+ { "Op": "And" },
170
+ {
171
+ "Restriction": {
172
+ "FixedInputMetadataValue": {
173
+ "index": 0,
174
+ "metadata_key": "state",
175
+ "metadata_value": {
176
+ "Literal": "created"
177
+ }
178
+ }
179
+ }
180
+ },
181
+ { "Op": "And" },
182
+ {
183
+ "Restriction": {
184
+ "MatchInputOutputMetadataValue": {
185
+ "input_index": 0,
186
+ "input_metadata_key": "type",
187
+ "output_index": 0,
188
+ "output_metadata_key": "type"
189
+ }
190
+ }
191
+ },
192
+ { "Op": "And" },
193
+ {
194
+ "Restriction": {
195
+ "MatchInputOutputMetadataValue": {
196
+ "input_index": 0,
197
+ "input_metadata_key": "version",
198
+ "output_index": 0,
199
+ "output_metadata_key": "version"
200
+ }
201
+ }
202
+ },
203
+ { "Op": "And" },
204
+ {
205
+ "Restriction": {
206
+ "MatchInputOutputMetadataValue": {
207
+ "input_index": 0,
208
+ "input_metadata_key": "subtype",
209
+ "output_index": 0,
210
+ "output_metadata_key": "subtype"
211
+ }
212
+ }
213
+ },
214
+ { "Op": "And" },
215
+ {
216
+ "Restriction": {
217
+ "MatchInputOutputMetadataValue": {
218
+ "input_index": 0,
219
+ "input_metadata_key": "state",
220
+ "output_index": 0,
221
+ "output_metadata_key": "state"
222
+ }
223
+ }
224
+ },
225
+ { "Op": "And" },
226
+ {
227
+ "Restriction": {
228
+ "MatchInputOutputRole": {
229
+ "input_index": 0,
230
+ "input_role_key": "Owner",
231
+ "output_index": 0,
232
+ "output_role_key": "Owner"
233
+ }
234
+ }
235
+ },
236
+ { "Op": "And" },
237
+ {
238
+ "Restriction": {
239
+ "MatchInputOutputMetadataValue": {
240
+ "input_index": 0,
241
+ "input_metadata_key": "originalId",
242
+ "output_index": 0,
243
+ "output_metadata_key": "originalId"
244
+ }
245
+ }
246
+ },
247
+ {
248
+ "Restriction": {
249
+ "InputHasMetadata": {
250
+ "index": 0,
251
+ "metadata_key": "originalId"
252
+ }
253
+ }
254
+ },
255
+ {
256
+ "Restriction": "None"
257
+ },
258
+ { "Op": "NotL" },
259
+ {
260
+ "Restriction": {
261
+ "MatchInputIdOutputMetadataValue": {
262
+ "input_index": 0,
263
+ "output_index": 0,
264
+ "output_metadata_key": "originalId"
265
+ }
266
+ }
267
+ },
268
+ { "Op": "And" },
269
+ { "Op": "Or" },
270
+ { "Op": "And" },
271
+ {
272
+ "Restriction": {
273
+ "FixedInputMetadataValue": {
274
+ "index": 1,
275
+ "metadata_key": "type",
276
+ "metadata_value": {
277
+ "Literal": "DEMAND"
278
+ }
279
+ }
280
+ }
281
+ },
282
+ { "Op": "And" },
283
+ {
284
+ "Restriction": {
285
+ "FixedInputMetadataValue": {
286
+ "index": 1,
287
+ "metadata_key": "version",
288
+ "metadata_value": {
289
+ "Literal": "1"
290
+ }
291
+ }
292
+ }
293
+ },
294
+ { "Op": "And" },
295
+ {
296
+ "Restriction": {
297
+ "FixedInputMetadataValue": {
298
+ "index": 1,
299
+ "metadata_key": "subtype",
300
+ "metadata_value": {
301
+ "Literal": "demand_b"
302
+ }
303
+ }
304
+ }
305
+ },
306
+ { "Op": "And" },
307
+ {
308
+ "Restriction": {
309
+ "FixedInputMetadataValue": {
310
+ "index": 1,
311
+ "metadata_key": "state",
312
+ "metadata_value": {
313
+ "Literal": "created"
314
+ }
315
+ }
316
+ }
317
+ },
318
+ { "Op": "And" },
319
+ {
320
+ "Restriction": {
321
+ "MatchInputOutputMetadataValue": {
322
+ "input_index": 1,
323
+ "input_metadata_key": "type",
324
+ "output_index": 1,
325
+ "output_metadata_key": "type"
326
+ }
327
+ }
328
+ },
329
+ { "Op": "And" },
330
+ {
331
+ "Restriction": {
332
+ "MatchInputOutputMetadataValue": {
333
+ "input_index": 1,
334
+ "input_metadata_key": "version",
335
+ "output_index": 1,
336
+ "output_metadata_key": "version"
337
+ }
338
+ }
339
+ },
340
+ { "Op": "And" },
341
+ {
342
+ "Restriction": {
343
+ "MatchInputOutputMetadataValue": {
344
+ "input_index": 1,
345
+ "input_metadata_key": "subtype",
346
+ "output_index": 1,
347
+ "output_metadata_key": "subtype"
348
+ }
349
+ }
350
+ },
351
+ { "Op": "And" },
352
+ {
353
+ "Restriction": {
354
+ "MatchInputOutputMetadataValue": {
355
+ "input_index": 1,
356
+ "input_metadata_key": "state",
357
+ "output_index": 1,
358
+ "output_metadata_key": "state"
359
+ }
360
+ }
361
+ },
362
+ { "Op": "And" },
363
+ {
364
+ "Restriction": {
365
+ "MatchInputOutputRole": {
366
+ "input_index": 1,
367
+ "input_role_key": "Owner",
368
+ "output_index": 1,
369
+ "output_role_key": "Owner"
370
+ }
371
+ }
372
+ },
373
+ { "Op": "And" },
374
+ {
375
+ "Restriction": {
376
+ "MatchInputOutputMetadataValue": {
377
+ "input_index": 1,
378
+ "input_metadata_key": "originalId",
379
+ "output_index": 1,
380
+ "output_metadata_key": "originalId"
381
+ }
382
+ }
383
+ },
384
+ {
385
+ "Restriction": {
386
+ "InputHasMetadata": {
387
+ "index": 1,
388
+ "metadata_key": "originalId"
389
+ }
390
+ }
391
+ },
392
+ {
393
+ "Restriction": "None"
394
+ },
395
+ { "Op": "NotL" },
396
+ {
397
+ "Restriction": {
398
+ "MatchInputIdOutputMetadataValue": {
399
+ "input_index": 1,
400
+ "output_index": 1,
401
+ "output_metadata_key": "originalId"
402
+ }
403
+ }
404
+ },
405
+ { "Op": "And" },
406
+ { "Op": "Or" },
407
+ { "Op": "And" },
408
+ {
409
+ "Restriction": {
410
+ "SenderHasOutputRole": {
411
+ "index": 2,
412
+ "role_key": "Optimiser"
413
+ }
414
+ }
415
+ },
416
+ { "Op": "And" },
417
+ {
418
+ "Restriction": {
419
+ "MatchInputOutputRole": {
420
+ "input_index": 0,
421
+ "input_role_key": "Owner",
422
+ "output_index": 2,
423
+ "output_role_key": "MemberA"
424
+ }
425
+ }
426
+ },
427
+ { "Op": "And" },
428
+ {
429
+ "Restriction": {
430
+ "MatchInputOutputRole": {
431
+ "input_index": 1,
432
+ "input_role_key": "Owner",
433
+ "output_index": 2,
434
+ "output_role_key": "MemberB"
435
+ }
436
+ }
437
+ },
438
+ { "Op": "And" },
439
+ {
440
+ "Restriction": {
441
+ "FixedOutputMetadataValue": {
442
+ "index": 2,
443
+ "metadata_key": "type",
444
+ "metadata_value": {
445
+ "Literal": "MATCH2"
446
+ }
447
+ }
448
+ }
449
+ },
450
+ { "Op": "And" },
451
+ {
452
+ "Restriction": {
453
+ "FixedOutputMetadataValue": {
454
+ "index": 2,
455
+ "metadata_key": "version",
456
+ "metadata_value": {
457
+ "Literal": "1"
458
+ }
459
+ }
460
+ }
461
+ },
462
+ { "Op": "And" },
463
+ {
464
+ "Restriction": {
465
+ "FixedOutputMetadataValue": {
466
+ "index": 2,
467
+ "metadata_key": "state",
468
+ "metadata_value": {
469
+ "Literal": "proposed"
470
+ }
471
+ }
472
+ }
473
+ },
474
+ { "Op": "And" },
475
+ {
476
+ "Restriction": {
477
+ "MatchInputOutputMetadataValue": {
478
+ "input_index": 0,
479
+ "input_metadata_key": "originalId",
480
+ "output_index": 2,
481
+ "output_metadata_key": "demandA"
482
+ }
483
+ }
484
+ },
485
+ {
486
+ "Restriction": {
487
+ "InputHasMetadata": {
488
+ "index": 0,
489
+ "metadata_key": "originalId"
490
+ }
491
+ }
492
+ },
493
+ {
494
+ "Restriction": "None"
495
+ },
496
+ { "Op": "NotL" },
497
+ {
498
+ "Restriction": {
499
+ "MatchInputIdOutputMetadataValue": {
500
+ "input_index": 0,
501
+ "output_index": 2,
502
+ "output_metadata_key": "demandA"
503
+ }
504
+ }
505
+ },
506
+ { "Op": "And" },
507
+ { "Op": "Or" },
508
+ { "Op": "And" },
509
+ {
510
+ "Restriction": {
511
+ "MatchInputOutputMetadataValue": {
512
+ "input_index": 1,
513
+ "input_metadata_key": "originalId",
514
+ "output_index": 2,
515
+ "output_metadata_key": "demandB"
516
+ }
517
+ }
518
+ },
519
+ {
520
+ "Restriction": {
521
+ "InputHasMetadata": {
522
+ "index": 1,
523
+ "metadata_key": "originalId"
524
+ }
525
+ }
526
+ },
527
+ {
528
+ "Restriction": "None"
529
+ },
530
+ { "Op": "NotL" },
531
+ {
532
+ "Restriction": {
533
+ "MatchInputIdOutputMetadataValue": {
534
+ "input_index": 1,
535
+ "output_index": 2,
536
+ "output_metadata_key": "demandB"
537
+ }
538
+ }
539
+ },
540
+ { "Op": "And" },
541
+ { "Op": "Or" },
542
+ { "Op": "And" },
543
+ {
544
+ "Restriction": {
545
+ "OutputHasMetadata": {
546
+ "index": 2,
547
+ "metadata_key": "originalId"
548
+ }
549
+ }
550
+ },
551
+ {
552
+ "Restriction": "None"
553
+ },
554
+ { "Op": "NotL" },
555
+ { "Op": "And" }
556
+ ]
557
+ },
558
+ {
559
+ "name": "test-program-strings-and-numbers",
560
+ "version": 1,
561
+ "program": [
562
+ {
563
+ "Restriction": {
564
+ "FixedNumberOfInputs": {
565
+ "num_inputs": 3
566
+ }
567
+ }
568
+ },
569
+ {
570
+ "Restriction": {
571
+ "FixedNumberOfOutputs": {
572
+ "num_outputs": 3
573
+ }
574
+ }
575
+ },
576
+ { "Op": "And" },
577
+ {
578
+ "Restriction": {
579
+ "MatchInputOutputRole": {
580
+ "input_index": 0,
581
+ "input_role_key": "Owner",
582
+ "output_index": 0,
583
+ "output_role_key": "Owner"
584
+ }
585
+ }
586
+ },
587
+ { "Op": "And" },
588
+ {
589
+ "Restriction": {
590
+ "FixedInputMetadataValue": {
591
+ "index": 0,
592
+ "metadata_key": "type",
593
+ "metadata_value": {
594
+ "Literal": "DEMAND"
595
+ }
596
+ }
597
+ }
598
+ },
599
+ { "Op": "And" },
600
+ {
601
+ "Restriction": {
602
+ "MatchInputOutputMetadataValue": {
603
+ "input_index": 0,
604
+ "input_metadata_key": "type",
605
+ "output_index": 0,
606
+ "output_metadata_key": "type"
607
+ }
608
+ }
609
+ },
610
+ { "Op": "And" },
611
+ {
612
+ "Restriction": {
613
+ "FixedInputMetadataValue": {
614
+ "index": 0,
615
+ "metadata_key": "subtype",
616
+ "metadata_value": {
617
+ "Literal": "demand_a"
618
+ }
619
+ }
620
+ }
621
+ },
622
+ { "Op": "And" },
623
+ {
624
+ "Restriction": {
625
+ "MatchInputOutputMetadataValue": {
626
+ "input_index": 0,
627
+ "input_metadata_key": "subtype",
628
+ "output_index": 0,
629
+ "output_metadata_key": "subtype"
630
+ }
631
+ }
632
+ },
633
+ { "Op": "And" },
634
+ {
635
+ "Restriction": {
636
+ "FixedInputMetadataValue": {
637
+ "index": 0,
638
+ "metadata_key": "version",
639
+ "metadata_value": {
640
+ "Literal": "1"
641
+ }
642
+ }
643
+ }
644
+ },
645
+ { "Op": "And" },
646
+ {
647
+ "Restriction": {
648
+ "MatchInputOutputMetadataValue": {
649
+ "input_index": 0,
650
+ "input_metadata_key": "version",
651
+ "output_index": 0,
652
+ "output_metadata_key": "version"
653
+ }
654
+ }
655
+ },
656
+ { "Op": "And" },
657
+ {
658
+ "Restriction": {
659
+ "MatchInputOutputMetadataValue": {
660
+ "input_index": 0,
661
+ "input_metadata_key": "originalId",
662
+ "output_index": 0,
663
+ "output_metadata_key": "originalId"
664
+ }
665
+ }
666
+ },
667
+ {
668
+ "Restriction": {
669
+ "InputHasMetadata": {
670
+ "index": 0,
671
+ "metadata_key": "originalId"
672
+ }
673
+ }
674
+ },
675
+ {
676
+ "Restriction": "None"
677
+ },
678
+ { "Op": "NotL" },
679
+ {
680
+ "Restriction": {
681
+ "MatchInputIdOutputMetadataValue": {
682
+ "input_index": 0,
683
+ "output_index": 0,
684
+ "output_metadata_key": "originalId"
685
+ }
686
+ }
687
+ },
688
+ { "Op": "And" },
689
+ { "Op": "Or" },
690
+ { "Op": "And" },
691
+ {
692
+ "Restriction": {
693
+ "FixedInputMetadataValue": {
694
+ "index": 0,
695
+ "metadata_key": "state",
696
+ "metadata_value": {
697
+ "Literal": "created"
698
+ }
699
+ }
700
+ }
701
+ },
702
+ { "Op": "And" },
703
+ {
704
+ "Restriction": {
705
+ "FixedOutputMetadataValue": {
706
+ "index": 0,
707
+ "metadata_key": "state",
708
+ "metadata_value": {
709
+ "Literal": "allocated"
710
+ }
711
+ }
712
+ }
713
+ },
714
+ { "Op": "And" },
715
+ {
716
+ "Restriction": {
717
+ "MatchInputOutputRole": {
718
+ "input_index": 1,
719
+ "input_role_key": "Owner",
720
+ "output_index": 1,
721
+ "output_role_key": "Owner"
722
+ }
723
+ }
724
+ },
725
+ { "Op": "And" },
726
+ {
727
+ "Restriction": {
728
+ "FixedInputMetadataValue": {
729
+ "index": 1,
730
+ "metadata_key": "type",
731
+ "metadata_value": {
732
+ "Literal": "DEMAND"
733
+ }
734
+ }
735
+ }
736
+ },
737
+ { "Op": "And" },
738
+ {
739
+ "Restriction": {
740
+ "MatchInputOutputMetadataValue": {
741
+ "input_index": 1,
742
+ "input_metadata_key": "type",
743
+ "output_index": 1,
744
+ "output_metadata_key": "type"
745
+ }
746
+ }
747
+ },
748
+ { "Op": "And" },
749
+ {
750
+ "Restriction": {
751
+ "FixedInputMetadataValue": {
752
+ "index": 1,
753
+ "metadata_key": "subtype",
754
+ "metadata_value": {
755
+ "Literal": "demand_b"
756
+ }
757
+ }
758
+ }
759
+ },
760
+ { "Op": "And" },
761
+ {
762
+ "Restriction": {
763
+ "MatchInputOutputMetadataValue": {
764
+ "input_index": 1,
765
+ "input_metadata_key": "subtype",
766
+ "output_index": 1,
767
+ "output_metadata_key": "subtype"
768
+ }
769
+ }
770
+ },
771
+ { "Op": "And" },
772
+ {
773
+ "Restriction": {
774
+ "FixedInputMetadataValue": {
775
+ "index": 1,
776
+ "metadata_key": "version",
777
+ "metadata_value": {
778
+ "Literal": "1"
779
+ }
780
+ }
781
+ }
782
+ },
783
+ { "Op": "And" },
784
+ {
785
+ "Restriction": {
786
+ "MatchInputOutputMetadataValue": {
787
+ "input_index": 1,
788
+ "input_metadata_key": "version",
789
+ "output_index": 1,
790
+ "output_metadata_key": "version"
791
+ }
792
+ }
793
+ },
794
+ { "Op": "And" },
795
+ {
796
+ "Restriction": {
797
+ "MatchInputOutputMetadataValue": {
798
+ "input_index": 1,
799
+ "input_metadata_key": "originalId",
800
+ "output_index": 1,
801
+ "output_metadata_key": "originalId"
802
+ }
803
+ }
804
+ },
805
+ {
806
+ "Restriction": {
807
+ "InputHasMetadata": {
808
+ "index": 1,
809
+ "metadata_key": "originalId"
810
+ }
811
+ }
812
+ },
813
+ {
814
+ "Restriction": "None"
815
+ },
816
+ { "Op": "NotL" },
817
+ {
818
+ "Restriction": {
819
+ "MatchInputIdOutputMetadataValue": {
820
+ "input_index": 1,
821
+ "output_index": 1,
822
+ "output_metadata_key": "originalId"
823
+ }
824
+ }
825
+ },
826
+ { "Op": "And" },
827
+ { "Op": "Or" },
828
+ { "Op": "And" },
829
+ {
830
+ "Restriction": {
831
+ "FixedInputMetadataValue": {
832
+ "index": 1,
833
+ "metadata_key": "state",
834
+ "metadata_value": {
835
+ "Literal": "created"
836
+ }
837
+ }
838
+ }
839
+ },
840
+ { "Op": "And" },
841
+ {
842
+ "Restriction": {
843
+ "FixedOutputMetadataValue": {
844
+ "index": 1,
845
+ "metadata_key": "state",
846
+ "metadata_value": {
847
+ "Literal": "allocated"
848
+ }
849
+ }
850
+ }
851
+ },
852
+ { "Op": "And" },
853
+ {
854
+ "Restriction": {
855
+ "MatchInputOutputRole": {
856
+ "input_index": 2,
857
+ "input_role_key": "Optimiser",
858
+ "output_index": 2,
859
+ "output_role_key": "Optimiser"
860
+ }
861
+ }
862
+ },
863
+ { "Op": "And" },
864
+ {
865
+ "Restriction": {
866
+ "MatchInputOutputRole": {
867
+ "input_index": 2,
868
+ "input_role_key": "MemberA",
869
+ "output_index": 2,
870
+ "output_role_key": "MemberA"
871
+ }
872
+ }
873
+ },
874
+ { "Op": "And" },
875
+ {
876
+ "Restriction": {
877
+ "MatchInputOutputRole": {
878
+ "input_index": 2,
879
+ "input_role_key": "MemberB",
880
+ "output_index": 2,
881
+ "output_role_key": "MemberB"
882
+ }
883
+ }
884
+ },
885
+ { "Op": "And" },
886
+ {
887
+ "Restriction": {
888
+ "FixedInputMetadataValue": {
889
+ "index": 2,
890
+ "metadata_key": "type",
891
+ "metadata_value": {
892
+ "Literal": "MATCH2"
893
+ }
894
+ }
895
+ }
896
+ },
897
+ { "Op": "And" },
898
+ {
899
+ "Restriction": {
900
+ "MatchInputOutputMetadataValue": {
901
+ "input_index": 2,
902
+ "input_metadata_key": "type",
903
+ "output_index": 2,
904
+ "output_metadata_key": "type"
905
+ }
906
+ }
907
+ },
908
+ { "Op": "And" },
909
+ {
910
+ "Restriction": {
911
+ "FixedInputMetadataValue": {
912
+ "index": 2,
913
+ "metadata_key": "version",
914
+ "metadata_value": {
915
+ "Literal": "1"
916
+ }
917
+ }
918
+ }
919
+ },
920
+ { "Op": "And" },
921
+ {
922
+ "Restriction": {
923
+ "MatchInputOutputMetadataValue": {
924
+ "input_index": 2,
925
+ "input_metadata_key": "version",
926
+ "output_index": 2,
927
+ "output_metadata_key": "version"
928
+ }
929
+ }
930
+ },
931
+ { "Op": "And" },
932
+ {
933
+ "Restriction": {
934
+ "MatchInputOutputMetadataValue": {
935
+ "input_index": 0,
936
+ "input_metadata_key": "originalId",
937
+ "output_index": 2,
938
+ "output_metadata_key": "demandA"
939
+ }
940
+ }
941
+ },
942
+ { "Op": "And" },
943
+ {
944
+ "Restriction": {
945
+ "MatchInputOutputMetadataValue": {
946
+ "input_index": 2,
947
+ "input_metadata_key": "demandA",
948
+ "output_index": 2,
949
+ "output_metadata_key": "demandA"
950
+ }
951
+ }
952
+ },
953
+ { "Op": "And" },
954
+ {
955
+ "Restriction": {
956
+ "MatchInputOutputMetadataValue": {
957
+ "input_index": 1,
958
+ "input_metadata_key": "originalId",
959
+ "output_index": 2,
960
+ "output_metadata_key": "demandB"
961
+ }
962
+ }
963
+ },
964
+ { "Op": "And" },
965
+ {
966
+ "Restriction": {
967
+ "MatchInputOutputMetadataValue": {
968
+ "input_index": 2,
969
+ "input_metadata_key": "demandB",
970
+ "output_index": 2,
971
+ "output_metadata_key": "demandB"
972
+ }
973
+ }
974
+ },
975
+ { "Op": "And" },
976
+ {
977
+ "Restriction": {
978
+ "MatchInputOutputMetadataValue": {
979
+ "input_index": 2,
980
+ "input_metadata_key": "originalId",
981
+ "output_index": 2,
982
+ "output_metadata_key": "originalId"
983
+ }
984
+ }
985
+ },
986
+ {
987
+ "Restriction": {
988
+ "InputHasMetadata": {
989
+ "index": 2,
990
+ "metadata_key": "originalId"
991
+ }
992
+ }
993
+ },
994
+ {
995
+ "Restriction": "None"
996
+ },
997
+ { "Op": "NotL" },
998
+ {
999
+ "Restriction": {
1000
+ "MatchInputIdOutputMetadataValue": {
1001
+ "input_index": 2,
1002
+ "output_index": 2,
1003
+ "output_metadata_key": "originalId"
1004
+ }
1005
+ }
1006
+ },
1007
+ { "Op": "And" },
1008
+ { "Op": "Or" },
1009
+ { "Op": "And" },
1010
+ {
1011
+ "Restriction": {
1012
+ "FixedOutputMetadataValue": {
1013
+ "index": 2,
1014
+ "metadata_key": "state",
1015
+ "metadata_value": {
1016
+ "Literal": "acceptedFinal"
1017
+ }
1018
+ }
1019
+ }
1020
+ },
1021
+ { "Op": "And" },
1022
+ {
1023
+ "Restriction": {
1024
+ "FixedInputMetadataValue": {
1025
+ "index": 2,
1026
+ "metadata_key": "state",
1027
+ "metadata_value": {
1028
+ "Literal": "acceptedA"
1029
+ }
1030
+ }
1031
+ }
1032
+ },
1033
+ {
1034
+ "Restriction": {
1035
+ "SenderHasOutputRole": {
1036
+ "index": 2,
1037
+ "role_key": "MemberB"
1038
+ }
1039
+ }
1040
+ },
1041
+ { "Op": "And" },
1042
+ {
1043
+ "Restriction": {
1044
+ "FixedInputMetadataValue": {
1045
+ "index": 2,
1046
+ "metadata_key": "state",
1047
+ "metadata_value": {
1048
+ "Literal": "acceptedB"
1049
+ }
1050
+ }
1051
+ }
1052
+ },
1053
+ {
1054
+ "Restriction": {
1055
+ "SenderHasOutputRole": {
1056
+ "index": 2,
1057
+ "role_key": "MemberA"
1058
+ }
1059
+ }
1060
+ },
1061
+ { "Op": "And" },
1062
+ { "Op": "Or" },
1063
+ { "Op": "And" }
1064
+ ]
1065
+ }
1066
+ ];