|
1 | 1 | # diagram.py
|
2 | 2 | from diagrams import Cluster, Diagram, Edge
|
3 | 3 | from diagrams.sap.erp import SAPS4HANACloud
|
4 |
| -from diagrams.sap.integration import AdvancedEventMesh_Circled |
5 |
| -from diagrams.sap.runtimes import CloudFoundryRuntime_Circled |
6 |
| -from diagrams.sap.processautomation import SAPBuildProcessAutomation_Circled |
7 |
| -from diagrams.sap.integration import IntegrationSuite_Circled |
8 |
| -from diagrams.sap.generic import Iphone, Laptop, PersonPlaceholder |
9 |
| -from diagrams.sap.other import PlaceholderNewServices |
| 4 | +from diagrams.sap.integration import AdvancedEventMesh |
| 5 | +from diagrams.sap.runtimes import CloudFoundryRuntime |
| 6 | +from diagrams.sap.integration import IntegrationSuite |
| 7 | +from diagrams.sap.generic import PersonPlaceholder, ItSystem, Request |
10 | 8 |
|
11 | 9 | # SAP BTP Solution Diagrams and Icons guidelines colours
|
12 | 10 | L0_BLUE_COLOUR = "#0070F2"
|
|
23 | 21 | PRODUCER_COLOUR = "#07838F"
|
24 | 22 | CONSUMER_COLOUR = "#5D36FF"
|
25 | 23 |
|
26 |
| -with Diagram(filename="final-diagram", show=False, graph_attr={"pad": "0.2"}, edge_attr={"fontsize": "15"}): |
| 24 | +with Diagram(filename="codejam_eventing", show=False, graph_attr={"pad": "0.2"}, edge_attr={"fontsize": "15"}): |
27 | 25 |
|
28 | 26 | s4_hana_cloud = SAPS4HANACloud(width="3")
|
29 | 27 |
|
30 | 28 | person = PersonPlaceholder("Music fan")
|
31 | 29 |
|
32 |
| - third_party = PlaceholderNewServices("3rd party\nDocument Signature\nSaaS") |
| 30 | + webhook_site = ItSystem( |
| 31 | + "webhook.site") |
| 32 | + |
| 33 | + third_party = Request("3rd party\nDocument Signature\nSaaS") |
33 | 34 |
|
34 | 35 | with Cluster("SAP Business Technology Platform", graph_attr={"bgcolor": L0_FILLED_COLOUR, "pencolor": L0_BLUE_COLOUR, "margin": "20,20"}):
|
35 | 36 | with Cluster("Subaccount", graph_attr={"bgcolor": "white", "pencolor": L1_BLUE_COLOUR}):
|
36 |
| - ticket_website = CloudFoundryRuntime_Circled("Ticket website") |
| 37 | + ticket_website = CloudFoundryRuntime("Ticket website") |
37 | 38 |
|
38 |
| - event_mesh = AdvancedEventMesh_Circled("Advanced Event Mesh") |
39 |
| - cloud_integration = IntegrationSuite_Circled("Cloud Integration") |
40 |
| - |
41 |
| - vip_srvc = CloudFoundryRuntime_Circled("VIP Processing srvc") |
42 |
| - mail_delivery_srvc = CloudFoundryRuntime_Circled( |
43 |
| - "Mail Delivery srvc") |
| 39 | + event_mesh = AdvancedEventMesh("Advanced Event Mesh") |
| 40 | + cloud_integration = IntegrationSuite("Cloud Integration") |
44 | 41 |
|
45 |
| - sbpa = SAPBuildProcessAutomation_Circled( |
46 |
| - "SAP Build\nProcess Automation") |
| 42 | + # vip_srvc = CloudFoundryRuntime("VIP Processing srvc") |
| 43 | + mail_delivery_srvc = CloudFoundryRuntime( |
| 44 | + "Mail Delivery srvc\n(CAP Project)") |
47 | 45 |
|
48 | 46 | person >> Edge(color=FIX_GREY_COLOUR,
|
49 | 47 | label="Purchases ticket(s)") >> ticket_website
|
50 |
| - |
51 |
| - s4_hana_cloud >> Edge(color=PRODUCER_COLOUR, penwidth="2.0", headlabel="Performers managed as BusinessPartners in ERP\n📣 sap.s4.beh.businesspartner.v1.BusinessPartner.Created.v1" |
52 |
| - , labelfloat="true", labeldistance="30", labelangle="5.0") >> event_mesh |
53 |
| - |
| 48 | + |
| 49 | + s4_hana_cloud >> Edge(color=PRODUCER_COLOUR, penwidth="2.0", headlabel="Performers managed as BusinessPartners in ERP\n📣 sap.s4.beh.businesspartner.v1.BusinessPartner.Created.v1", |
| 50 | + labelfloat="true", labeldistance="33", labelangle="5.0") >> event_mesh |
54 | 51 |
|
55 | 52 | ticket_website >> Edge(
|
56 |
| - color=PRODUCER_COLOUR, penwidth="2.0", headlabel="New ticket(s) purchased\n📣 itelo.tms.ticket.v1.Ticket.Bought.v1", minlen="2",labeldistance="17", labelangle="-8") >> event_mesh |
| 53 | + color=PRODUCER_COLOUR, penwidth="2.0", headlabel="New ticket(s) purchased\n📣 itelo.tms.ticket.v1.Ticket.Purchased.v1", minlen="2" ,labeldistance="17", labelangle="-8") >> event_mesh |
57 | 54 |
|
58 |
| - |
59 |
| - event_mesh >> Edge(color=CONSUMER_COLOUR, penwidth="2.0", reverse=True, |
| 55 | + event_mesh >> Edge(color=CONSUMER_COLOUR, penwidth="2.0", reverse=True, style="dashed", |
60 | 56 | headlabel="Performer contract signature\nConsumes: sap.s4.beh.businesspartner.v1.BusinessPartner.Created.v1", labeldistance="25", labelangle="-5", minlen="9") >> cloud_integration
|
61 |
| - |
62 |
| - event_mesh >> Edge(color=CONSUMER_COLOUR, penwidth="2.0", reverse=True, style="dashed", |
63 |
| - headlabel="Create Sales Order in SAP S/4HANA Cloud\nConsumes: itelo.tms.ticket.v1.Ticket.Bought.v1", labeldistance="25", labelangle="-5", minlen="9") >> cloud_integration |
64 | 57 |
|
65 |
| - cloud_integration >> Edge( |
66 |
| - color=FIX_GREY_COLOUR, minlen="3") >> third_party |
67 |
| - |
68 |
| - |
69 | 58 | event_mesh >> Edge(color=CONSUMER_COLOUR, penwidth="2.0", reverse=True,
|
70 |
| - headlabel="VIP Package delivery\nConsumes: itelo.tms.ticket.v1.Ticket.Bought.v1", labeldistance="25", labelangle="-5", minlen="9") >> vip_srvc |
| 59 | + headlabel="Enrich message from SAP S/4HANA Cloud\nConsumes: itelo.tms.ticket.v1.Ticket.Purchased.v1", labeldistance="25", labelangle="-5", minlen="9") >> cloud_integration |
| 60 | + |
| 61 | + cloud_integration >> Edge( |
| 62 | + color=FIX_GREY_COLOUR, minlen="3", style="dashed") >> third_party |
| 63 | + |
| 64 | + # event_mesh >> Edge(color=CONSUMER_COLOUR, penwidth="2.0", reverse=True, |
| 65 | + # headlabel="VIP Package delivery\nConsumes: itelo.tms.ticket.v1.Ticket.Purchased.v1", labeldistance="25", labelangle="-5", minlen="9") >> vip_srvc |
| 66 | + |
71 | 67 | event_mesh >> Edge(color=CONSUMER_COLOUR, penwidth="2.0", reverse=True,
|
72 |
| - headlabel="Physical delivery of ticket\nConsumes: itelo.tms.ticket.v1.Ticket.Bought.v1", labeldistance="25", labelangle="-5", minlen="9") >> mail_delivery_srvc |
73 |
| - |
74 |
| - event_mesh >> Edge( |
75 |
| - color=CONSUMER_COLOUR, penwidth="2.0", headlabel="Webhook - Performer requirement checks\nConsumes: sap.s4.beh.businesspartner.v1.BusinessPartner.Created.v1", labeldistance="25", labelangle="-5", minlen="9") >> sbpa |
| 68 | + headlabel="Physical delivery of ticket\nConsumes: itelo.tms.ticket.v1.Ticket.Purchased.v1", labeldistance="25", labelangle="-5", minlen="9") >> mail_delivery_srvc |
76 | 69 |
|
| 70 | + event_mesh >> Edge( |
| 71 | + color=CONSUMER_COLOUR, penwidth="2.0", headlabel="Webhook - Performer requirement checks\nConsumes: sap.s4.beh.businesspartner.v1.BusinessPartner.Created.v1", labeldistance="25", labelangle="-5", minlen="9") >> webhook_site |
0 commit comments