-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add plantuml parsing for case on 2 disctinct participants are m…
…apped to same entity
- Loading branch information
Showing
4 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<mxfile host="drawio-plugin" agent="5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.102 Safari/537.36" modified="2024-01-18T05:40:09.631Z" version="20.5.3" etag="RrE-26LwG3H3BLW6GpaU" type="embed"><diagram id="diagram_1" name="AWS components"><mxGraphModel dx="2034" dy="2062" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="1"><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="vertex:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda" value="<b>Name</b>: producer-lambda<BR><b>ARN</b>: arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda<BR>-----------<BR><b>CodeSize</b>: 1234<BR><b>Handler</b>: main<BR><b>Layers</b>: 0<BR><b>Memory</b>: 128<BR><b>PackageType</b>: Zip<BR><b>Runtime</b>: go1.x<BR><b>Timeout</b>: 30<BR><b>TracingConfig</b>: {'Mode': 'Active'}<BR><b>Version</b>: $LATEST" style="verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;align=left;pointerEvents=1;shape=mxgraph.aws3.lambda_function;prIcon=server;fillColor=#F58534;gradientColor=none;html=1;" parent="1" vertex="1"><mxGeometry x="-40" y="-202" width="69" height="72" as="geometry"/></mxCell><mxCell id="vertex:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:consumer-lambda" value="<b>Name</b>: consumer-lambda<BR><b>ARN</b>: arn:aws:lambda:eu-west-1:123456789012:function:consumer-lambda" style="verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;align=left;pointerEvents=1;shape=mxgraph.aws3.lambda_function;prIcon=server;fillColor=#F58534;gradientColor=none;html=1;" parent="1" vertex="1"><mxGeometry x="1470" y="-172" width="69" height="72" as="geometry"/></mxCell><mxCell id="vertex:dynamo:arn:aws:dynamodb:eu-west-1:123456789012:table/table1" value="<b>Name</b>: table1<BR><b>ARN</b>: arn:aws:dynamodb:eu-west-1:123456789012:table/table1" style="outlineConnect=0;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;shape=mxgraph.aws3.dynamo_db;fillColor=#2E73B8;gradientColor=none;" parent="1" vertex="1"><mxGeometry x="1470" y="80" width="72" height="81" as="geometry"/></mxCell><mxCell id="vertex:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo" value="<b>Name</b>: internal<BR><b>ARN</b>: arn:aws:sns:eu-west-1:123456789012:internal.fifo<BR>-----------<BR><b>Owner</b>: 123456789<BR><b>SubscriptionsConfirmed</b>: 3<BR><b>SubscriptionsPending</b>: 0" style="sketch=0;outlineConnect=0;fontColor=#232F3E;gradientColor=#FF4F8B;gradientDirection=north;fillColor=#BC1356;strokeColor=#ffffff;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;fontSize=12;fontStyle=0;aspect=fixed;shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.sns;" parent="1" vertex="1"><mxGeometry x="530" y="-470" width="78" height="78" as="geometry"/></mxCell><mxCell id="vertex:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo" value="<b>Name</b>: events<BR><b>ARN</b>: arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo<BR>-----------<BR><b>DelaySeconds</b>: 0<BR><b>FifoQueue</b>: TRUE<BR><b>ReceiveMessageWaitTimeSeconds</b>: 0<BR><b>SqsManagedSseEnabled</b>: false<BR><b>VisibilityTimeout</b>: 30" style="sketch=0;outlineConnect=0;fontColor=#232F3E;gradientColor=#FF4F8B;gradientDirection=north;fillColor=#BC1356;strokeColor=#ffffff;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;fontSize=12;fontStyle=0;aspect=fixed;shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.sqs;" parent="1" vertex="1"><mxGeometry x="1060" y="-80" width="78" height="78" as="geometry"/></mxCell><mxCell id="vertex:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events2.fifo" value="<b>Name</b>: events2<BR><b>ARN</b>: arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events2.fifo" style="sketch=0;outlineConnect=0;fontColor=#232F3E;gradientColor=#FF4F8B;gradientDirection=north;fillColor=#BC1356;strokeColor=#ffffff;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;fontSize=12;fontStyle=0;aspect=fixed;shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.sqs;" parent="1" vertex="1"><mxGeometry x="1060" y="-589" width="78" height="78" as="geometry"/></mxCell><mxCell id="vertex:s3:arn:aws:s3:::bucket_name/key_name" value="<b>Name</b>: key_name<BR><b>ARN</b>: arn:aws:s3:::bucket_name/key_name" style="outlineConnect=0;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;shape=mxgraph.aws3.bucket_with_objects;fillColor=#E05243;gradientColor=none;" parent="1" vertex="1"><mxGeometry x="550" y="60" width="78" height="78" as="geometry"/></mxCell><mxCell id="edge:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda:to:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo" style="jettySize=auto;html=1;startArrow=none;endArrow=none;" parent="1" source="vertex:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda" target="vertex:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo" edge="2"><mxGeometry as="geometry"/></mxCell><mxCell id="edge:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda:to:s3:arn:aws:s3:::bucket_name/key_name" style="jettySize=auto;html=1;startArrow=none;endArrow=none;" parent="1" source="vertex:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda" target="vertex:s3:arn:aws:s3:::bucket_name/key_name" edge="2"><mxGeometry as="geometry"/></mxCell><mxCell id="edge:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo:to:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo" style="jettySize=auto;html=1;startArrow=none;endArrow=none;" parent="1" source="vertex:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo" target="vertex:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo" edge="2"><mxGeometry as="geometry"/></mxCell><mxCell id="edge:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo:to:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events2.fifo" style="jettySize=auto;html=1;startArrow=none;endArrow=none;" parent="1" source="vertex:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo" target="vertex:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events2.fifo" edge="2"><mxGeometry as="geometry"/></mxCell><mxCell id="edge:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo:to:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:consumer-lambda" style="jettySize=auto;html=1;startArrow=none;endArrow=none;" parent="1" source="vertex:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo" target="vertex:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:consumer-lambda" edge="2"><mxGeometry as="geometry"/></mxCell><mxCell id="edge:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:consumer-lambda:to:dynamo:arn:aws:dynamodb:eu-west-1:123456789012:table/table1" style="jettySize=auto;html=1;startArrow=none;endArrow=none;" parent="1" source="vertex:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:consumer-lambda" target="vertex:dynamo:arn:aws:dynamodb:eu-west-1:123456789012:table/table1" edge="2"><mxGeometry x="1510" y="-482" as="geometry"/></mxCell><mxCell id="2" value="same_entity_diff_elements" parent="0"/><mxCell id="vertex:actor:5991ce42" value="<b>Name</b>: Donald" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" parent="2" vertex="1"><mxGeometry x="-440" y="-350" width="30" height="60" as="geometry"/></mxCell><mxCell id="edge_same_entity_diff_elements:actor:5991ce42:to:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda" style="jettySize=auto;html=1;orthogonalLoop=1;edgeStyle=orthogonalEdgeStyle;curved=1;startArrow=oval;endArrow=classicThin;dashed=1;strokeColor=#FF3333;strokeWidth=3;fontSize=22;" parent="2" source="vertex:actor:5991ce42" target="vertex:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda" edge="2"><mxGeometry as="geometry"/></mxCell><mxCell id="label_same_entity_diff_elements:actor:5991ce42:to:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda" value="1: Put new file into S3 bucket<BR><BR>3: Put new file into S3 bucket" style="edgeLabel;html=1;align=left;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=none;fontColor=#FF3333;fontStyle=0;fontSize=14;" parent="edge_same_entity_diff_elements:actor:5991ce42:to:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda" vertex="1" connectable="0"><mxGeometry relative="1" as="geometry"><mxPoint x="-142" y="70" as="offset"/></mxGeometry></mxCell><mxCell id="edge_same_entity_diff_elements:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda:to:s3:arn:aws:s3:::bucket_name/key_name" style="jettySize=auto;html=1;orthogonalLoop=1;edgeStyle=orthogonalEdgeStyle;curved=1;startArrow=oval;endArrow=classicThin;dashed=1;strokeColor=#FF3333;strokeWidth=3;fontSize=22;" parent="2" source="vertex:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda" target="vertex:s3:arn:aws:s3:::bucket_name/key_name" edge="2"><mxGeometry as="geometry"/></mxCell><mxCell id="label_same_entity_diff_elements:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda:to:s3:arn:aws:s3:::bucket_name/key_name" value="2: Put new file into S3 bucket<BR>Single line note on the left" style="edgeLabel;html=1;align=left;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=none;fontColor=#FF3333;fontStyle=0;fontSize=14;" parent="edge_same_entity_diff_elements:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda:to:s3:arn:aws:s3:::bucket_name/key_name" vertex="1" connectable="0"><mxGeometry relative="1" as="geometry"><mxPoint x="27" y="106" as="offset"/></mxGeometry></mxCell><mxCell id="edge_same_entity_diff_elements:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda:to:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo" style="jettySize=auto;html=1;orthogonalLoop=1;edgeStyle=orthogonalEdgeStyle;curved=1;startArrow=oval;endArrow=classicThin;dashed=1;strokeColor=#FF3333;strokeWidth=3;fontSize=22;" parent="2" source="vertex:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda" target="vertex:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo" edge="2"><mxGeometry as="geometry"/></mxCell><mxCell id="label_same_entity_diff_elements:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda:to:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo" value="4: Send Event to SNS that file processing is finished<BR>multiline<BR>note<BR>added on the right" style="edgeLabel;html=1;align=left;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=none;fontColor=#FF3333;fontStyle=0;fontSize=14;" parent="edge_same_entity_diff_elements:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda:to:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo" vertex="1" connectable="0"><mxGeometry relative="1" as="geometry"><mxPoint x="-283" y="-174" as="offset"/></mxGeometry></mxCell><mxCell id="edge_same_entity_diff_elements:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo:to:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo" style="jettySize=auto;html=1;orthogonalLoop=1;edgeStyle=orthogonalEdgeStyle;curved=1;startArrow=oval;endArrow=classicThin;dashed=1;strokeColor=#FF3333;strokeWidth=3;fontSize=22;" parent="2" source="vertex:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo" target="vertex:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo" edge="2"><mxGeometry as="geometry"/></mxCell><mxCell id="label_same_entity_diff_elements:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo:to:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo" value="5: Fanout Event to SQS" style="edgeLabel;html=1;align=left;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=none;fontColor=#FF3333;fontStyle=0;fontSize=14;" parent="edge_same_entity_diff_elements:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo:to:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo" vertex="1" connectable="0"><mxGeometry relative="1" as="geometry"><mxPoint x="40" y="151" as="offset"/></mxGeometry></mxCell></root></mxGraphModel></diagram></mxfile> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from multicloud_diagrams import MultiCloudDiagrams | ||
from samples.samples.aws_service_end_2_end import prepare_end2end | ||
|
||
|
||
def main(): | ||
mcd = MultiCloudDiagrams() | ||
|
||
prefix = 'prod' | ||
prev_file = f'../output/output.{prefix}_plantuml_2_entities.end2end.drawio' | ||
|
||
mcd.read_coords_from_file(prev_file) | ||
prepare_end2end(mcd) | ||
|
||
mcd.read_uml_mappings('same_entity_diff_elements.yaml') | ||
label_style = { | ||
'labelBackgroundColor': 'none', | ||
'fontColor': '#FF3333', | ||
'fontStyle': 0, | ||
'fontSize': 14 | ||
} | ||
style1 = { | ||
'orthogonalLoop': '1', | ||
'edgeStyle': 'orthogonalEdgeStyle', | ||
'curved': '1', | ||
'startArrow': 'oval', | ||
'endArrow': 'classicThin', | ||
'dashed': '1', | ||
'strokeColor': '#FF3333', | ||
'strokeWidth': '3', | ||
'fontSize': '22' | ||
} | ||
mcd.read_uml_from_file('same_entity_diff_elements.plantuml', edge_style=style1, label_style=label_style) | ||
|
||
result_file = f'../output/output.{prefix}_plantuml_2_entities.end2end.drawio' | ||
mcd.export_to_file(result_file) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
@startuml | ||
actor Donald | ||
participant stage1 | ||
participant S3Bucket | ||
participant stage2 | ||
participant SNS | ||
queue SQS | ||
|
||
Donald->>stage1: Put new file into S3 bucket | ||
stage1->>S3Bucket: Put new file into S3 bucket | ||
note left: Single line note on the left | ||
Donald->>stage2: Put new file into S3 bucket | ||
stage2->>SNS: Send Event to SNS that file processing is finished | ||
note right | ||
multiline | ||
note | ||
added on the right | ||
end note | ||
SNS->>SQS: Fanout Event to SQS | ||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
nodes: | ||
- actor: S3Bucket | ||
node_id: s3:arn:aws:s3:::bucket_name/key_name | ||
- actor: stage1 | ||
node_id: lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda | ||
- actor: stage2 | ||
node_id: lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda | ||
- actor: SNS | ||
node_id: sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo | ||
- actor: SQS | ||
node_id: sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo | ||
- actor: Storage | ||
node_id: dynamo:arn:aws:dynamodb:eu-west-1:123456789012:table/table1 |