@zenwave360/vistas-eventflow 0.1.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 (42) hide show
  1. package/FLOWVIEWMODEL_EXAMPLES.md +896 -0
  2. package/LICENSE +21 -0
  3. package/README.md +151 -0
  4. package/dist/EventFlowVisualizer.d.ts +25 -0
  5. package/dist/EventFlowVisualizer.d.ts.map +1 -0
  6. package/dist/ServiceMapVisualizer.d.ts +14 -0
  7. package/dist/ServiceMapVisualizer.d.ts.map +1 -0
  8. package/dist/components/CausationEdge.d.ts +8 -0
  9. package/dist/components/CausationEdge.d.ts.map +1 -0
  10. package/dist/components/CommandNode.d.ts +10 -0
  11. package/dist/components/CommandNode.d.ts.map +1 -0
  12. package/dist/components/EndNode.d.ts +10 -0
  13. package/dist/components/EndNode.d.ts.map +1 -0
  14. package/dist/components/EventNode.d.ts +10 -0
  15. package/dist/components/EventNode.d.ts.map +1 -0
  16. package/dist/components/OutcomeNode.d.ts +7 -0
  17. package/dist/components/OutcomeNode.d.ts.map +1 -0
  18. package/dist/components/PolicyNode.d.ts +16 -0
  19. package/dist/components/PolicyNode.d.ts.map +1 -0
  20. package/dist/components/ServiceGroupNode.d.ts +10 -0
  21. package/dist/components/ServiceGroupNode.d.ts.map +1 -0
  22. package/dist/components/ServiceMapNode.d.ts +8 -0
  23. package/dist/components/ServiceMapNode.d.ts.map +1 -0
  24. package/dist/components/StartNode.d.ts +10 -0
  25. package/dist/components/StartNode.d.ts.map +1 -0
  26. package/dist/components/SystemGroupNode.d.ts +7 -0
  27. package/dist/components/SystemGroupNode.d.ts.map +1 -0
  28. package/dist/index.d.ts +29 -0
  29. package/dist/index.d.ts.map +1 -0
  30. package/dist/index.js +645 -0
  31. package/dist/index.js.map +1 -0
  32. package/dist/labelFormatting.d.ts +6 -0
  33. package/dist/labelFormatting.d.ts.map +1 -0
  34. package/dist/styles.css +1 -0
  35. package/dist/types/FlowViewModel-updated.d.ts +114 -0
  36. package/dist/types/FlowViewModel-updated.d.ts.map +1 -0
  37. package/dist/types/FlowViewModel.d.ts +124 -0
  38. package/dist/types/FlowViewModel.d.ts.map +1 -0
  39. package/dist/types/ServiceViewModel.d.ts +64 -0
  40. package/dist/types/ServiceViewModel.d.ts.map +1 -0
  41. package/event-flow-architecture-and-contracts.md +1067 -0
  42. package/package.json +54 -0
@@ -0,0 +1,896 @@
1
+
2
+ ```zfl
3
+ @import(subscriptions: "http://localhost:8080/subscription/model.zdl")
4
+ @import(payments: "com.example.domain:payments:RELEASE")
5
+
6
+ config {
7
+ basePackage "io.zenwave360.example.subscriptions"
8
+ persistence mongodb
9
+ }
10
+
11
+ systems {
12
+ @zdl("subscription/model.zdl")
13
+ Subscription {
14
+ service SubscriptionService
15
+ }
16
+
17
+ @zdl("payments/model.zdl")
18
+ Payments {
19
+ service PaymentService
20
+ }
21
+
22
+ @zdl("billing/model.zdl")
23
+ Billing {
24
+ service BillingService
25
+ }
26
+ }
27
+
28
+ /**
29
+ * Payment Flow for Subscription Renewals
30
+ */
31
+ flow PaymentsFlow {
32
+
33
+ @actor(Customer)
34
+ start CustomerRequestsSubscriptionRenewal {
35
+ subscriptionId String
36
+ customerId String
37
+ paymentMethodId String
38
+ }
39
+
40
+ @time("end of month")
41
+ start BillingCycleEnded {
42
+ billingPeriod String
43
+ }
44
+
45
+ @time("5 minutes after SubscriptionRenewed and not PaymentSucceeded or PaymentFailed")
46
+ start PaymentTimeout {
47
+ }
48
+
49
+ when CustomerRequestsSubscriptionRenewal {
50
+ service Subscription.SubscriptionService
51
+ command renewSubscription
52
+ event SubscriptionRenewed
53
+ }
54
+
55
+ when SubscriptionRenewed {
56
+ service Payments.PaymentService
57
+ command chargePayment
58
+ event PaymentSucceeded
59
+ event PaymentFailed
60
+ }
61
+
62
+ @if("less than 3 attempts")
63
+ when PaymentFailed {
64
+ service Payments.PaymentService
65
+ command retryPayment
66
+ event PaymentRetryScheduled
67
+ }
68
+
69
+ @if("3 or more attempts")
70
+ when PaymentFailed {
71
+ service Subscription.SubscriptionService
72
+ command suspendSubscription
73
+ event SubscriptionSuspended
74
+ }
75
+
76
+ when PaymentSucceeded and BillingCycleEnded {
77
+ service Payments.PaymentService
78
+ command recordPayment
79
+ event PaymentRecorded
80
+ }
81
+
82
+ when PaymentTimeout {
83
+ service Subscription.SubscriptionService
84
+ command cancelRenewal
85
+ event RenewalCancelled
86
+ }
87
+
88
+ end {
89
+ completed: PaymentRecorded
90
+ suspended: SubscriptionSuspended
91
+ cancelled: RenewalCancelled
92
+ }
93
+ }
94
+ ´´´
95
+
96
+
97
+ ```json
98
+ {
99
+ "schema": "zfl.eventflow.view@1",
100
+ "nodes": [
101
+ {
102
+ "id": "event:CustomerRequestsSubscriptionRenewal",
103
+ "type": "START",
104
+ "label": "CustomerRequestsSubscriptionRenewal",
105
+ "system": null,
106
+ "service": null,
107
+ "sourceRef": {
108
+ "file": "<zfl>",
109
+ "line": 1,
110
+ "column": 1
111
+ },
112
+ "position": {
113
+ "x": 32.0,
114
+ "y": 297.33333333333337
115
+ },
116
+ "dimensions": {
117
+ "width": 180.0,
118
+ "height": 56.0
119
+ }
120
+ },
121
+ {
122
+ "id": "event:BillingCycleEnded",
123
+ "type": "START",
124
+ "label": "BillingCycleEnded",
125
+ "system": null,
126
+ "service": null,
127
+ "sourceRef": {
128
+ "file": "<zfl>",
129
+ "line": 1,
130
+ "column": 1
131
+ },
132
+ "position": {
133
+ "x": 1652.0,
134
+ "y": 116.0
135
+ },
136
+ "dimensions": {
137
+ "width": 180.0,
138
+ "height": 56.0
139
+ }
140
+ },
141
+ {
142
+ "id": "event:PaymentTimeout",
143
+ "type": "START",
144
+ "label": "PaymentTimeout",
145
+ "system": null,
146
+ "service": null,
147
+ "sourceRef": {
148
+ "file": "<zfl>",
149
+ "line": 1,
150
+ "column": 1
151
+ },
152
+ "position": {
153
+ "x": 32.0,
154
+ "y": 36.0
155
+ },
156
+ "dimensions": {
157
+ "width": 180.0,
158
+ "height": 56.0
159
+ }
160
+ },
161
+ {
162
+ "id": "command:renewSubscription",
163
+ "type": "COMMAND",
164
+ "label": "renewSubscription",
165
+ "system": "Subscription",
166
+ "service": "SubscriptionService",
167
+ "sourceRef": {
168
+ "file": "<zfl>",
169
+ "line": 1,
170
+ "column": 1
171
+ },
172
+ "position": {
173
+ "x": 592.0,
174
+ "y": 297.33333333333337
175
+ },
176
+ "dimensions": {
177
+ "width": 180.0,
178
+ "height": 56.0
179
+ }
180
+ },
181
+ {
182
+ "id": "command:chargePayment",
183
+ "type": "COMMAND",
184
+ "label": "chargePayment",
185
+ "system": "Payments",
186
+ "service": "PaymentService",
187
+ "sourceRef": {
188
+ "file": "<zfl>",
189
+ "line": 1,
190
+ "column": 1
191
+ },
192
+ "position": {
193
+ "x": 1392.0,
194
+ "y": 297.33333333333337
195
+ },
196
+ "dimensions": {
197
+ "width": 180.0,
198
+ "height": 56.0
199
+ }
200
+ },
201
+ {
202
+ "id": "command:retryPayment",
203
+ "type": "COMMAND",
204
+ "label": "retryPayment",
205
+ "system": "Payments",
206
+ "service": "PaymentService",
207
+ "sourceRef": {
208
+ "file": "<zfl>",
209
+ "line": 1,
210
+ "column": 1
211
+ },
212
+ "position": {
213
+ "x": 2212.0,
214
+ "y": 632.0
215
+ },
216
+ "dimensions": {
217
+ "width": 180.0,
218
+ "height": 56.0
219
+ }
220
+ },
221
+ {
222
+ "id": "command:suspendSubscription",
223
+ "type": "COMMAND",
224
+ "label": "suspendSubscription",
225
+ "system": "Subscription",
226
+ "service": "SubscriptionService",
227
+ "sourceRef": {
228
+ "file": "<zfl>",
229
+ "line": 1,
230
+ "column": 1
231
+ },
232
+ "position": {
233
+ "x": 2212.0,
234
+ "y": 448.0
235
+ },
236
+ "dimensions": {
237
+ "width": 180.0,
238
+ "height": 56.0
239
+ }
240
+ },
241
+ {
242
+ "id": "command:recordPayment",
243
+ "type": "COMMAND",
244
+ "label": "recordPayment",
245
+ "system": "Payments",
246
+ "service": "PaymentService",
247
+ "sourceRef": {
248
+ "file": "<zfl>",
249
+ "line": 1,
250
+ "column": 1
251
+ },
252
+ "position": {
253
+ "x": 2212.0,
254
+ "y": 126.66666666666666
255
+ },
256
+ "dimensions": {
257
+ "width": 180.0,
258
+ "height": 56.0
259
+ }
260
+ },
261
+ {
262
+ "id": "command:cancelRenewal",
263
+ "type": "COMMAND",
264
+ "label": "cancelRenewal",
265
+ "system": "Subscription",
266
+ "service": "SubscriptionService",
267
+ "sourceRef": {
268
+ "file": "<zfl>",
269
+ "line": 1,
270
+ "column": 1
271
+ },
272
+ "position": {
273
+ "x": 592.0,
274
+ "y": 36.0
275
+ },
276
+ "dimensions": {
277
+ "width": 180.0,
278
+ "height": 56.0
279
+ }
280
+ },
281
+ {
282
+ "id": "event:SubscriptionRenewed",
283
+ "type": "EVENT",
284
+ "label": "SubscriptionRenewed",
285
+ "system": "Subscription",
286
+ "service": "SubscriptionService",
287
+ "sourceRef": {
288
+ "file": "<zfl>",
289
+ "line": 1,
290
+ "column": 1
291
+ },
292
+ "position": {
293
+ "x": 852.0,
294
+ "y": 301.33333333333337
295
+ },
296
+ "dimensions": {
297
+ "width": 160.0,
298
+ "height": 48.0
299
+ }
300
+ },
301
+ {
302
+ "id": "event:PaymentSucceeded",
303
+ "type": "EVENT",
304
+ "label": "PaymentSucceeded",
305
+ "system": "Payments",
306
+ "service": "PaymentService",
307
+ "sourceRef": {
308
+ "file": "<zfl>",
309
+ "line": 1,
310
+ "column": 1
311
+ },
312
+ "position": {
313
+ "x": 1662.0,
314
+ "y": 292.0
315
+ },
316
+ "dimensions": {
317
+ "width": 160.0,
318
+ "height": 48.0
319
+ }
320
+ },
321
+ {
322
+ "id": "event:PaymentFailed",
323
+ "type": "EVENT",
324
+ "label": "PaymentFailed",
325
+ "system": "Payments",
326
+ "service": "PaymentService",
327
+ "sourceRef": {
328
+ "file": "<zfl>",
329
+ "line": 1,
330
+ "column": 1
331
+ },
332
+ "position": {
333
+ "x": 1665.3333333333333,
334
+ "y": 460.0
335
+ },
336
+ "dimensions": {
337
+ "width": 160.0,
338
+ "height": 48.0
339
+ }
340
+ },
341
+ {
342
+ "id": "event:PaymentRetryScheduled",
343
+ "type": "EVENT",
344
+ "label": "PaymentRetryScheduled",
345
+ "system": "Payments",
346
+ "service": "PaymentService",
347
+ "sourceRef": {
348
+ "file": "<zfl>",
349
+ "line": 1,
350
+ "column": 1
351
+ },
352
+ "position": {
353
+ "x": 2472.0,
354
+ "y": 636.0
355
+ },
356
+ "dimensions": {
357
+ "width": 160.0,
358
+ "height": 48.0
359
+ }
360
+ },
361
+ {
362
+ "id": "event:SubscriptionSuspended",
363
+ "type": "EVENT",
364
+ "label": "SubscriptionSuspended",
365
+ "system": "Subscription",
366
+ "service": "SubscriptionService",
367
+ "sourceRef": {
368
+ "file": "<zfl>",
369
+ "line": 1,
370
+ "column": 1
371
+ },
372
+ "position": {
373
+ "x": 2472.0,
374
+ "y": 452.0
375
+ },
376
+ "dimensions": {
377
+ "width": 160.0,
378
+ "height": 48.0
379
+ }
380
+ },
381
+ {
382
+ "id": "event:PaymentRecorded",
383
+ "type": "EVENT",
384
+ "label": "PaymentRecorded",
385
+ "system": "Payments",
386
+ "service": "PaymentService",
387
+ "sourceRef": {
388
+ "file": "<zfl>",
389
+ "line": 1,
390
+ "column": 1
391
+ },
392
+ "position": {
393
+ "x": 2472.0,
394
+ "y": 130.66666666666666
395
+ },
396
+ "dimensions": {
397
+ "width": 160.0,
398
+ "height": 48.0
399
+ }
400
+ },
401
+ {
402
+ "id": "event:RenewalCancelled",
403
+ "type": "EVENT",
404
+ "label": "RenewalCancelled",
405
+ "system": "Subscription",
406
+ "service": "SubscriptionService",
407
+ "sourceRef": {
408
+ "file": "<zfl>",
409
+ "line": 1,
410
+ "column": 1
411
+ },
412
+ "position": {
413
+ "x": 852.0,
414
+ "y": 40.0
415
+ },
416
+ "dimensions": {
417
+ "width": 160.0,
418
+ "height": 48.0
419
+ }
420
+ },
421
+ {
422
+ "id": "policy:CustomerRequestsSubscriptionRenewal:renewSubscription",
423
+ "type": "POLICY",
424
+ "label": "when CustomerRequestsSubscriptionRenewal do renewSubscription",
425
+ "system": null,
426
+ "service": null,
427
+ "sourceRef": {
428
+ "file": "<zfl>",
429
+ "line": 1,
430
+ "column": 1
431
+ },
432
+ "position": {
433
+ "x": 292.0,
434
+ "y": 293.33333333333337
435
+ },
436
+ "dimensions": {
437
+ "width": 220.0,
438
+ "height": 64.0
439
+ }
440
+ },
441
+ {
442
+ "id": "policy:SubscriptionRenewed:chargePayment",
443
+ "type": "POLICY",
444
+ "label": "when SubscriptionRenewed do chargePayment",
445
+ "system": null,
446
+ "service": null,
447
+ "sourceRef": {
448
+ "file": "<zfl>",
449
+ "line": 1,
450
+ "column": 1
451
+ },
452
+ "position": {
453
+ "x": 1092.0,
454
+ "y": 293.33333333333337
455
+ },
456
+ "dimensions": {
457
+ "width": 220.0,
458
+ "height": 64.0
459
+ }
460
+ },
461
+ {
462
+ "id": "policy:PaymentFailed:retryPayment",
463
+ "type": "POLICY",
464
+ "label": "when PaymentFailed do retryPayment if less than 3 attempts",
465
+ "system": null,
466
+ "service": null,
467
+ "sourceRef": {
468
+ "file": "<zfl>",
469
+ "line": 1,
470
+ "column": 1
471
+ },
472
+ "position": {
473
+ "x": 1912.0,
474
+ "y": 628.0
475
+ },
476
+ "dimensions": {
477
+ "width": 220.0,
478
+ "height": 64.0
479
+ }
480
+ },
481
+ {
482
+ "id": "policy:PaymentFailed:suspendSubscription",
483
+ "type": "POLICY",
484
+ "label": "when PaymentFailed do suspendSubscription if 3 or more attempts",
485
+ "system": null,
486
+ "service": null,
487
+ "sourceRef": {
488
+ "file": "<zfl>",
489
+ "line": 1,
490
+ "column": 1
491
+ },
492
+ "position": {
493
+ "x": 1912.0,
494
+ "y": 444.0
495
+ },
496
+ "dimensions": {
497
+ "width": 220.0,
498
+ "height": 64.0
499
+ }
500
+ },
501
+ {
502
+ "id": "policy:PaymentSucceeded,BillingCycleEnded:recordPayment",
503
+ "type": "POLICY",
504
+ "label": "when PaymentSucceeded,BillingCycleEnded do recordPayment",
505
+ "system": null,
506
+ "service": null,
507
+ "sourceRef": {
508
+ "file": "<zfl>",
509
+ "line": 1,
510
+ "column": 1
511
+ },
512
+ "position": {
513
+ "x": 1912.0,
514
+ "y": 122.66666666666666
515
+ },
516
+ "dimensions": {
517
+ "width": 220.0,
518
+ "height": 64.0
519
+ }
520
+ },
521
+ {
522
+ "id": "policy:PaymentTimeout:cancelRenewal",
523
+ "type": "POLICY",
524
+ "label": "when PaymentTimeout do cancelRenewal",
525
+ "system": null,
526
+ "service": null,
527
+ "sourceRef": {
528
+ "file": "<zfl>",
529
+ "line": 1,
530
+ "column": 1
531
+ },
532
+ "position": {
533
+ "x": 292.0,
534
+ "y": 32.0
535
+ },
536
+ "dimensions": {
537
+ "width": 220.0,
538
+ "height": 64.0
539
+ }
540
+ },
541
+ {
542
+ "id": "end:completed",
543
+ "type": "END",
544
+ "label": "Completed",
545
+ "system": null,
546
+ "service": null,
547
+ "sourceRef": {
548
+ "file": "<zfl>",
549
+ "line": 1,
550
+ "column": 1
551
+ },
552
+ "position": {
553
+ "x": 2712.0,
554
+ "y": 126.66666666666666
555
+ },
556
+ "dimensions": {
557
+ "width": 180.0,
558
+ "height": 56.0
559
+ }
560
+ },
561
+ {
562
+ "id": "end:suspended",
563
+ "type": "END",
564
+ "label": "Suspended",
565
+ "system": null,
566
+ "service": null,
567
+ "sourceRef": {
568
+ "file": "<zfl>",
569
+ "line": 1,
570
+ "column": 1
571
+ },
572
+ "position": {
573
+ "x": 2712.0,
574
+ "y": 448.0
575
+ },
576
+ "dimensions": {
577
+ "width": 180.0,
578
+ "height": 56.0
579
+ }
580
+ },
581
+ {
582
+ "id": "end:cancelled",
583
+ "type": "END",
584
+ "label": "Cancelled",
585
+ "system": null,
586
+ "service": null,
587
+ "sourceRef": {
588
+ "file": "<zfl>",
589
+ "line": 1,
590
+ "column": 1
591
+ },
592
+ "position": {
593
+ "x": 1092.0,
594
+ "y": 36.0
595
+ },
596
+ "dimensions": {
597
+ "width": 180.0,
598
+ "height": 56.0
599
+ }
600
+ }
601
+ ],
602
+ "edges": [
603
+ {
604
+ "id": "from[event:CustomerRequestsSubscriptionRenewal]to[policy:CustomerRequestsSubscriptionRenewal:renewSubscription]",
605
+ "source": "event:CustomerRequestsSubscriptionRenewal",
606
+ "target": "policy:CustomerRequestsSubscriptionRenewal:renewSubscription",
607
+ "type": "TRIGGER",
608
+ "label": null,
609
+ "sourceRef": {
610
+ "file": "<zfl>",
611
+ "line": 1,
612
+ "column": 1
613
+ }
614
+ },
615
+ {
616
+ "id": "from[policy:CustomerRequestsSubscriptionRenewal:renewSubscription]to[command:renewSubscription]",
617
+ "source": "policy:CustomerRequestsSubscriptionRenewal:renewSubscription",
618
+ "target": "command:renewSubscription",
619
+ "type": "TRIGGER",
620
+ "label": null,
621
+ "sourceRef": {
622
+ "file": "<zfl>",
623
+ "line": 1,
624
+ "column": 1
625
+ }
626
+ },
627
+ {
628
+ "id": "from[command:renewSubscription]to[event:SubscriptionRenewed]",
629
+ "source": "command:renewSubscription",
630
+ "target": "event:SubscriptionRenewed",
631
+ "type": "CAUSATION",
632
+ "label": null,
633
+ "sourceRef": {
634
+ "file": "<zfl>",
635
+ "line": 1,
636
+ "column": 1
637
+ }
638
+ },
639
+ {
640
+ "id": "from[event:SubscriptionRenewed]to[policy:SubscriptionRenewed:chargePayment]",
641
+ "source": "event:SubscriptionRenewed",
642
+ "target": "policy:SubscriptionRenewed:chargePayment",
643
+ "type": "TRIGGER",
644
+ "label": null,
645
+ "sourceRef": {
646
+ "file": "<zfl>",
647
+ "line": 1,
648
+ "column": 1
649
+ }
650
+ },
651
+ {
652
+ "id": "from[policy:SubscriptionRenewed:chargePayment]to[command:chargePayment]",
653
+ "source": "policy:SubscriptionRenewed:chargePayment",
654
+ "target": "command:chargePayment",
655
+ "type": "TRIGGER",
656
+ "label": null,
657
+ "sourceRef": {
658
+ "file": "<zfl>",
659
+ "line": 1,
660
+ "column": 1
661
+ }
662
+ },
663
+ {
664
+ "id": "from[command:chargePayment]to[event:PaymentSucceeded]",
665
+ "source": "command:chargePayment",
666
+ "target": "event:PaymentSucceeded",
667
+ "type": "CAUSATION",
668
+ "label": null,
669
+ "sourceRef": {
670
+ "file": "<zfl>",
671
+ "line": 1,
672
+ "column": 1
673
+ }
674
+ },
675
+ {
676
+ "id": "from[command:chargePayment]to[event:PaymentFailed]",
677
+ "source": "command:chargePayment",
678
+ "target": "event:PaymentFailed",
679
+ "type": "CAUSATION",
680
+ "label": null,
681
+ "sourceRef": {
682
+ "file": "<zfl>",
683
+ "line": 1,
684
+ "column": 1
685
+ }
686
+ },
687
+ {
688
+ "id": "from[event:PaymentFailed]to[policy:PaymentFailed:retryPayment]",
689
+ "source": "event:PaymentFailed",
690
+ "target": "policy:PaymentFailed:retryPayment",
691
+ "type": "CONDITIONAL",
692
+ "label": null,
693
+ "sourceRef": {
694
+ "file": "<zfl>",
695
+ "line": 1,
696
+ "column": 1
697
+ }
698
+ },
699
+ {
700
+ "id": "from[policy:PaymentFailed:retryPayment]to[command:retryPayment]",
701
+ "source": "policy:PaymentFailed:retryPayment",
702
+ "target": "command:retryPayment",
703
+ "type": "CONDITIONAL",
704
+ "label": null,
705
+ "sourceRef": {
706
+ "file": "<zfl>",
707
+ "line": 1,
708
+ "column": 1
709
+ }
710
+ },
711
+ {
712
+ "id": "from[command:retryPayment]to[event:PaymentRetryScheduled]",
713
+ "source": "command:retryPayment",
714
+ "target": "event:PaymentRetryScheduled",
715
+ "type": "CAUSATION",
716
+ "label": null,
717
+ "sourceRef": {
718
+ "file": "<zfl>",
719
+ "line": 1,
720
+ "column": 1
721
+ }
722
+ },
723
+ {
724
+ "id": "from[event:PaymentFailed]to[policy:PaymentFailed:suspendSubscription]",
725
+ "source": "event:PaymentFailed",
726
+ "target": "policy:PaymentFailed:suspendSubscription",
727
+ "type": "CONDITIONAL",
728
+ "label": null,
729
+ "sourceRef": {
730
+ "file": "<zfl>",
731
+ "line": 1,
732
+ "column": 1
733
+ }
734
+ },
735
+ {
736
+ "id": "from[policy:PaymentFailed:suspendSubscription]to[command:suspendSubscription]",
737
+ "source": "policy:PaymentFailed:suspendSubscription",
738
+ "target": "command:suspendSubscription",
739
+ "type": "CONDITIONAL",
740
+ "label": null,
741
+ "sourceRef": {
742
+ "file": "<zfl>",
743
+ "line": 1,
744
+ "column": 1
745
+ }
746
+ },
747
+ {
748
+ "id": "from[command:suspendSubscription]to[event:SubscriptionSuspended]",
749
+ "source": "command:suspendSubscription",
750
+ "target": "event:SubscriptionSuspended",
751
+ "type": "CAUSATION",
752
+ "label": null,
753
+ "sourceRef": {
754
+ "file": "<zfl>",
755
+ "line": 1,
756
+ "column": 1
757
+ }
758
+ },
759
+ {
760
+ "id": "from[event:PaymentSucceeded]to[policy:PaymentSucceeded,BillingCycleEnded:recordPayment]",
761
+ "source": "event:PaymentSucceeded",
762
+ "target": "policy:PaymentSucceeded,BillingCycleEnded:recordPayment",
763
+ "type": "TRIGGER",
764
+ "label": null,
765
+ "sourceRef": {
766
+ "file": "<zfl>",
767
+ "line": 1,
768
+ "column": 1
769
+ }
770
+ },
771
+ {
772
+ "id": "from[event:BillingCycleEnded]to[policy:PaymentSucceeded,BillingCycleEnded:recordPayment]",
773
+ "source": "event:BillingCycleEnded",
774
+ "target": "policy:PaymentSucceeded,BillingCycleEnded:recordPayment",
775
+ "type": "TRIGGER",
776
+ "label": null,
777
+ "sourceRef": {
778
+ "file": "<zfl>",
779
+ "line": 1,
780
+ "column": 1
781
+ }
782
+ },
783
+ {
784
+ "id": "from[policy:PaymentSucceeded,BillingCycleEnded:recordPayment]to[command:recordPayment]",
785
+ "source": "policy:PaymentSucceeded,BillingCycleEnded:recordPayment",
786
+ "target": "command:recordPayment",
787
+ "type": "TRIGGER",
788
+ "label": null,
789
+ "sourceRef": {
790
+ "file": "<zfl>",
791
+ "line": 1,
792
+ "column": 1
793
+ }
794
+ },
795
+ {
796
+ "id": "from[command:recordPayment]to[event:PaymentRecorded]",
797
+ "source": "command:recordPayment",
798
+ "target": "event:PaymentRecorded",
799
+ "type": "CAUSATION",
800
+ "label": null,
801
+ "sourceRef": {
802
+ "file": "<zfl>",
803
+ "line": 1,
804
+ "column": 1
805
+ }
806
+ },
807
+ {
808
+ "id": "from[event:PaymentTimeout]to[policy:PaymentTimeout:cancelRenewal]",
809
+ "source": "event:PaymentTimeout",
810
+ "target": "policy:PaymentTimeout:cancelRenewal",
811
+ "type": "TRIGGER",
812
+ "label": null,
813
+ "sourceRef": {
814
+ "file": "<zfl>",
815
+ "line": 1,
816
+ "column": 1
817
+ }
818
+ },
819
+ {
820
+ "id": "from[policy:PaymentTimeout:cancelRenewal]to[command:cancelRenewal]",
821
+ "source": "policy:PaymentTimeout:cancelRenewal",
822
+ "target": "command:cancelRenewal",
823
+ "type": "TRIGGER",
824
+ "label": null,
825
+ "sourceRef": {
826
+ "file": "<zfl>",
827
+ "line": 1,
828
+ "column": 1
829
+ }
830
+ },
831
+ {
832
+ "id": "from[command:cancelRenewal]to[event:RenewalCancelled]",
833
+ "source": "command:cancelRenewal",
834
+ "target": "event:RenewalCancelled",
835
+ "type": "CAUSATION",
836
+ "label": null,
837
+ "sourceRef": {
838
+ "file": "<zfl>",
839
+ "line": 1,
840
+ "column": 1
841
+ }
842
+ },
843
+ {
844
+ "id": "from[event:PaymentRecorded]to[end:completed]",
845
+ "source": "event:PaymentRecorded",
846
+ "target": "end:completed",
847
+ "type": "CAUSATION",
848
+ "label": null,
849
+ "sourceRef": {
850
+ "file": "<zfl>",
851
+ "line": 1,
852
+ "column": 1
853
+ }
854
+ },
855
+ {
856
+ "id": "from[event:SubscriptionSuspended]to[end:suspended]",
857
+ "source": "event:SubscriptionSuspended",
858
+ "target": "end:suspended",
859
+ "type": "CAUSATION",
860
+ "label": null,
861
+ "sourceRef": {
862
+ "file": "<zfl>",
863
+ "line": 1,
864
+ "column": 1
865
+ }
866
+ },
867
+ {
868
+ "id": "from[event:RenewalCancelled]to[end:cancelled]",
869
+ "source": "event:RenewalCancelled",
870
+ "target": "end:cancelled",
871
+ "type": "CAUSATION",
872
+ "label": null,
873
+ "sourceRef": {
874
+ "file": "<zfl>",
875
+ "line": 1,
876
+ "column": 1
877
+ }
878
+ }
879
+ ],
880
+ "layout": {
881
+ "engine": "elk-layered",
882
+ "direction": "LR",
883
+ "rankSpacing": 80.0,
884
+ "nodeSpacing": 120.0
885
+ },
886
+ "bounds": {
887
+ "x": 0.0,
888
+ "y": 0.0,
889
+ "width": 2912.0,
890
+ "height": 712.0
891
+ },
892
+ "systemGroups": null
893
+ }
894
+
895
+
896
+ ```