diff --git a/lombok.config b/lombok.config new file mode 100644 index 0000000..abb3ca1 --- /dev/null +++ b/lombok.config @@ -0,0 +1,3 @@ +lombok.anyConstructor.addConstructorProperties = true +lombok.jacksonized.flagUsage = WARNING +config.stopBubbling = true diff --git a/state_machine_exporter/flow_renderer_plan/html_generator_architecture.md b/state_machine_exporter/flow_renderer_plan/html_generator_architecture.md deleted file mode 100644 index 9bae1fc..0000000 --- a/state_machine_exporter/flow_renderer_plan/html_generator_architecture.md +++ /dev/null @@ -1,101 +0,0 @@ -# Interactive HTML Generator: Architecture & Flow Definition Format - -Following the success of the interactive SVG PoC, this document outlines the proposed architecture for adding an **HTML Generator** to the State Machine Exporter, allowing users to define and visualize specific business flows dynamically. - -## 1. The Flow Definition Format (JSON & JSON Schema) - -To make the interactive HTML generator useful and intuitive, users need a way to define their business flows externally. Rather than reinventing the wheel, we looked at industry standards for defining graph paths, workflows, and execution traces: -* **Workflow Definitions:** Tools like *Amazon States Language (ASL)*, *SCXML*, and *XState* are highly structured but define the *entire* machine's logic. They are too heavy for simply defining a "path" through an existing machine. -* **Trace Formats:** *OpenTelemetry (OTel)* uses "Spans" to represent individual steps forming a "Trace". This is closer to what we want (a history of states). -* **Graph Formats:** The *JSON Graph Format (JGF)* standardizes graph nodes and edges representation but is geared towards raw data modeling rather than human-readable business flows. - -**Conclusion on Format:** We will use a lightweight custom JSON format inspired by execution traces. It is designed to be highly readable for humans defining business flows, relying simply on ordered arrays of State names. - -### JSON Schema for IDE Autocomplete -To make the format truly intuitive and prevent typos, we will publish a **JSON Schema** (`flow-schema.json`). -By referencing this schema, developers writing `flows.json` in IDEs like VS Code or IntelliJ will get **instant autocomplete, hover tooltips, and real-time validation** for fields like `id`, `title`, and `color`. -* *Future Enhancement:* The Java exporter could dynamically generate a project-specific JSON Schema on the fly that hardcodes the allowed `enum` values for the `path` array (e.g., restricted exactly to `"SUBMITTED"`, `"PAID"`, etc.), providing perfect autocomplete for state names! - -### Proposed Schema (`flows.json`) - -```json -{ - "$schema": "./flow-schema.json", - "stateMachine": "click.kamil.examples.statemachine.simple.SimpleEnumStateMachineConfiguration", - "flows": [ - { - "id": "flow-happy-path", - "title": "Happy Path (Success)", - "description": "The standard flow for a successful order: Submitted -> Paid -> Fulfilled.", - "color": "#32CD32", - "path": [ - ".start.", - "SUBMITTED", - "PAID", - "FULFILLED", - ".end." - ] - }, - { - "id": "flow-cancel-post-pay", - "title": "Cancel Post-Payment", - "description": "Order is canceled after payment.", - "color": "#FF6347", - "path": [ - ".start.", - "SUBMITTED", - "PAID", - "CANCELED", - ".end." - ] - } - ] -} -``` - -### Format Details: -* **`$schema`**: Points to the JSON schema for IDE tooling. -* **`stateMachine`**: Links these flows to a specific state machine configuration in the codebase. -* **`id`**: A unique identifier for the flow (used for DOM elements). -* **`title` & `description`**: Rendered in the HTML sidebar for the user. -* **`color` (Optional)**: Allows overriding the default highlight color (e.g., green for success, red for errors). -* **`path`**: An ordered array of **State Names** (acting like an OpenTelemetry trace). - * *Note on Edges:* The user only needs to define the *states* they pass through. The generator will automatically calculate the edges (transitions) between these states to highlight the lines. Special tokens like `.start.` and `.end.` map to the initial and terminal pseudo-states. - -## 2. Robust Error Handling & Input Validation - -Before generating the HTML, the exporter **must validate** that the provided `flows.json` is logically sound against the actual codebase AST. If a user defines a flow that isn't physically possible in the state machine, the tool must fail fast with highly descriptive errors. - -### Validation Rules & Error Handling Strategy: -1. **Schema Validation (Syntax):** - * *Check:* Is the JSON structurally correct (required fields present, correct types)? - * *Error:* "Invalid format in flows.json: 'title' is required for flow 'flow-cancel-post-pay'." -2. **State Existence (Dangling Pointers):** - * *Check:* Every state listed in the `path` array must exist in the parsed `StateMachineModel`. - * *Error:* "Validation Error in 'Happy Path': State 'FULLFILLED' does not exist in StateMachine 'SimpleEnum'. Did you mean 'FULFILLED'?" (implementing a Levenshtein distance check for typos would be excellent here). -3. **Transition Validity (Impossible Paths):** - * *Check:* For every adjacent pair in the `path` array (e.g., `["SUBMITTED", "PAID"]`), the validator must check the `StateMachineModel.getTransitions()` to ensure a valid transition exists where `source == "SUBMITTED"` and `target == "PAID"`. - * *Error:* "Validation Error in 'Happy Path': No transition exists from 'PAID' to 'SUBMITTED'. Please check your state machine configuration." -4. **Ambiguous Transitions (Multiple Edges):** - * *Check:* If multiple transitions exist between the same two states (e.g., two different events trigger a move from A -> B). - * *Handling:* By default, highlight *all* edges between A and B to represent the general path. - * *Future Enhancement:* Expand the JSON format to allow specifying the exact `event` name in the path array (e.g., `["SUBMITTED", {"state": "PAID", "event": "PAY_CREDIT_CARD"}]`) to disambiguate. - -## 3. HTML Generation Strategy - -The HTML Exporter will be a new class implementing the `StateMachineExporter` interface (or a specialized decorator around the `PlantUml` exporter). - -### Steps for Generation: -1. **Generate PlantUML SVG:** First, use the existing PlantUML engine to generate the raw SVG string in memory (using the modern CSS ` - - - - - -
- -
- - - - diff --git a/state_machine_exporter/flow_renderer_plan/interactive_poc2.html b/state_machine_exporter/flow_renderer_plan/interactive_poc2.html deleted file mode 100644 index cfdde38..0000000 --- a/state_machine_exporter/flow_renderer_plan/interactive_poc2.html +++ /dev/null @@ -1,185 +0,0 @@ - - - - -Interactive State Machine Flows PoC 2 - - - - - - -
-
- FULFILLEDCANCELEDPAID2PAID3PAID1HAPPENPAYFULFILLCANCEL [λ]CANCELABCD[λ] (order=0)(order=1)[λ] (order=0)[guard1] (order=1)[λ] (order=2)(order=3)ABCD / λ, action2 -
-
- - - - - - \ No newline at end of file diff --git a/state_machine_exporter/flow_renderer_plan/pocs/poc2_modern_light.html b/state_machine_exporter/flow_renderer_plan/pocs/poc2_modern_light.html deleted file mode 100644 index 9b738a5..0000000 --- a/state_machine_exporter/flow_renderer_plan/pocs/poc2_modern_light.html +++ /dev/null @@ -1,417 +0,0 @@ - - - - - - Final PoC: Real Machine Explorer - - - - - - - - - - -
-
- - - - - - - - - - - - - - START - - - - - PROCESSING - - - - - COMPLETED - - - - - CANCELLED - - - - - - AUDIT_EVENT - - - - - SUBMIT_EVENT - - - - - REACTIVE_EVENT - - - - - EXTERNAL_TRIGGER - - - - - FINISH - - - - - CANCEL_EVENT - - -
-
- - - - diff --git a/state_machine_exporter/src/main/java/click/kamil/springstatemachineexporter/service/ExportService.java b/state_machine_exporter/src/main/java/click/kamil/springstatemachineexporter/service/ExportService.java index c34c841..7219644 100644 --- a/state_machine_exporter/src/main/java/click/kamil/springstatemachineexporter/service/ExportService.java +++ b/state_machine_exporter/src/main/java/click/kamil/springstatemachineexporter/service/ExportService.java @@ -55,6 +55,10 @@ public class ExportService { } public void runExporter(Path inputDir, Path outputDir, List selectedFormats, boolean renderChoicesAsDiamonds, List activeProfiles) throws IOException { + runExporter(inputDir, outputDir, selectedFormats, renderChoicesAsDiamonds, activeProfiles, null, null); + } + + public void runExporter(Path inputDir, Path outputDir, List selectedFormats, boolean renderChoicesAsDiamonds, List activeProfiles, Path flowsOverride, String machineFilter) throws IOException { CodebaseContext context = new CodebaseContext(); context.setActiveProfiles(activeProfiles); context.setSourcepath(List.of(inputDir.toString())); @@ -71,10 +75,11 @@ public class ExportService { } List flows = new ArrayList<>(); - Path flowsFile = inputDir.resolve("flows.json"); - if (!Files.exists(flowsFile)) { + Path flowsFile = flowsOverride != null ? flowsOverride : inputDir.resolve("flows.json"); + if (flowsOverride == null && !Files.exists(flowsFile)) { flowsFile = inputDir.resolve("src/main/resources/flows.json"); } + if (Files.exists(flowsFile)) { log.info("Loading business flows from {}", flowsFile.toAbsolutePath()); try { @@ -88,7 +93,7 @@ public class ExportService { context.scan(inputDir); CodebaseIntelligenceProvider intelligence = new JdtIntelligenceProvider(context, inputDir); - exportAll(context, intelligence, outputDir, selectedFormats, renderChoicesAsDiamonds, flows); + exportAll(context, intelligence, outputDir, selectedFormats, renderChoicesAsDiamonds, flows, machineFilter); } public void runJsonExporter(Path jsonFile, Path outputDir, List selectedFormats) throws IOException { @@ -98,13 +103,14 @@ public class ExportService { generateOutputs(outputDir, result, selectedFormats); } - private void exportAll(CodebaseContext context, CodebaseIntelligenceProvider intelligence, Path outputDir, List selectedFormats, boolean renderChoicesAsDiamonds, List flows) throws IOException { + private void exportAll(CodebaseContext context, CodebaseIntelligenceProvider intelligence, Path outputDir, List selectedFormats, boolean renderChoicesAsDiamonds, List flows, String machineFilter) throws IOException { Set processedLocations = new HashSet<>(); // 1. Find entry point classes (annotated or extending adapter) List entryPoints = context.findEntryPointClasses(TARGET_ANNOTATIONS); for (TypeDeclaration td : entryPoints) { String fqn = context.getFqn(td); + if (machineFilter != null && !fqn.contains(machineFilter)) continue; if (processedLocations.add(fqn)) { processEntryPoint(td, outputDir, context, intelligence, selectedFormats, renderChoicesAsDiamonds, flows); } @@ -118,6 +124,7 @@ public class ExportService { String methodName = m.getName().getIdentifier(); String uniqueId = parentFqn + "#" + methodName; + if (machineFilter != null && !uniqueId.contains(machineFilter)) continue; if (processedLocations.add(uniqueId)) { processBeanMethod(m, outputDir, context, intelligence, selectedFormats, renderChoicesAsDiamonds, flows); } diff --git a/state_machine_exporter/src/test/resources/golden/ComplexStateMachineConfig/ComplexStateMachineConfig.png b/state_machine_exporter/src/test/resources/golden/ComplexStateMachineConfig/ComplexStateMachineConfig.png index fe07a47..0bc4aed 100644 Binary files a/state_machine_exporter/src/test/resources/golden/ComplexStateMachineConfig/ComplexStateMachineConfig.png and b/state_machine_exporter/src/test/resources/golden/ComplexStateMachineConfig/ComplexStateMachineConfig.png differ diff --git a/state_machine_exporter/src/test/resources/golden/ComplexStateMachineConfig/ComplexStateMachineConfig.puml b/state_machine_exporter/src/test/resources/golden/ComplexStateMachineConfig/ComplexStateMachineConfig.puml index 1537e6c..68a57e4 100644 --- a/state_machine_exporter/src/test/resources/golden/ComplexStateMachineConfig/ComplexStateMachineConfig.puml +++ b/state_machine_exporter/src/test/resources/golden/ComplexStateMachineConfig/ComplexStateMachineConfig.puml @@ -2,134 +2,95 @@ !pragma layout smetana hide empty description hide stereotype -state STATE1 -state STATE2 -state STATE3 -state STATE4 -state STATE5 -state STATE6 -state STATE7 -state STATE8 -state STATE9 -state STATE10 -state STATE11 -state STATE12 -state STATE13 -state STATE14 -state STATE15 -state STATE16 -state STATE17 -state STATE18 -state STATE19 -state STATE20 +skinparam state { + BackgroundColor white + BorderColor #94a3b8 + BorderThickness 1 + FontName Inter + FontSize 9 + FontStyle bold + RoundCorner 20 + Padding 1 +} +skinparam shadowing false +skinparam ArrowFontName JetBrains Mono +skinparam ArrowFontSize 8 +skinparam ArrowColor #cbd5e1 +skinparam ArrowThickness 1 +skinparam dpi 110 +skinparam svgLinkTarget _self +state StatesSTATE1 +state StatesSTATE2 +state StatesSTATE3 +state StatesSTATE4 +state StatesSTATE5 +state StatesSTATE6 +state StatesSTATE7 +state StatesSTATE8 +state StatesSTATE9 +state StatesSTATE10 +state StatesSTATE11 +state StatesSTATE12 +state StatesSTATE13 +state StatesSTATE14 +state StatesSTATE15 +state StatesSTATE16 +state StatesSTATE17 +state StatesSTATE18 +state StatesSTATE19 +state StatesSTATE20 - +state StatesSTATE16 <> +state StatesSTATE17 <> +state StatesSTATE18 <> +state StatesSTATE19 <> +state StatesSTATE20 <> +state StatesSTATE11 <> +state StatesSTATE12 <> +state StatesSTATE14 <> +state StatesSTATE9 <> +state StatesSTATE8 <> -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype - -[*] --> STATE1 - -state STATE16 <> -state STATE17 <> -state STATE18 <> -state STATE19 <> -state STATE20 <> -state STATE11 <> -state STATE12 <> -state STATE14 <> -state STATE9 <> -state STATE8 <> - -STATE1 -[#1E90FF,bold]-> STATE2 <> <> : EVENT1 -STATE2 -[#1E90FF,bold]-> STATE3 <> <> : EVENT2 -STATE3 -[#1E90FF,bold]-> STATE4 <> <> : EVENT3 -STATE4 -[#1E90FF,bold]-> STATE5 <> <> : EVENT4 -STATE5 -[#1E90FF,bold]-> STATE6 <> <> : EVENT5 -STATE6 -[#1E90FF,bold]-> STATE7 <> <> : EVENT6 -STATE7 -[#1E90FF,bold]-> STATE8 <> <> : EVENT7 -STATE8 -[#1E90FF,bold]-> STATE9 <> <> : EVENT8 -STATE9 -[#1E90FF,bold]-> STATE10 <> <> : EVENT9 -STATE10 -[#1E90FF,bold]-> STATE11 <> <> : EVENT10 -STATE11 -[#1E90FF,bold]-> STATE12 <> <> : EVENT11 -STATE12 -[#1E90FF,bold]-> STATE13 <> <> : EVENT12 -STATE13 -[#1E90FF,bold]-> STATE14 <> <> : EVENT13 -STATE14 -[#1E90FF,bold]-> STATE15 <> <> : EVENT14 -STATE15 -[#1E90FF,bold]-> STATE16 <> <> : EVENT15 -STATE16 -[#FF6347,bold]-> STATE17 <> : [guardVarEquals("value1")] (order=0) -STATE16 -[#FF6347,bold]-> STATE18 <> : [guardVarEquals("value2")] (order=1) -STATE16 -[#FF6347,bold]-> STATE19 <> : (order=2) -STATE17 -[#4682B4,bold]-> STATE20 <> : [guardEventHeaderEquals("header1","foo")] (order=0) -STATE17 -[#4682B4,bold]-> STATE16 <> : (order=1) -STATE18 -[#32CD32,bold]-> STATE19 <> : [guardVarEquals("value3")] (order=0) -STATE18 -[#32CD32,bold]-> STATE20 <> : (order=1) -STATE19 -[#FFD700,bold]-> STATE1 <> : [guardVarEquals("reset")] (order=0) -STATE19 -[#FFD700,bold]-> STATE20 <> : (order=1) -STATE20 -[#6A5ACD,bold]-> STATE5 <> : [guardEventHeaderEquals("header2","bar")] (order=0) -STATE20 -[#6A5ACD,bold]-> STATE1 <> : (order=1) -STATE11 -[#FF69B4,bold]-> STATE13 <> : [guardVarEquals("goTo13")] (order=0) -STATE11 -[#FF69B4,bold]-> STATE14 <> : [guardVarEquals("goTo14")] (order=1) -STATE11 -[#FF69B4,bold]-> STATE15 <> : (order=2) -STATE12 -[#FF6347,bold]-> STATE10 <> : [guardVarEquals("goBack10")] (order=0) -STATE12 -[#FF6347,bold]-> STATE11 <> : (order=1) -STATE14 -[#4682B4,bold]-> STATE12 <> : [guardVarEquals("loop12")] (order=0) -STATE14 -[#4682B4,bold]-> STATE16 <> : (order=1) -STATE9 -[#32CD32,bold]-> STATE8 <> : [guardVarEquals("stepBack")] (order=0) -STATE9 -[#32CD32,bold]-> STATE7 <> : [guardVarEquals("stepBackMore")] (order=1) -STATE9 -[#32CD32,bold]-> STATE6 <> : (order=2) -STATE8 -[#FFD700,bold]-> STATE9 <> : [guardVarEquals("forward9")] (order=0) -STATE8 -[#FFD700,bold]-> STATE10 <> : (order=1) -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype +StatesSTATE1 -[#1E90FF,bold]-> StatesSTATE2 <> <> : Events.EVENT1 +StatesSTATE2 -[#1E90FF,bold]-> StatesSTATE3 <> <> : Events.EVENT2 +StatesSTATE3 -[#1E90FF,bold]-> StatesSTATE4 <> <> : Events.EVENT3 +StatesSTATE4 -[#1E90FF,bold]-> StatesSTATE5 <> <> : Events.EVENT4 +StatesSTATE5 -[#1E90FF,bold]-> StatesSTATE6 <> <> : Events.EVENT5 +StatesSTATE6 -[#1E90FF,bold]-> StatesSTATE7 <> <> : Events.EVENT6 +StatesSTATE7 -[#1E90FF,bold]-> StatesSTATE8 <> <> : Events.EVENT7 +StatesSTATE8 -[#1E90FF,bold]-> StatesSTATE9 <> <> : Events.EVENT8 +StatesSTATE9 -[#1E90FF,bold]-> StatesSTATE10 <> <> : Events.EVENT9 +StatesSTATE10 -[#1E90FF,bold]-> StatesSTATE11 <> <> : Events.EVENT10 +StatesSTATE11 -[#1E90FF,bold]-> StatesSTATE12 <> <> : Events.EVENT11 +StatesSTATE12 -[#1E90FF,bold]-> StatesSTATE13 <> <> : Events.EVENT12 +StatesSTATE13 -[#1E90FF,bold]-> StatesSTATE14 <> <> : Events.EVENT13 +StatesSTATE14 -[#1E90FF,bold]-> StatesSTATE15 <> <> : Events.EVENT14 +StatesSTATE15 -[#1E90FF,bold]-> StatesSTATE16 <> <> : Events.EVENT15 +StatesSTATE16 -[#FF6347,bold]-> StatesSTATE17 <> : [guardVarEquals("value1")] (order=0) +StatesSTATE16 -[#FF6347,bold]-> StatesSTATE18 <> : [guardVarEquals("value2")] (order=1) +StatesSTATE16 -[#FF6347,bold]-> StatesSTATE19 <> : (order=2) +StatesSTATE17 -[#FF6347,bold]-> StatesSTATE20 <> : [guardEventHeaderEquals("header1","foo")] (order=0) +StatesSTATE17 -[#FF6347,bold]-> StatesSTATE16 <> : (order=1) +StatesSTATE18 -[#FF6347,bold]-> StatesSTATE19 <> : [guardVarEquals("value3")] (order=0) +StatesSTATE18 -[#FF6347,bold]-> StatesSTATE20 <> : (order=1) +StatesSTATE19 -[#FF6347,bold]-> StatesSTATE1 <> : [guardVarEquals("reset")] (order=0) +StatesSTATE19 -[#FF6347,bold]-> StatesSTATE20 <> : (order=1) +StatesSTATE20 -[#FF6347,bold]-> StatesSTATE5 <> : [guardEventHeaderEquals("header2","bar")] (order=0) +StatesSTATE20 -[#FF6347,bold]-> StatesSTATE1 <> : (order=1) +StatesSTATE11 -[#FF6347,bold]-> StatesSTATE13 <> : [guardVarEquals("goTo13")] (order=0) +StatesSTATE11 -[#FF6347,bold]-> StatesSTATE14 <> : [guardVarEquals("goTo14")] (order=1) +StatesSTATE11 -[#FF6347,bold]-> StatesSTATE15 <> : (order=2) +StatesSTATE12 -[#FF6347,bold]-> StatesSTATE10 <> : [guardVarEquals("goBack10")] (order=0) +StatesSTATE12 -[#FF6347,bold]-> StatesSTATE11 <> : (order=1) +StatesSTATE14 -[#FF6347,bold]-> StatesSTATE12 <> : [guardVarEquals("loop12")] (order=0) +StatesSTATE14 -[#FF6347,bold]-> StatesSTATE16 <> : (order=1) +StatesSTATE9 -[#FF6347,bold]-> StatesSTATE8 <> : [guardVarEquals("stepBack")] (order=0) +StatesSTATE9 -[#FF6347,bold]-> StatesSTATE7 <> : [guardVarEquals("stepBackMore")] (order=1) +StatesSTATE9 -[#FF6347,bold]-> StatesSTATE6 <> : (order=2) +StatesSTATE8 -[#FF6347,bold]-> StatesSTATE9 <> : [guardVarEquals("forward9")] (order=0) +StatesSTATE8 -[#FF6347,bold]-> StatesSTATE10 <> : (order=1) @enduml diff --git a/state_machine_exporter/src/test/resources/golden/EnterpriseStateMachineConfig/EnterpriseStateMachineConfig.json b/state_machine_exporter/src/test/resources/golden/EnterpriseStateMachineConfig/EnterpriseStateMachineConfig.json index db0c5c0..f6b41ff 100644 --- a/state_machine_exporter/src/test/resources/golden/EnterpriseStateMachineConfig/EnterpriseStateMachineConfig.json +++ b/state_machine_exporter/src/test/resources/golden/EnterpriseStateMachineConfig/EnterpriseStateMachineConfig.json @@ -51,7 +51,8 @@ "metadata" : { "path" : "/api/enterprise/orders/place", "verb" : "POST" - } + }, + "parameters" : [ ] }, { "type" : "REST", "name" : "POST /api/enterprise/orders/{id}/cancel", @@ -60,7 +61,12 @@ "metadata" : { "path" : "/api/enterprise/orders/{id}/cancel", "verb" : "POST" - } + }, + "parameters" : [ { + "name" : "id", + "type" : "String", + "annotations" : [ "PathVariable" ] + } ] }, { "type" : "CUSTOM", "name" : "INTERCEPTOR: SecurityInterceptor.preHandle", @@ -68,7 +74,8 @@ "methodName" : "preHandle", "metadata" : { "interceptorType" : "Spring MVC Interceptor" - } + }, + "parameters" : [ ] }, { "type" : "REST", "name" : "POST /api/enterprise/payments", @@ -77,7 +84,40 @@ "metadata" : { "path" : "/api/enterprise/payments", "verb" : "POST" - } + }, + "parameters" : [ { + "name" : "orderId", + "type" : "String", + "annotations" : [ "RequestBody" ] + } ] + }, { + "type" : "JMS", + "name" : "JMS: shipping.queue", + "className" : "click.kamil.examples.enterprise.messaging.ShippingJmsListener", + "methodName" : "onShippingReady", + "metadata" : { + "protocol" : "JMS", + "destination" : "shipping.queue" + }, + "parameters" : [ { + "name" : "orderId", + "type" : "String", + "annotations" : [ ] + } ] + }, { + "type" : "RABBIT", + "name" : "RABBIT: returns.queue", + "className" : "click.kamil.examples.enterprise.messaging.ReturnsRabbitListener", + "methodName" : "onReturn", + "metadata" : { + "protocol" : "RABBIT", + "destination" : "returns.queue" + }, + "parameters" : [ { + "name" : "orderId", + "type" : "String", + "annotations" : [ ] + } ] } ], "callChains" : [ { "entryPoint" : { @@ -88,7 +128,8 @@ "metadata" : { "path" : "/api/enterprise/orders/place", "verb" : "POST" - } + }, + "parameters" : [ ] }, "methodChain" : [ "click.kamil.examples.enterprise.api.OrderController.placeOrder", "click.kamil.examples.enterprise.service.OrderServiceImpl.place" ], "triggerPoint" : { @@ -108,7 +149,12 @@ "metadata" : { "path" : "/api/enterprise/orders/{id}/cancel", "verb" : "POST" - } + }, + "parameters" : [ { + "name" : "id", + "type" : "String", + "annotations" : [ "PathVariable" ] + } ] }, "methodChain" : [ "click.kamil.examples.enterprise.api.OrderController.cancelOrder", "click.kamil.examples.enterprise.service.OrderServiceImpl.cancel" ], "triggerPoint" : { @@ -127,7 +173,8 @@ "methodName" : "preHandle", "metadata" : { "interceptorType" : "Spring MVC Interceptor" - } + }, + "parameters" : [ ] }, "methodChain" : [ "click.kamil.examples.enterprise.api.SecurityInterceptor.preHandle" ], "triggerPoint" : { @@ -147,7 +194,12 @@ "metadata" : { "path" : "/api/enterprise/payments", "verb" : "POST" - } + }, + "parameters" : [ { + "name" : "orderId", + "type" : "String", + "annotations" : [ "RequestBody" ] + } ] }, "methodChain" : [ "click.kamil.examples.enterprise.api.ReactivePaymentController.pay", "click.kamil.examples.enterprise.service.ReactivePaymentService.processPayment" ], "triggerPoint" : { @@ -158,6 +210,56 @@ "stateMachineId" : null, "lineNumber" : 18 } + }, { + "entryPoint" : { + "type" : "JMS", + "name" : "JMS: shipping.queue", + "className" : "click.kamil.examples.enterprise.messaging.ShippingJmsListener", + "methodName" : "onShippingReady", + "metadata" : { + "protocol" : "JMS", + "destination" : "shipping.queue" + }, + "parameters" : [ { + "name" : "orderId", + "type" : "String", + "annotations" : [ ] + } ] + }, + "methodChain" : [ "click.kamil.examples.enterprise.messaging.ShippingJmsListener.onShippingReady" ], + "triggerPoint" : { + "event" : "SHIP_ORDER", + "className" : "click.kamil.examples.enterprise.messaging.ShippingJmsListener", + "methodName" : "onShippingReady", + "sourceModule" : null, + "stateMachineId" : null, + "lineNumber" : 17 + } + }, { + "entryPoint" : { + "type" : "RABBIT", + "name" : "RABBIT: returns.queue", + "className" : "click.kamil.examples.enterprise.messaging.ReturnsRabbitListener", + "methodName" : "onReturn", + "metadata" : { + "protocol" : "RABBIT", + "destination" : "returns.queue" + }, + "parameters" : [ { + "name" : "orderId", + "type" : "String", + "annotations" : [ ] + } ] + }, + "methodChain" : [ "click.kamil.examples.enterprise.messaging.ReturnsRabbitListener.onReturn" ], + "triggerPoint" : { + "event" : "RETURN_ORDER", + "className" : "click.kamil.examples.enterprise.messaging.ReturnsRabbitListener", + "methodName" : "onReturn", + "sourceModule" : null, + "stateMachineId" : null, + "lineNumber" : 17 + } } ], "properties" : { } }, diff --git a/state_machine_exporter/src/test/resources/golden/EnterpriseStateMachineConfig/EnterpriseStateMachineConfig.png b/state_machine_exporter/src/test/resources/golden/EnterpriseStateMachineConfig/EnterpriseStateMachineConfig.png index 6b95f17..8214c12 100644 Binary files a/state_machine_exporter/src/test/resources/golden/EnterpriseStateMachineConfig/EnterpriseStateMachineConfig.png and b/state_machine_exporter/src/test/resources/golden/EnterpriseStateMachineConfig/EnterpriseStateMachineConfig.png differ diff --git a/state_machine_exporter/src/test/resources/golden/EnterpriseStateMachineConfig/EnterpriseStateMachineConfig.puml b/state_machine_exporter/src/test/resources/golden/EnterpriseStateMachineConfig/EnterpriseStateMachineConfig.puml index 6c5f98b..a14a4ee 100644 --- a/state_machine_exporter/src/test/resources/golden/EnterpriseStateMachineConfig/EnterpriseStateMachineConfig.puml +++ b/state_machine_exporter/src/test/resources/golden/EnterpriseStateMachineConfig/EnterpriseStateMachineConfig.puml @@ -2,6 +2,23 @@ !pragma layout smetana hide empty description hide stereotype +skinparam state { + BackgroundColor white + BorderColor #94a3b8 + BorderThickness 1 + FontName Inter + FontSize 9 + FontStyle bold + RoundCorner 20 + Padding 1 +} +skinparam shadowing false +skinparam ArrowFontName JetBrains Mono +skinparam ArrowFontSize 8 +skinparam ArrowColor #cbd5e1 +skinparam ArrowThickness 1 +skinparam dpi 110 +skinparam svgLinkTarget _self state NEW state CHECK_AVAILABILITY state PENDING_PAYMENT @@ -11,65 +28,18 @@ state SHIPPED state DELIVERED state RETURNED - - -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype - [*] --> NEW state CHECK_AVAILABILITY <> NEW -[#1E90FF,bold]-> CHECK_AVAILABILITY <> <> : PLACE_ORDER -CHECK_AVAILABILITY -[#FF6347,bold]-> PENDING_PAYMENT <> : [λ] (order=0) -CHECK_AVAILABILITY -[#FF6347,bold]-> CANCELLED <> : (order=1) +CHECK_AVAILABILITY -[#FF6347,bold]-> PENDING_PAYMENT <> : [λ] (order=0) +CHECK_AVAILABILITY -[#FF6347,bold]-> CANCELLED <> : (order=1) PENDING_PAYMENT -[#1E90FF,bold]-> PAID <> <> : PAY_ORDER PAID -[#1E90FF,bold]-> SHIPPED <> <> : SHIP_ORDER SHIPPED -[#1E90FF,bold]-> DELIVERED <> <> : FINALIZE PAID -[#1E90FF,bold]-> CANCELLED <> <> : CANCEL_ORDER DELIVERED -[#1E90FF,bold]-> RETURNED <> <> : RETURN_ORDER -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype CANCELLED --> [*] DELIVERED --> [*] diff --git a/state_machine_exporter/src/test/resources/golden/ExtendedStateMachineConfig/ExtendedStateMachineConfig.json b/state_machine_exporter/src/test/resources/golden/ExtendedStateMachineConfig/ExtendedStateMachineConfig.json index 0c6b2c3..5fd3106 100644 --- a/state_machine_exporter/src/test/resources/golden/ExtendedStateMachineConfig/ExtendedStateMachineConfig.json +++ b/state_machine_exporter/src/test/resources/golden/ExtendedStateMachineConfig/ExtendedStateMachineConfig.json @@ -58,7 +58,8 @@ "metadata" : { "path" : "/api/orders/submit", "verb" : "POST" - } + }, + "parameters" : [ ] }, { "type" : "REST", "name" : "POST /api/orders/cancel", @@ -67,7 +68,8 @@ "metadata" : { "path" : "/api/orders/cancel", "verb" : "POST" - } + }, + "parameters" : [ ] }, { "type" : "REST", "name" : "POST /api/orders/finish", @@ -76,7 +78,8 @@ "metadata" : { "path" : "/api/orders/finish", "verb" : "POST" - } + }, + "parameters" : [ ] }, { "type" : "REST", "name" : "POST /api/orders/resume", @@ -85,7 +88,12 @@ "metadata" : { "path" : "/api/orders/resume", "verb" : "POST" - } + }, + "parameters" : [ { + "name" : "orderId", + "type" : "String", + "annotations" : [ ] + } ] }, { "type" : "REST", "name" : "POST /api/orders/reactive", @@ -94,7 +102,12 @@ "metadata" : { "path" : "/api/orders/reactive", "verb" : "POST" - } + }, + "parameters" : [ { + "name" : "orderId", + "type" : "String", + "annotations" : [ ] + } ] }, { "type" : "CUSTOM", "name" : "INTERCEPTOR: AuditInterceptor.preHandle", @@ -102,7 +115,8 @@ "methodName" : "preHandle", "metadata" : { "interceptorType" : "Spring MVC Interceptor" - } + }, + "parameters" : [ ] } ], "callChains" : [ { "entryPoint" : { @@ -113,7 +127,8 @@ "metadata" : { "path" : "/api/orders/submit", "verb" : "POST" - } + }, + "parameters" : [ ] }, "methodChain" : [ "click.kamil.examples.statemachine.extended.web.OrderController.submitOrder", "click.kamil.examples.statemachine.extended.service.OrderService.processSubmit" ], "triggerPoint" : { @@ -133,7 +148,8 @@ "metadata" : { "path" : "/api/orders/submit", "verb" : "POST" - } + }, + "parameters" : [ ] }, "methodChain" : [ "click.kamil.examples.statemachine.extended.web.OrderController.submitOrder", "click.kamil.examples.statemachine.extended.service.OrderService.processSubmit" ], "triggerPoint" : { @@ -153,7 +169,8 @@ "metadata" : { "path" : "/api/orders/cancel", "verb" : "POST" - } + }, + "parameters" : [ ] }, "methodChain" : [ "click.kamil.examples.statemachine.extended.web.OrderController.cancelOrder", "click.kamil.examples.statemachine.extended.service.OrderService.processCancel" ], "triggerPoint" : { @@ -173,7 +190,8 @@ "metadata" : { "path" : "/api/orders/finish", "verb" : "POST" - } + }, + "parameters" : [ ] }, "methodChain" : [ "click.kamil.examples.statemachine.extended.web.OrderController.finishOrder" ], "triggerPoint" : { @@ -193,7 +211,12 @@ "metadata" : { "path" : "/api/orders/resume", "verb" : "POST" - } + }, + "parameters" : [ { + "name" : "orderId", + "type" : "String", + "annotations" : [ ] + } ] }, "methodChain" : [ "click.kamil.examples.statemachine.extended.web.OrderController.resumeOrder", "click.kamil.examples.statemachine.extended.service.OrderService.resumeOrder" ], "triggerPoint" : { @@ -213,7 +236,12 @@ "metadata" : { "path" : "/api/orders/reactive", "verb" : "POST" - } + }, + "parameters" : [ { + "name" : "orderId", + "type" : "String", + "annotations" : [ ] + } ] }, "methodChain" : [ "click.kamil.examples.statemachine.extended.web.OrderController.reactiveOrder", "click.kamil.examples.statemachine.extended.service.ReactiveOrderService.processReactive" ], "triggerPoint" : { @@ -232,7 +260,8 @@ "methodName" : "preHandle", "metadata" : { "interceptorType" : "Spring MVC Interceptor" - } + }, + "parameters" : [ ] }, "methodChain" : [ "click.kamil.examples.statemachine.extended.web.AuditInterceptor.preHandle" ], "triggerPoint" : { diff --git a/state_machine_exporter/src/test/resources/golden/ExtendedStateMachineConfig/ExtendedStateMachineConfig.png b/state_machine_exporter/src/test/resources/golden/ExtendedStateMachineConfig/ExtendedStateMachineConfig.png index 0c6feee..d6870fd 100644 Binary files a/state_machine_exporter/src/test/resources/golden/ExtendedStateMachineConfig/ExtendedStateMachineConfig.png and b/state_machine_exporter/src/test/resources/golden/ExtendedStateMachineConfig/ExtendedStateMachineConfig.png differ diff --git a/state_machine_exporter/src/test/resources/golden/ExtendedStateMachineConfig/ExtendedStateMachineConfig.puml b/state_machine_exporter/src/test/resources/golden/ExtendedStateMachineConfig/ExtendedStateMachineConfig.puml index ee671a1..6062422 100644 --- a/state_machine_exporter/src/test/resources/golden/ExtendedStateMachineConfig/ExtendedStateMachineConfig.puml +++ b/state_machine_exporter/src/test/resources/golden/ExtendedStateMachineConfig/ExtendedStateMachineConfig.puml @@ -2,52 +2,28 @@ !pragma layout smetana hide empty description hide stereotype +skinparam state { + BackgroundColor white + BorderColor #94a3b8 + BorderThickness 1 + FontName Inter + FontSize 9 + FontStyle bold + RoundCorner 20 + Padding 1 +} +skinparam shadowing false +skinparam ArrowFontName JetBrains Mono +skinparam ArrowFontSize 8 +skinparam ArrowColor #cbd5e1 +skinparam ArrowThickness 1 +skinparam dpi 110 +skinparam svgLinkTarget _self state START state PROCESSING state COMPLETED state CANCELLED - - -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype - [*] --> INIT_STATE @@ -57,12 +33,6 @@ PROCESSING -[#1E90FF,bold]-> CANCELLED <> <> : CANCEL_ START -[#1E90FF,bold]-> PROCESSING <> <> : REACTIVE_EVENT START -[#1E90FF,bold]-> START <> <> : AUDIT_EVENT START -[#1E90FF,bold]-> PROCESSING <> <> : EXTERNAL_TRIGGER -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype CANCELLED --> [*] COMPLETED --> [*] diff --git a/state_machine_exporter/src/test/resources/golden/ExtendedStateMachineConfig_PROD/ExtendedStateMachineConfig.json b/state_machine_exporter/src/test/resources/golden/ExtendedStateMachineConfig_PROD/ExtendedStateMachineConfig.json index 35c6582..aa6e25e 100644 --- a/state_machine_exporter/src/test/resources/golden/ExtendedStateMachineConfig_PROD/ExtendedStateMachineConfig.json +++ b/state_machine_exporter/src/test/resources/golden/ExtendedStateMachineConfig_PROD/ExtendedStateMachineConfig.json @@ -58,7 +58,8 @@ "metadata" : { "path" : "/api/orders/submit", "verb" : "POST" - } + }, + "parameters" : [ ] }, { "type" : "REST", "name" : "POST /api/orders/cancel", @@ -67,7 +68,8 @@ "metadata" : { "path" : "/api/orders/cancel", "verb" : "POST" - } + }, + "parameters" : [ ] }, { "type" : "REST", "name" : "POST /api/orders/finish", @@ -76,7 +78,8 @@ "metadata" : { "path" : "/api/orders/finish", "verb" : "POST" - } + }, + "parameters" : [ ] }, { "type" : "REST", "name" : "POST /api/orders/resume", @@ -85,7 +88,12 @@ "metadata" : { "path" : "/api/orders/resume", "verb" : "POST" - } + }, + "parameters" : [ { + "name" : "orderId", + "type" : "String", + "annotations" : [ ] + } ] }, { "type" : "REST", "name" : "POST /api/orders/reactive", @@ -94,7 +102,12 @@ "metadata" : { "path" : "/api/orders/reactive", "verb" : "POST" - } + }, + "parameters" : [ { + "name" : "orderId", + "type" : "String", + "annotations" : [ ] + } ] }, { "type" : "CUSTOM", "name" : "INTERCEPTOR: AuditInterceptor.preHandle", @@ -102,7 +115,8 @@ "methodName" : "preHandle", "metadata" : { "interceptorType" : "Spring MVC Interceptor" - } + }, + "parameters" : [ ] } ], "callChains" : [ { "entryPoint" : { @@ -113,7 +127,8 @@ "metadata" : { "path" : "/api/orders/submit", "verb" : "POST" - } + }, + "parameters" : [ ] }, "methodChain" : [ "click.kamil.examples.statemachine.extended.web.OrderController.submitOrder", "click.kamil.examples.statemachine.extended.service.OrderService.processSubmit" ], "triggerPoint" : { @@ -133,7 +148,8 @@ "metadata" : { "path" : "/api/orders/submit", "verb" : "POST" - } + }, + "parameters" : [ ] }, "methodChain" : [ "click.kamil.examples.statemachine.extended.web.OrderController.submitOrder", "click.kamil.examples.statemachine.extended.service.OrderService.processSubmit" ], "triggerPoint" : { @@ -153,7 +169,8 @@ "metadata" : { "path" : "/api/orders/cancel", "verb" : "POST" - } + }, + "parameters" : [ ] }, "methodChain" : [ "click.kamil.examples.statemachine.extended.web.OrderController.cancelOrder", "click.kamil.examples.statemachine.extended.service.OrderService.processCancel" ], "triggerPoint" : { @@ -173,7 +190,8 @@ "metadata" : { "path" : "/api/orders/finish", "verb" : "POST" - } + }, + "parameters" : [ ] }, "methodChain" : [ "click.kamil.examples.statemachine.extended.web.OrderController.finishOrder" ], "triggerPoint" : { @@ -193,7 +211,12 @@ "metadata" : { "path" : "/api/orders/resume", "verb" : "POST" - } + }, + "parameters" : [ { + "name" : "orderId", + "type" : "String", + "annotations" : [ ] + } ] }, "methodChain" : [ "click.kamil.examples.statemachine.extended.web.OrderController.resumeOrder", "click.kamil.examples.statemachine.extended.service.OrderService.resumeOrder" ], "triggerPoint" : { @@ -213,7 +236,12 @@ "metadata" : { "path" : "/api/orders/reactive", "verb" : "POST" - } + }, + "parameters" : [ { + "name" : "orderId", + "type" : "String", + "annotations" : [ ] + } ] }, "methodChain" : [ "click.kamil.examples.statemachine.extended.web.OrderController.reactiveOrder", "click.kamil.examples.statemachine.extended.service.ReactiveOrderService.processReactive" ], "triggerPoint" : { @@ -232,7 +260,8 @@ "methodName" : "preHandle", "metadata" : { "interceptorType" : "Spring MVC Interceptor" - } + }, + "parameters" : [ ] }, "methodChain" : [ "click.kamil.examples.statemachine.extended.web.AuditInterceptor.preHandle" ], "triggerPoint" : { diff --git a/state_machine_exporter/src/test/resources/golden/ExtendedStateMachineConfig_PROD/ExtendedStateMachineConfig.png b/state_machine_exporter/src/test/resources/golden/ExtendedStateMachineConfig_PROD/ExtendedStateMachineConfig.png index 8727b0c..94e16ec 100644 Binary files a/state_machine_exporter/src/test/resources/golden/ExtendedStateMachineConfig_PROD/ExtendedStateMachineConfig.png and b/state_machine_exporter/src/test/resources/golden/ExtendedStateMachineConfig_PROD/ExtendedStateMachineConfig.png differ diff --git a/state_machine_exporter/src/test/resources/golden/ExtendedStateMachineConfig_PROD/ExtendedStateMachineConfig.puml b/state_machine_exporter/src/test/resources/golden/ExtendedStateMachineConfig_PROD/ExtendedStateMachineConfig.puml index 79e2ae3..dbe393d 100644 --- a/state_machine_exporter/src/test/resources/golden/ExtendedStateMachineConfig_PROD/ExtendedStateMachineConfig.puml +++ b/state_machine_exporter/src/test/resources/golden/ExtendedStateMachineConfig_PROD/ExtendedStateMachineConfig.puml @@ -2,52 +2,28 @@ !pragma layout smetana hide empty description hide stereotype +skinparam state { + BackgroundColor white + BorderColor #94a3b8 + BorderThickness 1 + FontName Inter + FontSize 9 + FontStyle bold + RoundCorner 20 + Padding 1 +} +skinparam shadowing false +skinparam ArrowFontName JetBrains Mono +skinparam ArrowFontSize 8 +skinparam ArrowColor #cbd5e1 +skinparam ArrowThickness 1 +skinparam dpi 110 +skinparam svgLinkTarget _self state START state PROCESSING state COMPLETED state CANCELLED - - -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype - [*] --> PROD_INITIAL @@ -57,12 +33,6 @@ PROCESSING -[#1E90FF,bold]-> CANCELLED <> <> : CANCEL_ START -[#1E90FF,bold]-> PROCESSING <> <> : REACTIVE_EVENT START -[#1E90FF,bold]-> START <> <> : AUDIT_EVENT START -[#1E90FF,bold]-> PROCESSING <> <> : EXTERNAL_TRIGGER -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype CANCELLED --> [*] COMPLETED --> [*] diff --git a/state_machine_exporter/src/test/resources/golden/F1StateMachineConfiguration/F1StateMachineConfiguration.png b/state_machine_exporter/src/test/resources/golden/F1StateMachineConfiguration/F1StateMachineConfiguration.png index ab9e524..eedb85f 100644 Binary files a/state_machine_exporter/src/test/resources/golden/F1StateMachineConfiguration/F1StateMachineConfiguration.png and b/state_machine_exporter/src/test/resources/golden/F1StateMachineConfiguration/F1StateMachineConfiguration.png differ diff --git a/state_machine_exporter/src/test/resources/golden/F1StateMachineConfiguration/F1StateMachineConfiguration.puml b/state_machine_exporter/src/test/resources/golden/F1StateMachineConfiguration/F1StateMachineConfiguration.puml index 48c76dd..fe13d98 100644 --- a/state_machine_exporter/src/test/resources/golden/F1StateMachineConfiguration/F1StateMachineConfiguration.puml +++ b/state_machine_exporter/src/test/resources/golden/F1StateMachineConfiguration/F1StateMachineConfiguration.puml @@ -2,162 +2,119 @@ !pragma layout smetana hide empty description hide stereotype -state STATE1 -state STATE2 -state STATE3 -state STATE4 -state STATE5 -state STATE6 -state STATE7 -state STATE8 -state STATE9 -state STATE10 -state STATE11 -state STATE12 -state STATE13 -state STATE14 -state STATE15 -state STATE16 -state CANCEL -state STATEY -state STATEX -state STATEZ -state STATE17 -state STATE18 -state STATE19 -state STATE20 -state STATE_EXTRA_1 -state STATE_EXTRA_3 -state STATE_EXTRA_2 +skinparam state { + BackgroundColor white + BorderColor #94a3b8 + BorderThickness 1 + FontName Inter + FontSize 9 + FontStyle bold + RoundCorner 20 + Padding 1 +} +skinparam shadowing false +skinparam ArrowFontName JetBrains Mono +skinparam ArrowFontSize 8 +skinparam ArrowColor #cbd5e1 +skinparam ArrowThickness 1 +skinparam dpi 110 +skinparam svgLinkTarget _self +state StatesSTATE1 +state StatesSTATE2 +state StatesSTATE3 +state StatesSTATE4 +state StatesSTATE5 +state StatesSTATE6 +state StatesSTATE7 +state StatesSTATE8 +state StatesSTATE9 +state StatesSTATE10 +state StatesSTATE11 +state StatesSTATE12 +state StatesSTATE13 +state StatesSTATE14 +state StatesSTATE15 +state StatesSTATE16 +state StatesCANCEL +state StatesSTATEY +state StatesSTATEX +state StatesSTATEZ +state StatesSTATE17 +state StatesSTATE18 +state StatesSTATE19 +state StatesSTATE20 +state StatesSTATE_EXTRA_1 +state StatesSTATE_EXTRA_3 +state StatesSTATE_EXTRA_2 - +state StatesSTATEY <> +state StatesSTATE16 <> +state StatesSTATE17 <> +state StatesSTATE18 <> +state StatesSTATE19 <> +state StatesSTATE20 <> +state StatesSTATE11 <> +state StatesSTATE12 <> +state StatesSTATE14 <> +state StatesSTATE9 <> +state StatesSTATE8 <> +state StatesSTATE2 <> -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype +StatesSTATE1 -[#1E90FF,bold]-> StatesSTATE2 <> <> : Events.EVENT1 +StatesSTATE2 -[#1E90FF,bold]-> StatesSTATE3 <> <> : Events.EVENT2 +StatesSTATE3 -[#1E90FF,bold]-> StatesSTATE4 <> <> : Events.EVENT3 +StatesSTATE4 -[#1E90FF,bold]-> StatesSTATE5 <> <> : Events.EVENT4 +StatesSTATE5 -[#1E90FF,bold]-> StatesSTATE6 <> <> : Events.EVENT5 +StatesSTATE6 -[#1E90FF,bold]-> StatesSTATE7 <> <> : Events.EVENT6 +StatesSTATE7 -[#1E90FF,bold]-> StatesSTATE8 <> <> : Events.EVENT7 +StatesSTATE8 -[#1E90FF,bold]-> StatesSTATE9 <> <> : Events.EVENT8 +StatesSTATE9 -[#1E90FF,bold]-> StatesSTATE10 <> <> : Events.EVENT9 +StatesSTATE10 -[#1E90FF,bold]-> StatesSTATE11 <> <> : Events.EVENT10 +StatesSTATE11 -[#1E90FF,bold]-> StatesSTATE12 <> <> : Events.EVENT11 +StatesSTATE12 -[#1E90FF,bold]-> StatesSTATE13 <> <> : Events.EVENT12 +StatesSTATE13 -[#1E90FF,bold]-> StatesSTATE14 <> <> : Events.EVENT13 +StatesSTATE14 -[#1E90FF,bold]-> StatesSTATE15 <> <> : Events.EVENT14 +StatesSTATE15 -[#1E90FF,bold]-> StatesSTATE16 <> <> : Events.EVENT15 +StatesSTATE1 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE2 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE3 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE4 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE5 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE4 -[#1E90FF,bold]-> StatesSTATEY <> <> : Events.EVENTY +StatesSTATEY -[#FF6347,bold]-> StatesSTATEX <> : [guardVarEquals("value1")] (order=0) +StatesSTATEY -[#FF6347,bold]-> StatesSTATEZ <> : (order=1) +StatesSTATE16 -[#FF6347,bold]-> StatesSTATE17 <> : [guardVarEquals("value1")] (order=0) +StatesSTATE16 -[#FF6347,bold]-> StatesSTATE18 <> : [guardVarEquals("value2")] (order=1) +StatesSTATE16 -[#FF6347,bold]-> StatesSTATE19 <> : (order=2) +StatesSTATE17 -[#FF6347,bold]-> StatesSTATE20 <> : [guardEventHeaderEquals("header1","foo")] (order=0) +StatesSTATE17 -[#FF6347,bold]-> StatesSTATE16 <> : (order=1) +StatesSTATE18 -[#FF6347,bold]-> StatesSTATE19 <> : [guardVarEquals("value3")] (order=0) +StatesSTATE18 -[#FF6347,bold]-> StatesSTATE20 <> : (order=1) +StatesSTATE19 -[#FF6347,bold]-> StatesSTATE1 <> : [guardVarEquals("reset")] (order=0) +StatesSTATE19 -[#FF6347,bold]-> StatesSTATE20 <> : (order=1) +StatesSTATE20 -[#FF6347,bold]-> StatesSTATE5 <> : [guardEventHeaderEquals("header2","bar")] (order=0) +StatesSTATE20 -[#FF6347,bold]-> StatesSTATE1 <> : (order=1) +StatesSTATE11 -[#FF6347,bold]-> StatesSTATE13 <> : [guardVarEquals("goTo13")] (order=0) +StatesSTATE11 -[#FF6347,bold]-> StatesSTATE14 <> : [guardVarEquals("goTo14")] (order=1) +StatesSTATE11 -[#FF6347,bold]-> StatesSTATE15 <> : (order=2) +StatesSTATE12 -[#FF6347,bold]-> StatesSTATE10 <> : [guardVarEquals("goBack10")] (order=0) +StatesSTATE12 -[#FF6347,bold]-> StatesSTATE11 <> : (order=1) +StatesSTATE14 -[#FF6347,bold]-> StatesSTATE12 <> : [guardVarEquals("loop12")] (order=0) +StatesSTATE14 -[#FF6347,bold]-> StatesSTATE16 <> : (order=1) +StatesSTATE9 -[#FF6347,bold]-> StatesSTATE8 <> : [guardVarEquals("stepBack")] (order=0) +StatesSTATE9 -[#FF6347,bold]-> StatesSTATE7 <> : [guardVarEquals("stepBackMore")] (order=1) +StatesSTATE9 -[#FF6347,bold]-> StatesSTATE6 <> : (order=2) +StatesSTATE8 -[#FF6347,bold]-> StatesSTATE9 <> : [guardVarEquals("forward9")] (order=0) +StatesSTATE8 -[#FF6347,bold]-> StatesSTATE10 <> : (order=1) +StatesSTATE2 -[#1E90FF,bold]-> StatesSTATE_EXTRA_1 <> <> : Events.EVENTX +StatesSTATE2 -[#FF6347,bold]-> StatesSTATE1 <> : [guardEventHeaderEquals("header1","foo")] (order=0) +StatesSTATE2 -[#FF6347,bold]-> StatesSTATE_EXTRA_1 <> : (order=1) +StatesSTATE_EXTRA_1 -[#1E90FF,bold]-> StatesSTATE_EXTRA_3 <> <> : Events.EVENTY +StatesSTATE_EXTRA_1 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL_2 +StatesSTATE_EXTRA_2 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL_2 -[*] --> STATE1 - -state STATEY <> -state STATE16 <> -state STATE17 <> -state STATE18 <> -state STATE19 <> -state STATE20 <> -state STATE11 <> -state STATE12 <> -state STATE14 <> -state STATE9 <> -state STATE8 <> -state STATE2 <> - -STATE1 -[#1E90FF,bold]-> STATE2 <> <> : EVENT1 -STATE2 -[#1E90FF,bold]-> STATE3 <> <> : EVENT2 -STATE3 -[#1E90FF,bold]-> STATE4 <> <> : EVENT3 -STATE4 -[#1E90FF,bold]-> STATE5 <> <> : EVENT4 -STATE5 -[#1E90FF,bold]-> STATE6 <> <> : EVENT5 -STATE6 -[#1E90FF,bold]-> STATE7 <> <> : EVENT6 -STATE7 -[#1E90FF,bold]-> STATE8 <> <> : EVENT7 -STATE8 -[#1E90FF,bold]-> STATE9 <> <> : EVENT8 -STATE9 -[#1E90FF,bold]-> STATE10 <> <> : EVENT9 -STATE10 -[#1E90FF,bold]-> STATE11 <> <> : EVENT10 -STATE11 -[#1E90FF,bold]-> STATE12 <> <> : EVENT11 -STATE12 -[#1E90FF,bold]-> STATE13 <> <> : EVENT12 -STATE13 -[#1E90FF,bold]-> STATE14 <> <> : EVENT13 -STATE14 -[#1E90FF,bold]-> STATE15 <> <> : EVENT14 -STATE15 -[#1E90FF,bold]-> STATE16 <> <> : EVENT15 -STATE1 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE2 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE3 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE4 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE5 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE4 -[#1E90FF,bold]-> STATEY <> <> : EVENTY -STATEY -[#FF6347,bold]-> STATEX <> : [guardVarEquals("value1")] (order=0) -STATEY -[#FF6347,bold]-> STATEZ <> : (order=1) -STATE16 -[#4682B4,bold]-> STATE17 <> : [guardVarEquals("value1")] (order=0) -STATE16 -[#4682B4,bold]-> STATE18 <> : [guardVarEquals("value2")] (order=1) -STATE16 -[#4682B4,bold]-> STATE19 <> : (order=2) -STATE17 -[#32CD32,bold]-> STATE20 <> : [guardEventHeaderEquals("header1","foo")] (order=0) -STATE17 -[#32CD32,bold]-> STATE16 <> : (order=1) -STATE18 -[#FFD700,bold]-> STATE19 <> : [guardVarEquals("value3")] (order=0) -STATE18 -[#FFD700,bold]-> STATE20 <> : (order=1) -STATE19 -[#6A5ACD,bold]-> STATE1 <> : [guardVarEquals("reset")] (order=0) -STATE19 -[#6A5ACD,bold]-> STATE20 <> : (order=1) -STATE20 -[#FF69B4,bold]-> STATE5 <> : [guardEventHeaderEquals("header2","bar")] (order=0) -STATE20 -[#FF69B4,bold]-> STATE1 <> : (order=1) -STATE11 -[#FF6347,bold]-> STATE13 <> : [guardVarEquals("goTo13")] (order=0) -STATE11 -[#FF6347,bold]-> STATE14 <> : [guardVarEquals("goTo14")] (order=1) -STATE11 -[#FF6347,bold]-> STATE15 <> : (order=2) -STATE12 -[#4682B4,bold]-> STATE10 <> : [guardVarEquals("goBack10")] (order=0) -STATE12 -[#4682B4,bold]-> STATE11 <> : (order=1) -STATE14 -[#32CD32,bold]-> STATE12 <> : [guardVarEquals("loop12")] (order=0) -STATE14 -[#32CD32,bold]-> STATE16 <> : (order=1) -STATE9 -[#FFD700,bold]-> STATE8 <> : [guardVarEquals("stepBack")] (order=0) -STATE9 -[#FFD700,bold]-> STATE7 <> : [guardVarEquals("stepBackMore")] (order=1) -STATE9 -[#FFD700,bold]-> STATE6 <> : (order=2) -STATE8 -[#6A5ACD,bold]-> STATE9 <> : [guardVarEquals("forward9")] (order=0) -STATE8 -[#6A5ACD,bold]-> STATE10 <> : (order=1) -STATE2 -[#1E90FF,bold]-> STATE_EXTRA_1 <> <> : EVENTX -STATE2 -[#FF69B4,bold]-> STATE1 <> : [guardEventHeaderEquals("header1","foo")] (order=0) -STATE2 -[#FF69B4,bold]-> STATE_EXTRA_1 <> : (order=1) -STATE_EXTRA_1 -[#1E90FF,bold]-> STATE_EXTRA_3 <> <> : EVENTY -STATE_EXTRA_1 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL_2 -STATE_EXTRA_2 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL_2 -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype - -STATEZ --> [*] +StatesSTATEZ --> [*] @enduml diff --git a/state_machine_exporter/src/test/resources/golden/F2StateMachineConfiguration/F2StateMachineConfiguration.png b/state_machine_exporter/src/test/resources/golden/F2StateMachineConfiguration/F2StateMachineConfiguration.png index 98496bf..85f697a 100644 Binary files a/state_machine_exporter/src/test/resources/golden/F2StateMachineConfiguration/F2StateMachineConfiguration.png and b/state_machine_exporter/src/test/resources/golden/F2StateMachineConfiguration/F2StateMachineConfiguration.png differ diff --git a/state_machine_exporter/src/test/resources/golden/F2StateMachineConfiguration/F2StateMachineConfiguration.puml b/state_machine_exporter/src/test/resources/golden/F2StateMachineConfiguration/F2StateMachineConfiguration.puml index eba1b78..4737e9b 100644 --- a/state_machine_exporter/src/test/resources/golden/F2StateMachineConfiguration/F2StateMachineConfiguration.puml +++ b/state_machine_exporter/src/test/resources/golden/F2StateMachineConfiguration/F2StateMachineConfiguration.puml @@ -2,165 +2,121 @@ !pragma layout smetana hide empty description hide stereotype -state STATE1 -state STATE2 -state STATE3 -state STATE4 -state STATE5 -state STATE6 -state STATE7 -state STATE8 -state STATE9 -state STATE10 -state STATE11 -state STATE12 -state STATE13 -state STATE14 -state STATE15 -state STATE16 -state CANCEL -state STATEY -state STATEX -state STATEZ -state STATE17 -state STATE18 -state STATE19 -state STATE20 -state STATE_EXTRA_1_1 -state STATE_EXTRA_1_2 -state STATE_EXTRA_1_3 -state STATE_EXTRA_1 +skinparam state { + BackgroundColor white + BorderColor #94a3b8 + BorderThickness 1 + FontName Inter + FontSize 9 + FontStyle bold + RoundCorner 20 + Padding 1 +} +skinparam shadowing false +skinparam ArrowFontName JetBrains Mono +skinparam ArrowFontSize 8 +skinparam ArrowColor #cbd5e1 +skinparam ArrowThickness 1 +skinparam dpi 110 +skinparam svgLinkTarget _self +state StatesSTATE1 +state StatesSTATE2 +state StatesSTATE3 +state StatesSTATE4 +state StatesSTATE5 +state StatesSTATE6 +state StatesSTATE7 +state StatesSTATE8 +state StatesSTATE9 +state StatesSTATE10 +state StatesSTATE11 +state StatesSTATE12 +state StatesSTATE13 +state StatesSTATE14 +state StatesSTATE15 +state StatesSTATE16 +state StatesCANCEL +state StatesSTATEY +state StatesSTATEX +state StatesSTATEZ +state StatesSTATE17 +state StatesSTATE18 +state StatesSTATE19 +state StatesSTATE20 +state StatesSTATE_EXTRA_1_1 +state StatesSTATE_EXTRA_1_2 +state StatesSTATE_EXTRA_1_3 +state StatesSTATE_EXTRA_1 - +state StatesSTATEY <> +state StatesSTATE16 <> +state StatesSTATE17 <> +state StatesSTATE18 <> +state StatesSTATE19 <> +state StatesSTATE20 <> +state StatesSTATE11 <> +state StatesSTATE12 <> +state StatesSTATE14 <> +state StatesSTATE9 <> +state StatesSTATE8 <> +state StatesSTATE_EXTRA_1_2 <> -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype +StatesSTATE1 -[#1E90FF,bold]-> StatesSTATE2 <> <> : Events.EVENT1 +StatesSTATE2 -[#1E90FF,bold]-> StatesSTATE3 <> <> : Events.EVENT2 +StatesSTATE3 -[#1E90FF,bold]-> StatesSTATE4 <> <> : Events.EVENT3 +StatesSTATE4 -[#1E90FF,bold]-> StatesSTATE5 <> <> : Events.EVENT4 +StatesSTATE5 -[#1E90FF,bold]-> StatesSTATE6 <> <> : Events.EVENT5 +StatesSTATE6 -[#1E90FF,bold]-> StatesSTATE7 <> <> : Events.EVENT6 +StatesSTATE7 -[#1E90FF,bold]-> StatesSTATE8 <> <> : Events.EVENT7 +StatesSTATE8 -[#1E90FF,bold]-> StatesSTATE9 <> <> : Events.EVENT8 +StatesSTATE9 -[#1E90FF,bold]-> StatesSTATE10 <> <> : Events.EVENT9 +StatesSTATE10 -[#1E90FF,bold]-> StatesSTATE11 <> <> : Events.EVENT10 +StatesSTATE11 -[#1E90FF,bold]-> StatesSTATE12 <> <> : Events.EVENT11 +StatesSTATE12 -[#1E90FF,bold]-> StatesSTATE13 <> <> : Events.EVENT12 +StatesSTATE13 -[#1E90FF,bold]-> StatesSTATE14 <> <> : Events.EVENT13 +StatesSTATE14 -[#1E90FF,bold]-> StatesSTATE15 <> <> : Events.EVENT14 +StatesSTATE15 -[#1E90FF,bold]-> StatesSTATE16 <> <> : Events.EVENT15 +StatesSTATE1 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE2 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE3 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE4 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE5 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE4 -[#1E90FF,bold]-> StatesSTATEY <> <> : Events.EVENTY +StatesSTATEY -[#FF6347,bold]-> StatesSTATEX <> : [guardVarEquals("value1")] (order=0) +StatesSTATEY -[#FF6347,bold]-> StatesSTATEZ <> : (order=1) +StatesSTATE16 -[#FF6347,bold]-> StatesSTATE17 <> : [guardVarEquals("value1")] (order=0) +StatesSTATE16 -[#FF6347,bold]-> StatesSTATE18 <> : [guardVarEquals("value2")] (order=1) +StatesSTATE16 -[#FF6347,bold]-> StatesSTATE19 <> : (order=2) +StatesSTATE17 -[#FF6347,bold]-> StatesSTATE20 <> : [guardEventHeaderEquals("header1","foo")] (order=0) +StatesSTATE17 -[#FF6347,bold]-> StatesSTATE16 <> : (order=1) +StatesSTATE18 -[#FF6347,bold]-> StatesSTATE19 <> : [guardVarEquals("value3")] (order=0) +StatesSTATE18 -[#FF6347,bold]-> StatesSTATE20 <> : (order=1) +StatesSTATE19 -[#FF6347,bold]-> StatesSTATE1 <> : [guardVarEquals("reset")] (order=0) +StatesSTATE19 -[#FF6347,bold]-> StatesSTATE20 <> : (order=1) +StatesSTATE20 -[#FF6347,bold]-> StatesSTATE5 <> : [guardEventHeaderEquals("header2","bar")] (order=0) +StatesSTATE20 -[#FF6347,bold]-> StatesSTATE1 <> : (order=1) +StatesSTATE11 -[#FF6347,bold]-> StatesSTATE13 <> : [guardVarEquals("goTo13")] (order=0) +StatesSTATE11 -[#FF6347,bold]-> StatesSTATE14 <> : [guardVarEquals("goTo14")] (order=1) +StatesSTATE11 -[#FF6347,bold]-> StatesSTATE15 <> : (order=2) +StatesSTATE12 -[#FF6347,bold]-> StatesSTATE10 <> : [guardVarEquals("goBack10")] (order=0) +StatesSTATE12 -[#FF6347,bold]-> StatesSTATE11 <> : (order=1) +StatesSTATE14 -[#FF6347,bold]-> StatesSTATE12 <> : [guardVarEquals("loop12")] (order=0) +StatesSTATE14 -[#FF6347,bold]-> StatesSTATE16 <> : (order=1) +StatesSTATE9 -[#FF6347,bold]-> StatesSTATE8 <> : [guardVarEquals("stepBack")] (order=0) +StatesSTATE9 -[#FF6347,bold]-> StatesSTATE7 <> : [guardVarEquals("stepBackMore")] (order=1) +StatesSTATE9 -[#FF6347,bold]-> StatesSTATE6 <> : (order=2) +StatesSTATE8 -[#FF6347,bold]-> StatesSTATE9 <> : [guardVarEquals("forward9")] (order=0) +StatesSTATE8 -[#FF6347,bold]-> StatesSTATE10 <> : (order=1) +StatesSTATE9 -[#1E90FF,bold]-> StatesSTATE_EXTRA_1_1 <> <> : Events.EVENT_1_1 +StatesSTATE_EXTRA_1_2 -[#FF6347,bold]-> StatesSTATE_EXTRA_1_1 <> : [guardEventHeaderEquals("header1","foo")] (order=0) +StatesSTATE_EXTRA_1_2 -[#FF6347,bold]-> StatesSTATE_EXTRA_1_3 <> : (order=1) +StatesSTATE_EXTRA_1_3 -[#1E90FF,bold]-> StatesSTATE_EXTRA_1 <> <> : Events.EVENT_1_2 +StatesSTATE_EXTRA_1_1 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL_2 +StatesSTATE_EXTRA_1_2 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL_2 +StatesSTATE_EXTRA_1 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL_2 -[*] --> STATE1 - -state STATEY <> -state STATE16 <> -state STATE17 <> -state STATE18 <> -state STATE19 <> -state STATE20 <> -state STATE11 <> -state STATE12 <> -state STATE14 <> -state STATE9 <> -state STATE8 <> -state STATE_EXTRA_1_2 <> - -STATE1 -[#1E90FF,bold]-> STATE2 <> <> : EVENT1 -STATE2 -[#1E90FF,bold]-> STATE3 <> <> : EVENT2 -STATE3 -[#1E90FF,bold]-> STATE4 <> <> : EVENT3 -STATE4 -[#1E90FF,bold]-> STATE5 <> <> : EVENT4 -STATE5 -[#1E90FF,bold]-> STATE6 <> <> : EVENT5 -STATE6 -[#1E90FF,bold]-> STATE7 <> <> : EVENT6 -STATE7 -[#1E90FF,bold]-> STATE8 <> <> : EVENT7 -STATE8 -[#1E90FF,bold]-> STATE9 <> <> : EVENT8 -STATE9 -[#1E90FF,bold]-> STATE10 <> <> : EVENT9 -STATE10 -[#1E90FF,bold]-> STATE11 <> <> : EVENT10 -STATE11 -[#1E90FF,bold]-> STATE12 <> <> : EVENT11 -STATE12 -[#1E90FF,bold]-> STATE13 <> <> : EVENT12 -STATE13 -[#1E90FF,bold]-> STATE14 <> <> : EVENT13 -STATE14 -[#1E90FF,bold]-> STATE15 <> <> : EVENT14 -STATE15 -[#1E90FF,bold]-> STATE16 <> <> : EVENT15 -STATE1 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE2 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE3 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE4 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE5 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE4 -[#1E90FF,bold]-> STATEY <> <> : EVENTY -STATEY -[#FF6347,bold]-> STATEX <> : [guardVarEquals("value1")] (order=0) -STATEY -[#FF6347,bold]-> STATEZ <> : (order=1) -STATE16 -[#4682B4,bold]-> STATE17 <> : [guardVarEquals("value1")] (order=0) -STATE16 -[#4682B4,bold]-> STATE18 <> : [guardVarEquals("value2")] (order=1) -STATE16 -[#4682B4,bold]-> STATE19 <> : (order=2) -STATE17 -[#32CD32,bold]-> STATE20 <> : [guardEventHeaderEquals("header1","foo")] (order=0) -STATE17 -[#32CD32,bold]-> STATE16 <> : (order=1) -STATE18 -[#FFD700,bold]-> STATE19 <> : [guardVarEquals("value3")] (order=0) -STATE18 -[#FFD700,bold]-> STATE20 <> : (order=1) -STATE19 -[#6A5ACD,bold]-> STATE1 <> : [guardVarEquals("reset")] (order=0) -STATE19 -[#6A5ACD,bold]-> STATE20 <> : (order=1) -STATE20 -[#FF69B4,bold]-> STATE5 <> : [guardEventHeaderEquals("header2","bar")] (order=0) -STATE20 -[#FF69B4,bold]-> STATE1 <> : (order=1) -STATE11 -[#FF6347,bold]-> STATE13 <> : [guardVarEquals("goTo13")] (order=0) -STATE11 -[#FF6347,bold]-> STATE14 <> : [guardVarEquals("goTo14")] (order=1) -STATE11 -[#FF6347,bold]-> STATE15 <> : (order=2) -STATE12 -[#4682B4,bold]-> STATE10 <> : [guardVarEquals("goBack10")] (order=0) -STATE12 -[#4682B4,bold]-> STATE11 <> : (order=1) -STATE14 -[#32CD32,bold]-> STATE12 <> : [guardVarEquals("loop12")] (order=0) -STATE14 -[#32CD32,bold]-> STATE16 <> : (order=1) -STATE9 -[#FFD700,bold]-> STATE8 <> : [guardVarEquals("stepBack")] (order=0) -STATE9 -[#FFD700,bold]-> STATE7 <> : [guardVarEquals("stepBackMore")] (order=1) -STATE9 -[#FFD700,bold]-> STATE6 <> : (order=2) -STATE8 -[#6A5ACD,bold]-> STATE9 <> : [guardVarEquals("forward9")] (order=0) -STATE8 -[#6A5ACD,bold]-> STATE10 <> : (order=1) -STATE9 -[#1E90FF,bold]-> STATE_EXTRA_1_1 <> <> : EVENT_1_1 -STATE_EXTRA_1_2 -[#FF69B4,bold]-> STATE_EXTRA_1_1 <> : [guardEventHeaderEquals("header1","foo")] (order=0) -STATE_EXTRA_1_2 -[#FF69B4,bold]-> STATE_EXTRA_1_3 <> : (order=1) -STATE_EXTRA_1_3 -[#1E90FF,bold]-> STATE_EXTRA_1 <> <> : EVENT_1_2 -STATE_EXTRA_1_1 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL_2 -STATE_EXTRA_1_2 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL_2 -STATE_EXTRA_1 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL_2 -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype - -STATEZ --> [*] +StatesSTATEZ --> [*] @enduml diff --git a/state_machine_exporter/src/test/resources/golden/ForkJoinStateMachineConfig/ForkJoinStateMachineConfig.png b/state_machine_exporter/src/test/resources/golden/ForkJoinStateMachineConfig/ForkJoinStateMachineConfig.png index 8ea820b..76b86c4 100644 Binary files a/state_machine_exporter/src/test/resources/golden/ForkJoinStateMachineConfig/ForkJoinStateMachineConfig.png and b/state_machine_exporter/src/test/resources/golden/ForkJoinStateMachineConfig/ForkJoinStateMachineConfig.png differ diff --git a/state_machine_exporter/src/test/resources/golden/ForkJoinStateMachineConfig/ForkJoinStateMachineConfig.puml b/state_machine_exporter/src/test/resources/golden/ForkJoinStateMachineConfig/ForkJoinStateMachineConfig.puml index a93ce68..81952a6 100644 --- a/state_machine_exporter/src/test/resources/golden/ForkJoinStateMachineConfig/ForkJoinStateMachineConfig.puml +++ b/state_machine_exporter/src/test/resources/golden/ForkJoinStateMachineConfig/ForkJoinStateMachineConfig.puml @@ -2,72 +2,44 @@ !pragma layout smetana hide empty description hide stereotype -state START -state FORK -state REGION1_STATE1 -state REGION2_STATE1 -state REGION1_STATE2 -state REGION2_STATE2 -state JOIN -state END +skinparam state { + BackgroundColor white + BorderColor #94a3b8 + BorderThickness 1 + FontName Inter + FontSize 9 + FontStyle bold + RoundCorner 20 + Padding 1 +} +skinparam shadowing false +skinparam ArrowFontName JetBrains Mono +skinparam ArrowFontSize 8 +skinparam ArrowColor #cbd5e1 +skinparam ArrowThickness 1 +skinparam dpi 110 +skinparam svgLinkTarget _self +state StatesSTART +state StatesFORK +state StatesREGION1_STATE1 +state StatesREGION2_STATE1 +state StatesREGION1_STATE2 +state StatesREGION2_STATE2 +state StatesJOIN +state StatesEND - - -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype - -[*] --> START +[*] --> StatesSTART -START -[#1E90FF,bold]-> FORK <> <> : TO_FORK -FORK -[#20B2AA,bold]-> REGION1_STATE1 <> -FORK -[#20B2AA,bold]-> REGION2_STATE1 <> -REGION1_STATE1 -[#1E90FF,bold]-> REGION1_STATE2 <> <> : R1_NEXT -REGION2_STATE1 -[#1E90FF,bold]-> REGION2_STATE2 <> <> : R2_NEXT -REGION1_STATE2 -[#8A2BE2,bold]-> JOIN <> -REGION2_STATE2 -[#8A2BE2,bold]-> JOIN <> -JOIN -[#1E90FF,bold]-> END <> <> : TO_END -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype +StatesSTART -[#1E90FF,bold]-> StatesFORK <> <> : Events.TO_FORK +StatesFORK -[#20B2AA,bold]-> StatesREGION1_STATE1 <> +StatesFORK -[#20B2AA,bold]-> StatesREGION2_STATE1 <> +StatesREGION1_STATE1 -[#1E90FF,bold]-> StatesREGION1_STATE2 <> <> : Events.R1_NEXT +StatesREGION2_STATE1 -[#1E90FF,bold]-> StatesREGION2_STATE2 <> <> : Events.R2_NEXT +StatesREGION1_STATE2 -[#8A2BE2,bold]-> StatesJOIN <> +StatesREGION2_STATE2 -[#8A2BE2,bold]-> StatesJOIN <> +StatesJOIN -[#1E90FF,bold]-> StatesEND <> <> : Events.TO_END -END --> [*] +StatesEND --> [*] @enduml diff --git a/state_machine_exporter/src/test/resources/golden/G1StateMachineConfiguration/G1StateMachineConfiguration.png b/state_machine_exporter/src/test/resources/golden/G1StateMachineConfiguration/G1StateMachineConfiguration.png index 49383e3..696eef5 100644 Binary files a/state_machine_exporter/src/test/resources/golden/G1StateMachineConfiguration/G1StateMachineConfiguration.png and b/state_machine_exporter/src/test/resources/golden/G1StateMachineConfiguration/G1StateMachineConfiguration.png differ diff --git a/state_machine_exporter/src/test/resources/golden/G1StateMachineConfiguration/G1StateMachineConfiguration.puml b/state_machine_exporter/src/test/resources/golden/G1StateMachineConfiguration/G1StateMachineConfiguration.puml index 89b0596..6acab28 100644 --- a/state_machine_exporter/src/test/resources/golden/G1StateMachineConfiguration/G1StateMachineConfiguration.puml +++ b/state_machine_exporter/src/test/resources/golden/G1StateMachineConfiguration/G1StateMachineConfiguration.puml @@ -2,108 +2,72 @@ !pragma layout smetana hide empty description hide stereotype -state STATE1 -state STATE2 -state STATE3 -state STATE4 -state STATE5 -state STATE6 -state STATE7 -state STATE8 -state STATE9 -state STATE10 -state CANCEL -state STATEY -state STATEX -state STATEZ -state STATE_EXTRA_2 -state STATE_EXTRA_3 +skinparam state { + BackgroundColor white + BorderColor #94a3b8 + BorderThickness 1 + FontName Inter + FontSize 9 + FontStyle bold + RoundCorner 20 + Padding 1 +} +skinparam shadowing false +skinparam ArrowFontName JetBrains Mono +skinparam ArrowFontSize 8 +skinparam ArrowColor #cbd5e1 +skinparam ArrowThickness 1 +skinparam dpi 110 +skinparam svgLinkTarget _self +state StatesSTATE1 +state StatesSTATE2 +state StatesSTATE3 +state StatesSTATE4 +state StatesSTATE5 +state StatesSTATE6 +state StatesSTATE7 +state StatesSTATE8 +state StatesSTATE9 +state StatesSTATE10 +state StatesCANCEL +state StatesSTATEY +state StatesSTATEX +state StatesSTATEZ +state StatesSTATE_EXTRA_2 +state StatesSTATE_EXTRA_3 - +state StatesSTATEY <> +state StatesSTATE9 <> +state StatesSTATE8 <> -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype +StatesSTATE1 -[#1E90FF,bold]-> StatesSTATE2 <> <> : Events.EVENT1 +StatesSTATE2 -[#1E90FF,bold]-> StatesSTATE3 <> <> : Events.EVENT2 +StatesSTATE3 -[#1E90FF,bold]-> StatesSTATE4 <> <> : Events.EVENT3 +StatesSTATE4 -[#1E90FF,bold]-> StatesSTATE5 <> <> : Events.EVENT4 +StatesSTATE5 -[#1E90FF,bold]-> StatesSTATE6 <> <> : Events.EVENT5 +StatesSTATE6 -[#1E90FF,bold]-> StatesSTATE7 <> <> : Events.EVENT6 +StatesSTATE7 -[#1E90FF,bold]-> StatesSTATE8 <> <> : Events.EVENT7 +StatesSTATE8 -[#1E90FF,bold]-> StatesSTATE9 <> <> : Events.EVENT8 +StatesSTATE9 -[#1E90FF,bold]-> StatesSTATE10 <> <> : Events.EVENT9 +StatesSTATE1 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE2 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE3 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE4 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE5 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE4 -[#1E90FF,bold]-> StatesSTATEY <> <> : Events.EVENTY +StatesSTATEY -[#FF6347,bold]-> StatesSTATEX <> : [guardVarEquals("value1")] (order=0) +StatesSTATEY -[#FF6347,bold]-> StatesSTATEZ <> : (order=1) +StatesSTATE9 -[#FF6347,bold]-> StatesSTATE8 <> : [guardVarEquals("stepBack")] (order=0) +StatesSTATE9 -[#FF6347,bold]-> StatesSTATE7 <> : [guardVarEquals("stepBackMore")] (order=1) +StatesSTATE9 -[#FF6347,bold]-> StatesSTATE6 <> : (order=2) +StatesSTATE8 -[#FF6347,bold]-> StatesSTATE9 <> : [guardVarEquals("forward9")] (order=0) +StatesSTATE8 -[#FF6347,bold]-> StatesSTATE10 <> : (order=1) +StatesSTATE3 -[#1E90FF,bold]-> StatesSTATE_EXTRA_2 <> <> : Events.EVENT_1_2 +StatesSTATE_EXTRA_2 -[#1E90FF,bold]-> StatesSTATE_EXTRA_3 <> <> : Events.EVENT_1_2 +StatesSTATE_EXTRA_3 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL -[*] --> STATE1 - -state STATEY <> -state STATE9 <> -state STATE8 <> - -STATE1 -[#1E90FF,bold]-> STATE2 <> <> : EVENT1 -STATE2 -[#1E90FF,bold]-> STATE3 <> <> : EVENT2 -STATE3 -[#1E90FF,bold]-> STATE4 <> <> : EVENT3 -STATE4 -[#1E90FF,bold]-> STATE5 <> <> : EVENT4 -STATE5 -[#1E90FF,bold]-> STATE6 <> <> : EVENT5 -STATE6 -[#1E90FF,bold]-> STATE7 <> <> : EVENT6 -STATE7 -[#1E90FF,bold]-> STATE8 <> <> : EVENT7 -STATE8 -[#1E90FF,bold]-> STATE9 <> <> : EVENT8 -STATE9 -[#1E90FF,bold]-> STATE10 <> <> : EVENT9 -STATE1 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE2 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE3 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE4 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE5 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE4 -[#1E90FF,bold]-> STATEY <> <> : EVENTY -STATEY -[#FF6347,bold]-> STATEX <> : [guardVarEquals("value1")] (order=0) -STATEY -[#FF6347,bold]-> STATEZ <> : (order=1) -STATE9 -[#4682B4,bold]-> STATE8 <> : [guardVarEquals("stepBack")] (order=0) -STATE9 -[#4682B4,bold]-> STATE7 <> : [guardVarEquals("stepBackMore")] (order=1) -STATE9 -[#4682B4,bold]-> STATE6 <> : (order=2) -STATE8 -[#32CD32,bold]-> STATE9 <> : [guardVarEquals("forward9")] (order=0) -STATE8 -[#32CD32,bold]-> STATE10 <> : (order=1) -STATE3 -[#1E90FF,bold]-> STATE_EXTRA_2 <> <> : EVENT_1_2 -STATE_EXTRA_2 -[#1E90FF,bold]-> STATE_EXTRA_3 <> <> : EVENT_1_2 -STATE_EXTRA_3 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype - -STATEZ --> [*] +StatesSTATEZ --> [*] @enduml diff --git a/state_machine_exporter/src/test/resources/golden/G2StateMachineConfiguration/G2StateMachineConfiguration.png b/state_machine_exporter/src/test/resources/golden/G2StateMachineConfiguration/G2StateMachineConfiguration.png index 9f68b68..292321c 100644 Binary files a/state_machine_exporter/src/test/resources/golden/G2StateMachineConfiguration/G2StateMachineConfiguration.png and b/state_machine_exporter/src/test/resources/golden/G2StateMachineConfiguration/G2StateMachineConfiguration.png differ diff --git a/state_machine_exporter/src/test/resources/golden/G2StateMachineConfiguration/G2StateMachineConfiguration.puml b/state_machine_exporter/src/test/resources/golden/G2StateMachineConfiguration/G2StateMachineConfiguration.puml index 82d0b7a..fbaf7a3 100644 --- a/state_machine_exporter/src/test/resources/golden/G2StateMachineConfiguration/G2StateMachineConfiguration.puml +++ b/state_machine_exporter/src/test/resources/golden/G2StateMachineConfiguration/G2StateMachineConfiguration.puml @@ -2,110 +2,73 @@ !pragma layout smetana hide empty description hide stereotype -state STATE1 -state STATE2 -state STATE3 -state STATE4 -state STATE5 -state STATE6 -state STATE7 -state STATE8 -state STATE9 -state STATE10 -state CANCEL -state STATEY -state STATEX -state STATEZ -state STATE_EXTRA_1 -state STATE_EXTRA_2 +skinparam state { + BackgroundColor white + BorderColor #94a3b8 + BorderThickness 1 + FontName Inter + FontSize 9 + FontStyle bold + RoundCorner 20 + Padding 1 +} +skinparam shadowing false +skinparam ArrowFontName JetBrains Mono +skinparam ArrowFontSize 8 +skinparam ArrowColor #cbd5e1 +skinparam ArrowThickness 1 +skinparam dpi 110 +skinparam svgLinkTarget _self +state StatesSTATE1 +state StatesSTATE2 +state StatesSTATE3 +state StatesSTATE4 +state StatesSTATE5 +state StatesSTATE6 +state StatesSTATE7 +state StatesSTATE8 +state StatesSTATE9 +state StatesSTATE10 +state StatesCANCEL +state StatesSTATEY +state StatesSTATEX +state StatesSTATEZ +state StatesSTATE_EXTRA_1 +state StatesSTATE_EXTRA_2 - +state StatesSTATEY <> +state StatesSTATE9 <> +state StatesSTATE8 <> -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype +StatesSTATE1 -[#1E90FF,bold]-> StatesSTATE2 <> <> : Events.EVENT1 +StatesSTATE2 -[#1E90FF,bold]-> StatesSTATE3 <> <> : Events.EVENT2 +StatesSTATE3 -[#1E90FF,bold]-> StatesSTATE4 <> <> : Events.EVENT3 +StatesSTATE4 -[#1E90FF,bold]-> StatesSTATE5 <> <> : Events.EVENT4 +StatesSTATE5 -[#1E90FF,bold]-> StatesSTATE6 <> <> : Events.EVENT5 +StatesSTATE6 -[#1E90FF,bold]-> StatesSTATE7 <> <> : Events.EVENT6 +StatesSTATE7 -[#1E90FF,bold]-> StatesSTATE8 <> <> : Events.EVENT7 +StatesSTATE8 -[#1E90FF,bold]-> StatesSTATE9 <> <> : Events.EVENT8 +StatesSTATE9 -[#1E90FF,bold]-> StatesSTATE10 <> <> : Events.EVENT9 +StatesSTATE1 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE2 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE3 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE4 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE5 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE4 -[#1E90FF,bold]-> StatesSTATEY <> <> : Events.EVENTY +StatesSTATEY -[#FF6347,bold]-> StatesSTATEX <> : [guardVarEquals("value1")] (order=0) +StatesSTATEY -[#FF6347,bold]-> StatesSTATEZ <> : (order=1) +StatesSTATE9 -[#FF6347,bold]-> StatesSTATE8 <> : [guardVarEquals("stepBack")] (order=0) +StatesSTATE9 -[#FF6347,bold]-> StatesSTATE7 <> : [guardVarEquals("stepBackMore")] (order=1) +StatesSTATE9 -[#FF6347,bold]-> StatesSTATE6 <> : (order=2) +StatesSTATE8 -[#FF6347,bold]-> StatesSTATE9 <> : [guardVarEquals("forward9")] (order=0) +StatesSTATE8 -[#FF6347,bold]-> StatesSTATE10 <> : (order=1) +StatesSTATE3 -[#1E90FF,bold]-> StatesSTATE_EXTRA_1 <> <> : Events.EVENT_1_2 +StatesSTATE_EXTRA_1 -[#1E90FF,bold]-> StatesSTATE_EXTRA_2 <> <> : Events.EVENT_1_3 +StatesSTATE_EXTRA_1 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE_EXTRA_2 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL -[*] --> STATE1 - -state STATEY <> -state STATE9 <> -state STATE8 <> - -STATE1 -[#1E90FF,bold]-> STATE2 <> <> : EVENT1 -STATE2 -[#1E90FF,bold]-> STATE3 <> <> : EVENT2 -STATE3 -[#1E90FF,bold]-> STATE4 <> <> : EVENT3 -STATE4 -[#1E90FF,bold]-> STATE5 <> <> : EVENT4 -STATE5 -[#1E90FF,bold]-> STATE6 <> <> : EVENT5 -STATE6 -[#1E90FF,bold]-> STATE7 <> <> : EVENT6 -STATE7 -[#1E90FF,bold]-> STATE8 <> <> : EVENT7 -STATE8 -[#1E90FF,bold]-> STATE9 <> <> : EVENT8 -STATE9 -[#1E90FF,bold]-> STATE10 <> <> : EVENT9 -STATE1 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE2 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE3 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE4 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE5 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE4 -[#1E90FF,bold]-> STATEY <> <> : EVENTY -STATEY -[#FF6347,bold]-> STATEX <> : [guardVarEquals("value1")] (order=0) -STATEY -[#FF6347,bold]-> STATEZ <> : (order=1) -STATE9 -[#4682B4,bold]-> STATE8 <> : [guardVarEquals("stepBack")] (order=0) -STATE9 -[#4682B4,bold]-> STATE7 <> : [guardVarEquals("stepBackMore")] (order=1) -STATE9 -[#4682B4,bold]-> STATE6 <> : (order=2) -STATE8 -[#32CD32,bold]-> STATE9 <> : [guardVarEquals("forward9")] (order=0) -STATE8 -[#32CD32,bold]-> STATE10 <> : (order=1) -STATE3 -[#1E90FF,bold]-> STATE_EXTRA_1 <> <> : EVENT_1_2 -STATE_EXTRA_1 -[#1E90FF,bold]-> STATE_EXTRA_2 <> <> : EVENT_1_3 -STATE_EXTRA_1 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE_EXTRA_2 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype - -STATEZ --> [*] +StatesSTATEZ --> [*] @enduml diff --git a/state_machine_exporter/src/test/resources/golden/InheritanceStateMachineConfig/InheritanceStateMachineConfig.json b/state_machine_exporter/src/test/resources/golden/InheritanceStateMachineConfig/InheritanceStateMachineConfig.json index b59aaf4..2974e86 100644 --- a/state_machine_exporter/src/test/resources/golden/InheritanceStateMachineConfig/InheritanceStateMachineConfig.json +++ b/state_machine_exporter/src/test/resources/golden/InheritanceStateMachineConfig/InheritanceStateMachineConfig.json @@ -16,7 +16,8 @@ "metadata" : { "path" : "/api/v2/orders/submit", "verb" : "POST" - } + }, + "parameters" : [ ] } ], "callChains" : [ { "entryPoint" : { @@ -27,7 +28,8 @@ "metadata" : { "path" : "/api/v2/orders/submit", "verb" : "POST" - } + }, + "parameters" : [ ] }, "methodChain" : [ "click.kamil.examples.statemachine.inheritance.api.OrderControllerImpl.submitOrder", "click.kamil.examples.statemachine.inheritance.service.ProcessingServiceImpl.doProcess" ], "triggerPoint" : { diff --git a/state_machine_exporter/src/test/resources/golden/InheritanceStateMachineConfig/InheritanceStateMachineConfig.png b/state_machine_exporter/src/test/resources/golden/InheritanceStateMachineConfig/InheritanceStateMachineConfig.png index fe18106..d9727ef 100644 Binary files a/state_machine_exporter/src/test/resources/golden/InheritanceStateMachineConfig/InheritanceStateMachineConfig.png and b/state_machine_exporter/src/test/resources/golden/InheritanceStateMachineConfig/InheritanceStateMachineConfig.png differ diff --git a/state_machine_exporter/src/test/resources/golden/InheritanceStateMachineConfig/InheritanceStateMachineConfig.puml b/state_machine_exporter/src/test/resources/golden/InheritanceStateMachineConfig/InheritanceStateMachineConfig.puml index 0749ef9..7ae5aac 100644 --- a/state_machine_exporter/src/test/resources/golden/InheritanceStateMachineConfig/InheritanceStateMachineConfig.puml +++ b/state_machine_exporter/src/test/resources/golden/InheritanceStateMachineConfig/InheritanceStateMachineConfig.puml @@ -2,55 +2,30 @@ !pragma layout smetana hide empty description hide stereotype +skinparam state { + BackgroundColor white + BorderColor #94a3b8 + BorderThickness 1 + FontName Inter + FontSize 9 + FontStyle bold + RoundCorner 20 + Padding 1 +} +skinparam shadowing false +skinparam ArrowFontName JetBrains Mono +skinparam ArrowFontSize 8 +skinparam ArrowColor #cbd5e1 +skinparam ArrowThickness 1 +skinparam dpi 110 +skinparam svgLinkTarget _self state START state WORKING - - -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype - [*] --> START START -[#1E90FF,bold]-> WORKING <> <> : INHERITED_SUBMIT -hide <> stereotype WORKING --> [*] @enduml diff --git a/state_machine_exporter/src/test/resources/golden/KamilEnumStateMachineConfiguration/KamilEnumStateMachineConfiguration.png b/state_machine_exporter/src/test/resources/golden/KamilEnumStateMachineConfiguration/KamilEnumStateMachineConfiguration.png index 6f7b989..6a37f24 100644 Binary files a/state_machine_exporter/src/test/resources/golden/KamilEnumStateMachineConfiguration/KamilEnumStateMachineConfiguration.png and b/state_machine_exporter/src/test/resources/golden/KamilEnumStateMachineConfiguration/KamilEnumStateMachineConfiguration.png differ diff --git a/state_machine_exporter/src/test/resources/golden/KamilEnumStateMachineConfiguration/KamilEnumStateMachineConfiguration.puml b/state_machine_exporter/src/test/resources/golden/KamilEnumStateMachineConfiguration/KamilEnumStateMachineConfiguration.puml index 1996707..3ad3f1d 100644 --- a/state_machine_exporter/src/test/resources/golden/KamilEnumStateMachineConfiguration/KamilEnumStateMachineConfiguration.puml +++ b/state_machine_exporter/src/test/resources/golden/KamilEnumStateMachineConfiguration/KamilEnumStateMachineConfiguration.puml @@ -2,79 +2,70 @@ !pragma layout smetana hide empty description hide stereotype -state SUBMITTED -state PAID -state FULFILLED -state CANCELED -state PAID1 -state PAID2 -state PAID3 -state HAPPEN +skinparam state { + BackgroundColor white + BorderColor #94a3b8 + BorderThickness 1 + FontName Inter + FontSize 9 + FontStyle bold + RoundCorner 20 + Padding 1 +} +skinparam shadowing false +skinparam ArrowFontName JetBrains Mono +skinparam ArrowFontSize 8 +skinparam ArrowColor #cbd5e1 +skinparam ArrowThickness 1 +skinparam dpi 110 +skinparam svgLinkTarget _self +state OrderStatesSUBMITTED +state OrderStatesPAID +state OrderStatesFULFILLED +state OrderStatesCANCELED +state OrderStatesPAID1 +state OrderStatesPAID2 +state OrderStatesPAID3 +state OrderStatesHAPPEN - +} +] (order=0) +OrderStatesPAID1 -[#FF6347,bold]-> OrderStatesPAID3 <> : [guard1] (order=1) +OrderStatesPAID1 -[#FF6347,bold]-> OrderStatesHAPPEN <> : [new Guard(){ + @Override public boolean evaluate( StateContext context){ + return false; + } +} +] (order=2) +OrderStatesPAID1 -[#FF6347,bold]-> OrderStatesCANCELED <> : (order=3) +OrderStatesPAID2 -[#1E90FF,bold]-> OrderStatesCANCELED <> +OrderStatesPAID3 -[#1E90FF,bold]-> OrderStatesCANCELED <> +OrderStatesPAID2 -[#1E90FF,bold]-> OrderStatesPAID2 <> <> : OrderEvents.ABCD / new Action(){ + @Override public void execute( StateContext context){ + } +} +, action2 -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype - -[*] --> SUBMITTED - -state PAID1 <> - -SUBMITTED -[#1E90FF,bold]-> PAID <> <> : PAY -PAID -[#1E90FF,bold]-> FULFILLED <> <> : FULFILL -SUBMITTED -[#1E90FF,bold]-> CANCELED <> <> : CANCEL [λ] -PAID -[#1E90FF,bold]-> CANCELED <> <> : CANCEL -SUBMITTED -[#1E90FF,bold]-> SUBMITTED <> <> : ABCD -SUBMITTED -[#1E90FF,bold]-> PAID1 <> <> : ABCD -PAID1 -[#FF6347,bold]-> PAID2 <> : [λ] (order=0) -PAID1 -[#FF6347,bold]-> PAID3 <> : [guard1] (order=1) -PAID1 -[#FF6347,bold]-> HAPPEN <> : [λ] (order=2) -PAID1 -[#FF6347,bold]-> CANCELED <> : (order=3) -PAID2 -[#1E90FF,bold]-> CANCELED <> -PAID3 -[#1E90FF,bold]-> CANCELED <> -PAID2 -[#1E90FF,bold]-> PAID2 <> <> : ABCD / λ, action2 -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype - -CANCELED --> [*] -FULFILLED --> [*] +OrderStatesCANCELED --> [*] +OrderStatesFULFILLED --> [*] @enduml diff --git a/state_machine_exporter/src/test/resources/golden/OneStateMachineConfiguration/OneStateMachineConfiguration.png b/state_machine_exporter/src/test/resources/golden/OneStateMachineConfiguration/OneStateMachineConfiguration.png index c424149..62e0acc 100644 Binary files a/state_machine_exporter/src/test/resources/golden/OneStateMachineConfiguration/OneStateMachineConfiguration.png and b/state_machine_exporter/src/test/resources/golden/OneStateMachineConfiguration/OneStateMachineConfiguration.png differ diff --git a/state_machine_exporter/src/test/resources/golden/OneStateMachineConfiguration/OneStateMachineConfiguration.puml b/state_machine_exporter/src/test/resources/golden/OneStateMachineConfiguration/OneStateMachineConfiguration.puml index 7aa65f5..fc057bc 100644 --- a/state_machine_exporter/src/test/resources/golden/OneStateMachineConfiguration/OneStateMachineConfiguration.puml +++ b/state_machine_exporter/src/test/resources/golden/OneStateMachineConfiguration/OneStateMachineConfiguration.puml @@ -2,146 +2,105 @@ !pragma layout smetana hide empty description hide stereotype -state STATE1 -state STATE2 -state STATE3 -state STATE4 -state STATE5 -state STATE6 -state STATE7 -state STATE8 -state STATE9 -state STATE10 -state STATE11 -state STATE12 -state STATE13 -state STATE14 -state STATE15 -state STATE16 -state STATEY -state STATEX -state STATEZ -state STATE17 -state STATE18 -state STATE19 -state STATE20 -state STATE_EXTRA_1 +skinparam state { + BackgroundColor white + BorderColor #94a3b8 + BorderThickness 1 + FontName Inter + FontSize 9 + FontStyle bold + RoundCorner 20 + Padding 1 +} +skinparam shadowing false +skinparam ArrowFontName JetBrains Mono +skinparam ArrowFontSize 8 +skinparam ArrowColor #cbd5e1 +skinparam ArrowThickness 1 +skinparam dpi 110 +skinparam svgLinkTarget _self +state StatesSTATE1 +state StatesSTATE2 +state StatesSTATE3 +state StatesSTATE4 +state StatesSTATE5 +state StatesSTATE6 +state StatesSTATE7 +state StatesSTATE8 +state StatesSTATE9 +state StatesSTATE10 +state StatesSTATE11 +state StatesSTATE12 +state StatesSTATE13 +state StatesSTATE14 +state StatesSTATE15 +state StatesSTATE16 +state StatesSTATEY +state StatesSTATEX +state StatesSTATEZ +state StatesSTATE17 +state StatesSTATE18 +state StatesSTATE19 +state StatesSTATE20 +state StatesSTATE_EXTRA_1 - +state StatesSTATEY <> +state StatesSTATE16 <> +state StatesSTATE17 <> +state StatesSTATE18 <> +state StatesSTATE19 <> +state StatesSTATE20 <> +state StatesSTATE11 <> +state StatesSTATE12 <> +state StatesSTATE14 <> +state StatesSTATE9 <> +state StatesSTATE8 <> -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype +StatesSTATE1 -[#1E90FF,bold]-> StatesSTATE2 <> <> : Events.EVENT1 +StatesSTATE2 -[#1E90FF,bold]-> StatesSTATE3 <> <> : Events.EVENT2 +StatesSTATE3 -[#1E90FF,bold]-> StatesSTATE4 <> <> : Events.EVENT3 +StatesSTATE4 -[#1E90FF,bold]-> StatesSTATE5 <> <> : Events.EVENT4 +StatesSTATE5 -[#1E90FF,bold]-> StatesSTATE6 <> <> : Events.EVENT5 +StatesSTATE6 -[#1E90FF,bold]-> StatesSTATE7 <> <> : Events.EVENT6 +StatesSTATE7 -[#1E90FF,bold]-> StatesSTATE8 <> <> : Events.EVENT7 +StatesSTATE8 -[#1E90FF,bold]-> StatesSTATE9 <> <> : Events.EVENT8 +StatesSTATE9 -[#1E90FF,bold]-> StatesSTATE10 <> <> : Events.EVENT9 +StatesSTATE10 -[#1E90FF,bold]-> StatesSTATE11 <> <> : Events.EVENT10 +StatesSTATE11 -[#1E90FF,bold]-> StatesSTATE12 <> <> : Events.EVENT11 +StatesSTATE12 -[#1E90FF,bold]-> StatesSTATE13 <> <> : Events.EVENT12 +StatesSTATE13 -[#1E90FF,bold]-> StatesSTATE14 <> <> : Events.EVENT13 +StatesSTATE14 -[#1E90FF,bold]-> StatesSTATE15 <> <> : Events.EVENT14 +StatesSTATE15 -[#1E90FF,bold]-> StatesSTATE16 <> <> : Events.EVENT15 +StatesSTATE4 -[#1E90FF,bold]-> StatesSTATEY <> <> : Events.EVENTY +StatesSTATEY -[#FF6347,bold]-> StatesSTATEX <> : [guardVarEquals("value1")] (order=0) +StatesSTATEY -[#FF6347,bold]-> StatesSTATEZ <> : (order=1) +StatesSTATE16 -[#FF6347,bold]-> StatesSTATE17 <> : [guardVarEquals("value1")] (order=0) +StatesSTATE16 -[#FF6347,bold]-> StatesSTATE18 <> : [guardVarEquals("value2")] (order=1) +StatesSTATE16 -[#FF6347,bold]-> StatesSTATE19 <> : (order=2) +StatesSTATE17 -[#FF6347,bold]-> StatesSTATE20 <> : [guardEventHeaderEquals("header1","foo")] (order=0) +StatesSTATE17 -[#FF6347,bold]-> StatesSTATE16 <> : (order=1) +StatesSTATE18 -[#FF6347,bold]-> StatesSTATE19 <> : [guardVarEquals("value3")] (order=0) +StatesSTATE18 -[#FF6347,bold]-> StatesSTATE20 <> : (order=1) +StatesSTATE19 -[#FF6347,bold]-> StatesSTATE1 <> : [guardVarEquals("reset")] (order=0) +StatesSTATE19 -[#FF6347,bold]-> StatesSTATE20 <> : (order=1) +StatesSTATE20 -[#FF6347,bold]-> StatesSTATE5 <> : [guardEventHeaderEquals("header2","bar")] (order=0) +StatesSTATE20 -[#FF6347,bold]-> StatesSTATE1 <> : (order=1) +StatesSTATE11 -[#FF6347,bold]-> StatesSTATE13 <> : [guardVarEquals("goTo13")] (order=0) +StatesSTATE11 -[#FF6347,bold]-> StatesSTATE14 <> : [guardVarEquals("goTo14")] (order=1) +StatesSTATE11 -[#FF6347,bold]-> StatesSTATE15 <> : (order=2) +StatesSTATE12 -[#FF6347,bold]-> StatesSTATE10 <> : [guardVarEquals("goBack10")] (order=0) +StatesSTATE12 -[#FF6347,bold]-> StatesSTATE11 <> : (order=1) +StatesSTATE14 -[#FF6347,bold]-> StatesSTATE12 <> : [guardVarEquals("loop12")] (order=0) +StatesSTATE14 -[#FF6347,bold]-> StatesSTATE16 <> : (order=1) +StatesSTATE9 -[#FF6347,bold]-> StatesSTATE8 <> : [guardVarEquals("stepBack")] (order=0) +StatesSTATE9 -[#FF6347,bold]-> StatesSTATE7 <> : [guardVarEquals("stepBackMore")] (order=1) +StatesSTATE9 -[#FF6347,bold]-> StatesSTATE6 <> : (order=2) +StatesSTATE8 -[#FF6347,bold]-> StatesSTATE9 <> : [guardVarEquals("forward9")] (order=0) +StatesSTATE8 -[#FF6347,bold]-> StatesSTATE10 <> : (order=1) +StatesSTATE5 -[#1E90FF,bold]-> StatesSTATE_EXTRA_1 <> <> : Events.EVENTX -[*] --> STATE1 - -state STATEY <> -state STATE16 <> -state STATE17 <> -state STATE18 <> -state STATE19 <> -state STATE20 <> -state STATE11 <> -state STATE12 <> -state STATE14 <> -state STATE9 <> -state STATE8 <> - -STATE1 -[#1E90FF,bold]-> STATE2 <> <> : EVENT1 -STATE2 -[#1E90FF,bold]-> STATE3 <> <> : EVENT2 -STATE3 -[#1E90FF,bold]-> STATE4 <> <> : EVENT3 -STATE4 -[#1E90FF,bold]-> STATE5 <> <> : EVENT4 -STATE5 -[#1E90FF,bold]-> STATE6 <> <> : EVENT5 -STATE6 -[#1E90FF,bold]-> STATE7 <> <> : EVENT6 -STATE7 -[#1E90FF,bold]-> STATE8 <> <> : EVENT7 -STATE8 -[#1E90FF,bold]-> STATE9 <> <> : EVENT8 -STATE9 -[#1E90FF,bold]-> STATE10 <> <> : EVENT9 -STATE10 -[#1E90FF,bold]-> STATE11 <> <> : EVENT10 -STATE11 -[#1E90FF,bold]-> STATE12 <> <> : EVENT11 -STATE12 -[#1E90FF,bold]-> STATE13 <> <> : EVENT12 -STATE13 -[#1E90FF,bold]-> STATE14 <> <> : EVENT13 -STATE14 -[#1E90FF,bold]-> STATE15 <> <> : EVENT14 -STATE15 -[#1E90FF,bold]-> STATE16 <> <> : EVENT15 -STATE4 -[#1E90FF,bold]-> STATEY <> <> : EVENTY -STATEY -[#FF6347,bold]-> STATEX <> : [guardVarEquals("value1")] (order=0) -STATEY -[#FF6347,bold]-> STATEZ <> : (order=1) -STATE16 -[#4682B4,bold]-> STATE17 <> : [guardVarEquals("value1")] (order=0) -STATE16 -[#4682B4,bold]-> STATE18 <> : [guardVarEquals("value2")] (order=1) -STATE16 -[#4682B4,bold]-> STATE19 <> : (order=2) -STATE17 -[#32CD32,bold]-> STATE20 <> : [guardEventHeaderEquals("header1","foo")] (order=0) -STATE17 -[#32CD32,bold]-> STATE16 <> : (order=1) -STATE18 -[#FFD700,bold]-> STATE19 <> : [guardVarEquals("value3")] (order=0) -STATE18 -[#FFD700,bold]-> STATE20 <> : (order=1) -STATE19 -[#6A5ACD,bold]-> STATE1 <> : [guardVarEquals("reset")] (order=0) -STATE19 -[#6A5ACD,bold]-> STATE20 <> : (order=1) -STATE20 -[#FF69B4,bold]-> STATE5 <> : [guardEventHeaderEquals("header2","bar")] (order=0) -STATE20 -[#FF69B4,bold]-> STATE1 <> : (order=1) -STATE11 -[#FF6347,bold]-> STATE13 <> : [guardVarEquals("goTo13")] (order=0) -STATE11 -[#FF6347,bold]-> STATE14 <> : [guardVarEquals("goTo14")] (order=1) -STATE11 -[#FF6347,bold]-> STATE15 <> : (order=2) -STATE12 -[#4682B4,bold]-> STATE10 <> : [guardVarEquals("goBack10")] (order=0) -STATE12 -[#4682B4,bold]-> STATE11 <> : (order=1) -STATE14 -[#32CD32,bold]-> STATE12 <> : [guardVarEquals("loop12")] (order=0) -STATE14 -[#32CD32,bold]-> STATE16 <> : (order=1) -STATE9 -[#FFD700,bold]-> STATE8 <> : [guardVarEquals("stepBack")] (order=0) -STATE9 -[#FFD700,bold]-> STATE7 <> : [guardVarEquals("stepBackMore")] (order=1) -STATE9 -[#FFD700,bold]-> STATE6 <> : (order=2) -STATE8 -[#6A5ACD,bold]-> STATE9 <> : [guardVarEquals("forward9")] (order=0) -STATE8 -[#6A5ACD,bold]-> STATE10 <> : (order=1) -STATE5 -[#1E90FF,bold]-> STATE_EXTRA_1 <> <> : EVENTX -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype - -STATEZ --> [*] +StatesSTATEZ --> [*] @enduml diff --git a/state_machine_exporter/src/test/resources/golden/SimpleEnumStateMachineConfiguration/SimpleEnumStateMachineConfiguration.png b/state_machine_exporter/src/test/resources/golden/SimpleEnumStateMachineConfiguration/SimpleEnumStateMachineConfiguration.png index c94f9c5..34ee809 100644 Binary files a/state_machine_exporter/src/test/resources/golden/SimpleEnumStateMachineConfiguration/SimpleEnumStateMachineConfiguration.png and b/state_machine_exporter/src/test/resources/golden/SimpleEnumStateMachineConfiguration/SimpleEnumStateMachineConfiguration.png differ diff --git a/state_machine_exporter/src/test/resources/golden/SimpleEnumStateMachineConfiguration/SimpleEnumStateMachineConfiguration.puml b/state_machine_exporter/src/test/resources/golden/SimpleEnumStateMachineConfiguration/SimpleEnumStateMachineConfiguration.puml index 6b663ea..bdf4fec 100644 --- a/state_machine_exporter/src/test/resources/golden/SimpleEnumStateMachineConfiguration/SimpleEnumStateMachineConfiguration.puml +++ b/state_machine_exporter/src/test/resources/golden/SimpleEnumStateMachineConfiguration/SimpleEnumStateMachineConfiguration.puml @@ -2,81 +2,78 @@ !pragma layout smetana hide empty description hide stereotype -state SUBMITTED -state PAID -state FULFILLED -state CANCELED -state PAID2 -state PAID3 -state PAID1 -state HAPPEN +skinparam state { + BackgroundColor white + BorderColor #94a3b8 + BorderThickness 1 + FontName Inter + FontSize 9 + FontStyle bold + RoundCorner 20 + Padding 1 +} +skinparam shadowing false +skinparam ArrowFontName JetBrains Mono +skinparam ArrowFontSize 8 +skinparam ArrowColor #cbd5e1 +skinparam ArrowThickness 1 +skinparam dpi 110 +skinparam svgLinkTarget _self +state OrderStatesSUBMITTED +state OrderStatesPAID +state OrderStatesFULFILLED +state OrderStatesCANCELED +state OrderStatesPAID2 +state OrderStatesPAID3 +state OrderStatesPAID1 +state OrderStatesHAPPEN - +} +] (order=0) +OrderStatesSUBMITTED -[#FF6347,bold]-> OrderStatesPAID3 <> : (order=1) +OrderStatesPAID -[#FF6347,bold]-> OrderStatesPAID1 <> : [new Guard(){ + @Override public boolean evaluate( StateContext context){ + return true; + } +} +] (order=0) +OrderStatesPAID -[#FF6347,bold]-> OrderStatesPAID2 <> : [guard1] (order=1) +OrderStatesPAID -[#FF6347,bold]-> OrderStatesHAPPEN <> : [new Guard(){ + @Override public boolean evaluate( StateContext context){ + return false; + } +} +] (order=2) +OrderStatesPAID -[#FF6347,bold]-> OrderStatesPAID3 <> : (order=3) +OrderStatesPAID2 -[#1E90FF,bold]-> OrderStatesCANCELED <> +OrderStatesPAID3 -[#1E90FF,bold]-> OrderStatesCANCELED <> +OrderStatesPAID1 -[#1E90FF,bold]-> OrderStatesPAID1 <> <> : OrderEvents.ABCD / new Action(){ + @Override public void execute( StateContext context){ + ; + } +} +, action2 -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype - -[*] --> SUBMITTED - -state SUBMITTED <> -state PAID <> - -SUBMITTED -[#1E90FF,bold]-> PAID <> <> : PAY -PAID -[#1E90FF,bold]-> FULFILLED <> <> : FULFILL -SUBMITTED -[#1E90FF,bold]-> CANCELED <> <> : CANCEL [λ] -PAID -[#1E90FF,bold]-> CANCELED <> <> : CANCEL -SUBMITTED -[#1E90FF,bold]-> SUBMITTED <> <> : ABCD -SUBMITTED -[#FF6347,bold]-> PAID2 <> : [λ] (order=0) -SUBMITTED -[#FF6347,bold]-> PAID3 <> : (order=1) -PAID -[#4682B4,bold]-> PAID1 <> : [λ] (order=0) -PAID -[#4682B4,bold]-> PAID2 <> : [guard1] (order=1) -PAID -[#4682B4,bold]-> HAPPEN <> : [λ] (order=2) -PAID -[#4682B4,bold]-> PAID3 <> : (order=3) -PAID2 -[#1E90FF,bold]-> CANCELED <> -PAID3 -[#1E90FF,bold]-> CANCELED <> -PAID1 -[#1E90FF,bold]-> PAID1 <> <> : ABCD / λ, action2 -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype - -CANCELED --> [*] -FULFILLED --> [*] +OrderStatesCANCELED --> [*] +OrderStatesFULFILLED --> [*] @enduml diff --git a/state_machine_exporter/src/test/resources/golden/ThreeStateMachineConfiguration/ThreeStateMachineConfiguration.png b/state_machine_exporter/src/test/resources/golden/ThreeStateMachineConfiguration/ThreeStateMachineConfiguration.png index ab9e524..eedb85f 100644 Binary files a/state_machine_exporter/src/test/resources/golden/ThreeStateMachineConfiguration/ThreeStateMachineConfiguration.png and b/state_machine_exporter/src/test/resources/golden/ThreeStateMachineConfiguration/ThreeStateMachineConfiguration.png differ diff --git a/state_machine_exporter/src/test/resources/golden/ThreeStateMachineConfiguration/ThreeStateMachineConfiguration.puml b/state_machine_exporter/src/test/resources/golden/ThreeStateMachineConfiguration/ThreeStateMachineConfiguration.puml index 48c76dd..fe13d98 100644 --- a/state_machine_exporter/src/test/resources/golden/ThreeStateMachineConfiguration/ThreeStateMachineConfiguration.puml +++ b/state_machine_exporter/src/test/resources/golden/ThreeStateMachineConfiguration/ThreeStateMachineConfiguration.puml @@ -2,162 +2,119 @@ !pragma layout smetana hide empty description hide stereotype -state STATE1 -state STATE2 -state STATE3 -state STATE4 -state STATE5 -state STATE6 -state STATE7 -state STATE8 -state STATE9 -state STATE10 -state STATE11 -state STATE12 -state STATE13 -state STATE14 -state STATE15 -state STATE16 -state CANCEL -state STATEY -state STATEX -state STATEZ -state STATE17 -state STATE18 -state STATE19 -state STATE20 -state STATE_EXTRA_1 -state STATE_EXTRA_3 -state STATE_EXTRA_2 +skinparam state { + BackgroundColor white + BorderColor #94a3b8 + BorderThickness 1 + FontName Inter + FontSize 9 + FontStyle bold + RoundCorner 20 + Padding 1 +} +skinparam shadowing false +skinparam ArrowFontName JetBrains Mono +skinparam ArrowFontSize 8 +skinparam ArrowColor #cbd5e1 +skinparam ArrowThickness 1 +skinparam dpi 110 +skinparam svgLinkTarget _self +state StatesSTATE1 +state StatesSTATE2 +state StatesSTATE3 +state StatesSTATE4 +state StatesSTATE5 +state StatesSTATE6 +state StatesSTATE7 +state StatesSTATE8 +state StatesSTATE9 +state StatesSTATE10 +state StatesSTATE11 +state StatesSTATE12 +state StatesSTATE13 +state StatesSTATE14 +state StatesSTATE15 +state StatesSTATE16 +state StatesCANCEL +state StatesSTATEY +state StatesSTATEX +state StatesSTATEZ +state StatesSTATE17 +state StatesSTATE18 +state StatesSTATE19 +state StatesSTATE20 +state StatesSTATE_EXTRA_1 +state StatesSTATE_EXTRA_3 +state StatesSTATE_EXTRA_2 - +state StatesSTATEY <> +state StatesSTATE16 <> +state StatesSTATE17 <> +state StatesSTATE18 <> +state StatesSTATE19 <> +state StatesSTATE20 <> +state StatesSTATE11 <> +state StatesSTATE12 <> +state StatesSTATE14 <> +state StatesSTATE9 <> +state StatesSTATE8 <> +state StatesSTATE2 <> -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype +StatesSTATE1 -[#1E90FF,bold]-> StatesSTATE2 <> <> : Events.EVENT1 +StatesSTATE2 -[#1E90FF,bold]-> StatesSTATE3 <> <> : Events.EVENT2 +StatesSTATE3 -[#1E90FF,bold]-> StatesSTATE4 <> <> : Events.EVENT3 +StatesSTATE4 -[#1E90FF,bold]-> StatesSTATE5 <> <> : Events.EVENT4 +StatesSTATE5 -[#1E90FF,bold]-> StatesSTATE6 <> <> : Events.EVENT5 +StatesSTATE6 -[#1E90FF,bold]-> StatesSTATE7 <> <> : Events.EVENT6 +StatesSTATE7 -[#1E90FF,bold]-> StatesSTATE8 <> <> : Events.EVENT7 +StatesSTATE8 -[#1E90FF,bold]-> StatesSTATE9 <> <> : Events.EVENT8 +StatesSTATE9 -[#1E90FF,bold]-> StatesSTATE10 <> <> : Events.EVENT9 +StatesSTATE10 -[#1E90FF,bold]-> StatesSTATE11 <> <> : Events.EVENT10 +StatesSTATE11 -[#1E90FF,bold]-> StatesSTATE12 <> <> : Events.EVENT11 +StatesSTATE12 -[#1E90FF,bold]-> StatesSTATE13 <> <> : Events.EVENT12 +StatesSTATE13 -[#1E90FF,bold]-> StatesSTATE14 <> <> : Events.EVENT13 +StatesSTATE14 -[#1E90FF,bold]-> StatesSTATE15 <> <> : Events.EVENT14 +StatesSTATE15 -[#1E90FF,bold]-> StatesSTATE16 <> <> : Events.EVENT15 +StatesSTATE1 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE2 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE3 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE4 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE5 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE4 -[#1E90FF,bold]-> StatesSTATEY <> <> : Events.EVENTY +StatesSTATEY -[#FF6347,bold]-> StatesSTATEX <> : [guardVarEquals("value1")] (order=0) +StatesSTATEY -[#FF6347,bold]-> StatesSTATEZ <> : (order=1) +StatesSTATE16 -[#FF6347,bold]-> StatesSTATE17 <> : [guardVarEquals("value1")] (order=0) +StatesSTATE16 -[#FF6347,bold]-> StatesSTATE18 <> : [guardVarEquals("value2")] (order=1) +StatesSTATE16 -[#FF6347,bold]-> StatesSTATE19 <> : (order=2) +StatesSTATE17 -[#FF6347,bold]-> StatesSTATE20 <> : [guardEventHeaderEquals("header1","foo")] (order=0) +StatesSTATE17 -[#FF6347,bold]-> StatesSTATE16 <> : (order=1) +StatesSTATE18 -[#FF6347,bold]-> StatesSTATE19 <> : [guardVarEquals("value3")] (order=0) +StatesSTATE18 -[#FF6347,bold]-> StatesSTATE20 <> : (order=1) +StatesSTATE19 -[#FF6347,bold]-> StatesSTATE1 <> : [guardVarEquals("reset")] (order=0) +StatesSTATE19 -[#FF6347,bold]-> StatesSTATE20 <> : (order=1) +StatesSTATE20 -[#FF6347,bold]-> StatesSTATE5 <> : [guardEventHeaderEquals("header2","bar")] (order=0) +StatesSTATE20 -[#FF6347,bold]-> StatesSTATE1 <> : (order=1) +StatesSTATE11 -[#FF6347,bold]-> StatesSTATE13 <> : [guardVarEquals("goTo13")] (order=0) +StatesSTATE11 -[#FF6347,bold]-> StatesSTATE14 <> : [guardVarEquals("goTo14")] (order=1) +StatesSTATE11 -[#FF6347,bold]-> StatesSTATE15 <> : (order=2) +StatesSTATE12 -[#FF6347,bold]-> StatesSTATE10 <> : [guardVarEquals("goBack10")] (order=0) +StatesSTATE12 -[#FF6347,bold]-> StatesSTATE11 <> : (order=1) +StatesSTATE14 -[#FF6347,bold]-> StatesSTATE12 <> : [guardVarEquals("loop12")] (order=0) +StatesSTATE14 -[#FF6347,bold]-> StatesSTATE16 <> : (order=1) +StatesSTATE9 -[#FF6347,bold]-> StatesSTATE8 <> : [guardVarEquals("stepBack")] (order=0) +StatesSTATE9 -[#FF6347,bold]-> StatesSTATE7 <> : [guardVarEquals("stepBackMore")] (order=1) +StatesSTATE9 -[#FF6347,bold]-> StatesSTATE6 <> : (order=2) +StatesSTATE8 -[#FF6347,bold]-> StatesSTATE9 <> : [guardVarEquals("forward9")] (order=0) +StatesSTATE8 -[#FF6347,bold]-> StatesSTATE10 <> : (order=1) +StatesSTATE2 -[#1E90FF,bold]-> StatesSTATE_EXTRA_1 <> <> : Events.EVENTX +StatesSTATE2 -[#FF6347,bold]-> StatesSTATE1 <> : [guardEventHeaderEquals("header1","foo")] (order=0) +StatesSTATE2 -[#FF6347,bold]-> StatesSTATE_EXTRA_1 <> : (order=1) +StatesSTATE_EXTRA_1 -[#1E90FF,bold]-> StatesSTATE_EXTRA_3 <> <> : Events.EVENTY +StatesSTATE_EXTRA_1 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL_2 +StatesSTATE_EXTRA_2 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL_2 -[*] --> STATE1 - -state STATEY <> -state STATE16 <> -state STATE17 <> -state STATE18 <> -state STATE19 <> -state STATE20 <> -state STATE11 <> -state STATE12 <> -state STATE14 <> -state STATE9 <> -state STATE8 <> -state STATE2 <> - -STATE1 -[#1E90FF,bold]-> STATE2 <> <> : EVENT1 -STATE2 -[#1E90FF,bold]-> STATE3 <> <> : EVENT2 -STATE3 -[#1E90FF,bold]-> STATE4 <> <> : EVENT3 -STATE4 -[#1E90FF,bold]-> STATE5 <> <> : EVENT4 -STATE5 -[#1E90FF,bold]-> STATE6 <> <> : EVENT5 -STATE6 -[#1E90FF,bold]-> STATE7 <> <> : EVENT6 -STATE7 -[#1E90FF,bold]-> STATE8 <> <> : EVENT7 -STATE8 -[#1E90FF,bold]-> STATE9 <> <> : EVENT8 -STATE9 -[#1E90FF,bold]-> STATE10 <> <> : EVENT9 -STATE10 -[#1E90FF,bold]-> STATE11 <> <> : EVENT10 -STATE11 -[#1E90FF,bold]-> STATE12 <> <> : EVENT11 -STATE12 -[#1E90FF,bold]-> STATE13 <> <> : EVENT12 -STATE13 -[#1E90FF,bold]-> STATE14 <> <> : EVENT13 -STATE14 -[#1E90FF,bold]-> STATE15 <> <> : EVENT14 -STATE15 -[#1E90FF,bold]-> STATE16 <> <> : EVENT15 -STATE1 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE2 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE3 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE4 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE5 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE4 -[#1E90FF,bold]-> STATEY <> <> : EVENTY -STATEY -[#FF6347,bold]-> STATEX <> : [guardVarEquals("value1")] (order=0) -STATEY -[#FF6347,bold]-> STATEZ <> : (order=1) -STATE16 -[#4682B4,bold]-> STATE17 <> : [guardVarEquals("value1")] (order=0) -STATE16 -[#4682B4,bold]-> STATE18 <> : [guardVarEquals("value2")] (order=1) -STATE16 -[#4682B4,bold]-> STATE19 <> : (order=2) -STATE17 -[#32CD32,bold]-> STATE20 <> : [guardEventHeaderEquals("header1","foo")] (order=0) -STATE17 -[#32CD32,bold]-> STATE16 <> : (order=1) -STATE18 -[#FFD700,bold]-> STATE19 <> : [guardVarEquals("value3")] (order=0) -STATE18 -[#FFD700,bold]-> STATE20 <> : (order=1) -STATE19 -[#6A5ACD,bold]-> STATE1 <> : [guardVarEquals("reset")] (order=0) -STATE19 -[#6A5ACD,bold]-> STATE20 <> : (order=1) -STATE20 -[#FF69B4,bold]-> STATE5 <> : [guardEventHeaderEquals("header2","bar")] (order=0) -STATE20 -[#FF69B4,bold]-> STATE1 <> : (order=1) -STATE11 -[#FF6347,bold]-> STATE13 <> : [guardVarEquals("goTo13")] (order=0) -STATE11 -[#FF6347,bold]-> STATE14 <> : [guardVarEquals("goTo14")] (order=1) -STATE11 -[#FF6347,bold]-> STATE15 <> : (order=2) -STATE12 -[#4682B4,bold]-> STATE10 <> : [guardVarEquals("goBack10")] (order=0) -STATE12 -[#4682B4,bold]-> STATE11 <> : (order=1) -STATE14 -[#32CD32,bold]-> STATE12 <> : [guardVarEquals("loop12")] (order=0) -STATE14 -[#32CD32,bold]-> STATE16 <> : (order=1) -STATE9 -[#FFD700,bold]-> STATE8 <> : [guardVarEquals("stepBack")] (order=0) -STATE9 -[#FFD700,bold]-> STATE7 <> : [guardVarEquals("stepBackMore")] (order=1) -STATE9 -[#FFD700,bold]-> STATE6 <> : (order=2) -STATE8 -[#6A5ACD,bold]-> STATE9 <> : [guardVarEquals("forward9")] (order=0) -STATE8 -[#6A5ACD,bold]-> STATE10 <> : (order=1) -STATE2 -[#1E90FF,bold]-> STATE_EXTRA_1 <> <> : EVENTX -STATE2 -[#FF69B4,bold]-> STATE1 <> : [guardEventHeaderEquals("header1","foo")] (order=0) -STATE2 -[#FF69B4,bold]-> STATE_EXTRA_1 <> : (order=1) -STATE_EXTRA_1 -[#1E90FF,bold]-> STATE_EXTRA_3 <> <> : EVENTY -STATE_EXTRA_1 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL_2 -STATE_EXTRA_2 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL_2 -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype - -STATEZ --> [*] +StatesSTATEZ --> [*] @enduml diff --git a/state_machine_exporter/src/test/resources/golden/TwoStateMachineExtraFunctionsConfiguration/TwoStateMachineConfiguration.png b/state_machine_exporter/src/test/resources/golden/TwoStateMachineExtraFunctionsConfiguration/TwoStateMachineConfiguration.png index 013b311..ea9336c 100644 Binary files a/state_machine_exporter/src/test/resources/golden/TwoStateMachineExtraFunctionsConfiguration/TwoStateMachineConfiguration.png and b/state_machine_exporter/src/test/resources/golden/TwoStateMachineExtraFunctionsConfiguration/TwoStateMachineConfiguration.png differ diff --git a/state_machine_exporter/src/test/resources/golden/TwoStateMachineExtraFunctionsConfiguration/TwoStateMachineConfiguration.puml b/state_machine_exporter/src/test/resources/golden/TwoStateMachineExtraFunctionsConfiguration/TwoStateMachineConfiguration.puml index b00f855..6e9c193 100644 --- a/state_machine_exporter/src/test/resources/golden/TwoStateMachineExtraFunctionsConfiguration/TwoStateMachineConfiguration.puml +++ b/state_machine_exporter/src/test/resources/golden/TwoStateMachineExtraFunctionsConfiguration/TwoStateMachineConfiguration.puml @@ -2,156 +2,113 @@ !pragma layout smetana hide empty description hide stereotype -state STATE1 -state STATE2 -state STATE3 -state STATE4 -state STATE5 -state STATE6 -state STATE7 -state STATE8 -state STATE9 -state STATE10 -state STATE11 -state STATE12 -state STATE13 -state STATE14 -state STATE15 -state STATE16 -state CANCEL -state STATEY -state STATEX -state STATEZ -state STATE17 -state STATE18 -state STATE19 -state STATE20 -state STATE_EXTRA_1 +skinparam state { + BackgroundColor white + BorderColor #94a3b8 + BorderThickness 1 + FontName Inter + FontSize 9 + FontStyle bold + RoundCorner 20 + Padding 1 +} +skinparam shadowing false +skinparam ArrowFontName JetBrains Mono +skinparam ArrowFontSize 8 +skinparam ArrowColor #cbd5e1 +skinparam ArrowThickness 1 +skinparam dpi 110 +skinparam svgLinkTarget _self +state StatesSTATE1 +state StatesSTATE2 +state StatesSTATE3 +state StatesSTATE4 +state StatesSTATE5 +state StatesSTATE6 +state StatesSTATE7 +state StatesSTATE8 +state StatesSTATE9 +state StatesSTATE10 +state StatesSTATE11 +state StatesSTATE12 +state StatesSTATE13 +state StatesSTATE14 +state StatesSTATE15 +state StatesSTATE16 +state StatesCANCEL +state StatesSTATEY +state StatesSTATEX +state StatesSTATEZ +state StatesSTATE17 +state StatesSTATE18 +state StatesSTATE19 +state StatesSTATE20 +state StatesSTATE_EXTRA_1 - +state StatesSTATEY <> +state StatesSTATE16 <> +state StatesSTATE17 <> +state StatesSTATE18 <> +state StatesSTATE19 <> +state StatesSTATE20 <> +state StatesSTATE11 <> +state StatesSTATE12 <> +state StatesSTATE14 <> +state StatesSTATE9 <> +state StatesSTATE8 <> -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype +StatesSTATE1 -[#1E90FF,bold]-> StatesSTATE2 <> <> : Events.EVENT1 +StatesSTATE2 -[#1E90FF,bold]-> StatesSTATE3 <> <> : Events.EVENT2 +StatesSTATE3 -[#1E90FF,bold]-> StatesSTATE4 <> <> : Events.EVENT3 +StatesSTATE4 -[#1E90FF,bold]-> StatesSTATE5 <> <> : Events.EVENT4 +StatesSTATE5 -[#1E90FF,bold]-> StatesSTATE6 <> <> : Events.EVENT5 +StatesSTATE6 -[#1E90FF,bold]-> StatesSTATE7 <> <> : Events.EVENT6 +StatesSTATE7 -[#1E90FF,bold]-> StatesSTATE8 <> <> : Events.EVENT7 +StatesSTATE8 -[#1E90FF,bold]-> StatesSTATE9 <> <> : Events.EVENT8 +StatesSTATE9 -[#1E90FF,bold]-> StatesSTATE10 <> <> : Events.EVENT9 +StatesSTATE10 -[#1E90FF,bold]-> StatesSTATE11 <> <> : Events.EVENT10 +StatesSTATE11 -[#1E90FF,bold]-> StatesSTATE12 <> <> : Events.EVENT11 +StatesSTATE12 -[#1E90FF,bold]-> StatesSTATE13 <> <> : Events.EVENT12 +StatesSTATE13 -[#1E90FF,bold]-> StatesSTATE14 <> <> : Events.EVENT13 +StatesSTATE14 -[#1E90FF,bold]-> StatesSTATE15 <> <> : Events.EVENT14 +StatesSTATE15 -[#1E90FF,bold]-> StatesSTATE16 <> <> : Events.EVENT15 +StatesSTATE1 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE2 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE3 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE4 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE5 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE4 -[#1E90FF,bold]-> StatesSTATEY <> <> : Events.EVENTY +StatesSTATEY -[#FF6347,bold]-> StatesSTATEX <> : [guardVarEquals("value1")] (order=0) +StatesSTATEY -[#FF6347,bold]-> StatesSTATEZ <> : (order=1) +StatesSTATE16 -[#FF6347,bold]-> StatesSTATE17 <> : [guardVarEquals("value1")] (order=0) +StatesSTATE16 -[#FF6347,bold]-> StatesSTATE18 <> : [guardVarEquals("value2")] (order=1) +StatesSTATE16 -[#FF6347,bold]-> StatesSTATE19 <> : (order=2) +StatesSTATE17 -[#FF6347,bold]-> StatesSTATE20 <> : [guardEventHeaderEquals("header1","foo")] (order=0) +StatesSTATE17 -[#FF6347,bold]-> StatesSTATE16 <> : (order=1) +StatesSTATE18 -[#FF6347,bold]-> StatesSTATE19 <> : [guardVarEquals("value3")] (order=0) +StatesSTATE18 -[#FF6347,bold]-> StatesSTATE20 <> : (order=1) +StatesSTATE19 -[#FF6347,bold]-> StatesSTATE1 <> : [guardVarEquals("reset")] (order=0) +StatesSTATE19 -[#FF6347,bold]-> StatesSTATE20 <> : (order=1) +StatesSTATE20 -[#FF6347,bold]-> StatesSTATE5 <> : [guardEventHeaderEquals("header2","bar")] (order=0) +StatesSTATE20 -[#FF6347,bold]-> StatesSTATE1 <> : (order=1) +StatesSTATE11 -[#FF6347,bold]-> StatesSTATE13 <> : [guardVarEquals("goTo13")] (order=0) +StatesSTATE11 -[#FF6347,bold]-> StatesSTATE14 <> : [guardVarEquals("goTo14")] (order=1) +StatesSTATE11 -[#FF6347,bold]-> StatesSTATE15 <> : (order=2) +StatesSTATE12 -[#FF6347,bold]-> StatesSTATE10 <> : [guardVarEquals("goBack10")] (order=0) +StatesSTATE12 -[#FF6347,bold]-> StatesSTATE11 <> : (order=1) +StatesSTATE14 -[#FF6347,bold]-> StatesSTATE12 <> : [guardVarEquals("loop12")] (order=0) +StatesSTATE14 -[#FF6347,bold]-> StatesSTATE16 <> : (order=1) +StatesSTATE9 -[#FF6347,bold]-> StatesSTATE8 <> : [guardVarEquals("stepBack")] (order=0) +StatesSTATE9 -[#FF6347,bold]-> StatesSTATE7 <> : [guardVarEquals("stepBackMore")] (order=1) +StatesSTATE9 -[#FF6347,bold]-> StatesSTATE6 <> : (order=2) +StatesSTATE8 -[#FF6347,bold]-> StatesSTATE9 <> : [guardVarEquals("forward9")] (order=0) +StatesSTATE8 -[#FF6347,bold]-> StatesSTATE10 <> : (order=1) +StatesSTATE5 -[#1E90FF,bold]-> StatesSTATE_EXTRA_1 <> <> : Events.EVENTX +StatesSTATE_EXTRA_1 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL +StatesSTATE_EXTRA_1 -[#1E90FF,bold]-> StatesCANCEL <> <> : Events.EVENT_CANCEL_2 -[*] --> STATE1 - -state STATEY <> -state STATE16 <> -state STATE17 <> -state STATE18 <> -state STATE19 <> -state STATE20 <> -state STATE11 <> -state STATE12 <> -state STATE14 <> -state STATE9 <> -state STATE8 <> - -STATE1 -[#1E90FF,bold]-> STATE2 <> <> : EVENT1 -STATE2 -[#1E90FF,bold]-> STATE3 <> <> : EVENT2 -STATE3 -[#1E90FF,bold]-> STATE4 <> <> : EVENT3 -STATE4 -[#1E90FF,bold]-> STATE5 <> <> : EVENT4 -STATE5 -[#1E90FF,bold]-> STATE6 <> <> : EVENT5 -STATE6 -[#1E90FF,bold]-> STATE7 <> <> : EVENT6 -STATE7 -[#1E90FF,bold]-> STATE8 <> <> : EVENT7 -STATE8 -[#1E90FF,bold]-> STATE9 <> <> : EVENT8 -STATE9 -[#1E90FF,bold]-> STATE10 <> <> : EVENT9 -STATE10 -[#1E90FF,bold]-> STATE11 <> <> : EVENT10 -STATE11 -[#1E90FF,bold]-> STATE12 <> <> : EVENT11 -STATE12 -[#1E90FF,bold]-> STATE13 <> <> : EVENT12 -STATE13 -[#1E90FF,bold]-> STATE14 <> <> : EVENT13 -STATE14 -[#1E90FF,bold]-> STATE15 <> <> : EVENT14 -STATE15 -[#1E90FF,bold]-> STATE16 <> <> : EVENT15 -STATE1 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE2 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE3 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE4 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE5 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE4 -[#1E90FF,bold]-> STATEY <> <> : EVENTY -STATEY -[#FF6347,bold]-> STATEX <> : [guardVarEquals("value1")] (order=0) -STATEY -[#FF6347,bold]-> STATEZ <> : (order=1) -STATE16 -[#4682B4,bold]-> STATE17 <> : [guardVarEquals("value1")] (order=0) -STATE16 -[#4682B4,bold]-> STATE18 <> : [guardVarEquals("value2")] (order=1) -STATE16 -[#4682B4,bold]-> STATE19 <> : (order=2) -STATE17 -[#32CD32,bold]-> STATE20 <> : [guardEventHeaderEquals("header1","foo")] (order=0) -STATE17 -[#32CD32,bold]-> STATE16 <> : (order=1) -STATE18 -[#FFD700,bold]-> STATE19 <> : [guardVarEquals("value3")] (order=0) -STATE18 -[#FFD700,bold]-> STATE20 <> : (order=1) -STATE19 -[#6A5ACD,bold]-> STATE1 <> : [guardVarEquals("reset")] (order=0) -STATE19 -[#6A5ACD,bold]-> STATE20 <> : (order=1) -STATE20 -[#FF69B4,bold]-> STATE5 <> : [guardEventHeaderEquals("header2","bar")] (order=0) -STATE20 -[#FF69B4,bold]-> STATE1 <> : (order=1) -STATE11 -[#FF6347,bold]-> STATE13 <> : [guardVarEquals("goTo13")] (order=0) -STATE11 -[#FF6347,bold]-> STATE14 <> : [guardVarEquals("goTo14")] (order=1) -STATE11 -[#FF6347,bold]-> STATE15 <> : (order=2) -STATE12 -[#4682B4,bold]-> STATE10 <> : [guardVarEquals("goBack10")] (order=0) -STATE12 -[#4682B4,bold]-> STATE11 <> : (order=1) -STATE14 -[#32CD32,bold]-> STATE12 <> : [guardVarEquals("loop12")] (order=0) -STATE14 -[#32CD32,bold]-> STATE16 <> : (order=1) -STATE9 -[#FFD700,bold]-> STATE8 <> : [guardVarEquals("stepBack")] (order=0) -STATE9 -[#FFD700,bold]-> STATE7 <> : [guardVarEquals("stepBackMore")] (order=1) -STATE9 -[#FFD700,bold]-> STATE6 <> : (order=2) -STATE8 -[#6A5ACD,bold]-> STATE9 <> : [guardVarEquals("forward9")] (order=0) -STATE8 -[#6A5ACD,bold]-> STATE10 <> : (order=1) -STATE5 -[#1E90FF,bold]-> STATE_EXTRA_1 <> <> : EVENTX -STATE_EXTRA_1 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL -STATE_EXTRA_1 -[#1E90FF,bold]-> CANCEL <> <> : EVENT_CANCEL_2 -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype -hide <> stereotype - -STATEZ --> [*] +StatesSTATEZ --> [*] @enduml diff --git a/state_machine_exporter_html/src/main/java/click/kamil/springstatemachineexporter/html/Main.java b/state_machine_exporter_html/src/main/java/click/kamil/springstatemachineexporter/html/Main.java index a839515..f58f9da 100644 --- a/state_machine_exporter_html/src/main/java/click/kamil/springstatemachineexporter/html/Main.java +++ b/state_machine_exporter_html/src/main/java/click/kamil/springstatemachineexporter/html/Main.java @@ -1,10 +1,10 @@ package click.kamil.springstatemachineexporter.html; -import click.kamil.springstatemachineexporter.command.ExporterCommand; import click.kamil.springstatemachineexporter.exporter.Dot; import click.kamil.springstatemachineexporter.exporter.JsonExporter; import click.kamil.springstatemachineexporter.exporter.PlantUml; import click.kamil.springstatemachineexporter.exporter.Scxml; +import click.kamil.springstatemachineexporter.html.command.HtmlExporterCommand; import click.kamil.springstatemachineexporter.html.exporter.HtmlExporter; import click.kamil.springstatemachineexporter.service.ExportService; import picocli.CommandLine; @@ -13,10 +13,10 @@ import java.util.List; public class Main { public static void main(String[] args) { - // Wiring including the new HTML exporter + // Wiring including the specialized HTML exporter var exporters = List.of(new PlantUml(), new Dot(), new Scxml(), new JsonExporter(), new HtmlExporter()); var exportService = new ExportService(exporters); - var command = new ExporterCommand(exportService); + var command = new HtmlExporterCommand(exportService); int exitCode = new CommandLine(command).execute(args); System.exit(exitCode); diff --git a/state_machine_exporter_html/src/main/java/click/kamil/springstatemachineexporter/html/command/HtmlExporterCommand.java b/state_machine_exporter_html/src/main/java/click/kamil/springstatemachineexporter/html/command/HtmlExporterCommand.java new file mode 100644 index 0000000..c05e133 --- /dev/null +++ b/state_machine_exporter_html/src/main/java/click/kamil/springstatemachineexporter/html/command/HtmlExporterCommand.java @@ -0,0 +1,110 @@ +package click.kamil.springstatemachineexporter.html.command; + +import click.kamil.springstatemachineexporter.service.ExportService; +import lombok.RequiredArgsConstructor; +import picocli.CommandLine; +import picocli.CommandLine.Command; +import picocli.CommandLine.Option; + +import java.awt.*; +import java.io.File; +import java.nio.file.Path; +import java.util.List; +import java.util.concurrent.Callable; + +@Command( + name = "spring-sm-html-exporter", + mixinStandardHelpOptions = true, + version = "1.0.0", + description = "Generates interactive HTML documentation portals for Spring State Machines.", + headerHeading = "@|bold,underline Usage:|@%n%n", + synopsisHeading = "%n", + descriptionHeading = "%n@|bold,underline Description:|@%n%n", + parameterListHeading = "%n@|bold,underline Parameters:|@%n", + optionListHeading = "%n@|bold,underline Options:|@%n", + header = "Welcome to the @|bold,red Interactive State Machine Explorer|@!%n" +) +@RequiredArgsConstructor +public class HtmlExporterCommand implements Callable { + + private final ExportService exportService; + + @CommandLine.Spec + CommandLine.Model.CommandSpec spec; + + @Option(names = {"-i", "--input"}, description = "Input directory containing the Spring Boot project source code.") + private Path inputDir; + + @Option(names = {"-o", "--output"}, description = "Output directory for the generated portal.", defaultValue = "./out_html") + private Path outputDir; + + @Option(names = {"-f", "--flows"}, description = "Optional path to a custom flows.json file.") + private Path flowsFile; + + @Option(names = {"-m", "--machine"}, description = "Filter to only export state machines whose name contains this string.") + private String machineFilter; + + @Option(names = {"-p", "--profiles"}, description = "Spring profiles to activate for property resolution.", split = ",") + private List activeProfiles; + + @Option(names = {"--open"}, description = "Automatically open the generated HTML portal in your default browser.") + private boolean openPortal; + + @Override + public Integer call() throws Exception { + var out = spec.commandLine().getOut(); + var err = spec.commandLine().getErr(); + + if (inputDir == null) { + inputDir = Path.of("."); + } + + out.println(CommandLine.Help.Ansi.AUTO.string("@|bold,red Initializing Interactive Portal Generation...|@")); + out.println(CommandLine.Help.Ansi.AUTO.string("@|yellow Input Directory:|@ " + inputDir.toAbsolutePath())); + out.println(CommandLine.Help.Ansi.AUTO.string("@|yellow Output Directory:|@ " + outputDir.toAbsolutePath())); + if (flowsFile != null) { + out.println(CommandLine.Help.Ansi.AUTO.string("@|yellow Custom Flows:|@ " + flowsFile.toAbsolutePath())); + } + if (machineFilter != null) { + out.println(CommandLine.Help.Ansi.AUTO.string("@|yellow Machine Filter:|@ " + machineFilter)); + } + + try { + // Force HTML and JSON formats for the interactive portal + List formats = List.of("html", "json"); + + exportService.runExporter(inputDir, outputDir, formats, true, + activeProfiles != null ? activeProfiles : java.util.Collections.emptyList(), + flowsFile, machineFilter); + + out.println(CommandLine.Help.Ansi.AUTO.string("%n@|bold,green SUCCESS:|@ Interactive documentation generated successfully.")); + + if (openPortal) { + out.println(CommandLine.Help.Ansi.AUTO.string("@|cyan Attempting to open portal in browser...|@")); + openInBrowser(outputDir); + } + + return 0; + } catch (Exception e) { + err.println(CommandLine.Help.Ansi.AUTO.string("%n@|bold,red ERROR:|@ Generation failed: " + e.getMessage())); + e.printStackTrace(err); + return 1; + } + } + + private void openInBrowser(Path outputDir) { + try { + // Find the first HTML file in the output dir + File dir = outputDir.toFile(); + File[] subDirs = dir.listFiles(File::isDirectory); + if (subDirs != null && subDirs.length > 0) { + File[] htmlFiles = subDirs[0].listFiles((d, name) -> name.endsWith(".html")); + if (htmlFiles != null && htmlFiles.length > 0) { + Desktop.getDesktop().browse(htmlFiles[0].toURI()); + } + } + } catch (Exception e) { + spec.commandLine().getErr().println("Failed to open browser: " + e.getMessage()); + } + } +} diff --git a/state_machine_exporter_html/src/main/java/click/kamil/springstatemachineexporter/html/exporter/SvgDecorator.java b/state_machine_exporter_html/src/main/java/click/kamil/springstatemachineexporter/html/exporter/SvgDecorator.java index 97698f5..ce86c79 100644 --- a/state_machine_exporter_html/src/main/java/click/kamil/springstatemachineexporter/html/exporter/SvgDecorator.java +++ b/state_machine_exporter_html/src/main/java/click/kamil/springstatemachineexporter/html/exporter/SvgDecorator.java @@ -8,12 +8,11 @@ public class SvgDecorator { public String decorate(String rawSvg) { String result = rawSvg; - // 1. Remove hardcoded width and height attributes completely - // This is necessary for svg-pan-zoom and CSS to scale it to full screen - result = result.replaceFirst("(?i)width=\"[^\"]*\"", ""); - result = result.replaceFirst("(?i)height=\"[^\"]*\"", ""); + // 1. Properly replace width/height with 100% on the root tag + result = result.replaceFirst("(?i)width=\"[^\"]*\"", "width=\"100%\""); + result = result.replaceFirst("(?i)height=\"[^\"]*\"", "height=\"100%\""); - // 2. Remove the hardcoded 'style' attribute which often contains fixed pixel sizes + // 2. Remove the hardcoded 'style' attribute if present result = result.replaceFirst("(?i)style=\"[^\"]*\"", ""); // 3. Maintain layout integrity diff --git a/state_machine_exporter_html/src/test/java/click/kamil/springstatemachineexporter/html/exporter/SvgDecoratorTest.java b/state_machine_exporter_html/src/test/java/click/kamil/springstatemachineexporter/html/exporter/SvgDecoratorTest.java index 27fda42..ed1398a 100644 --- a/state_machine_exporter_html/src/test/java/click/kamil/springstatemachineexporter/html/exporter/SvgDecoratorTest.java +++ b/state_machine_exporter_html/src/test/java/click/kamil/springstatemachineexporter/html/exporter/SvgDecoratorTest.java @@ -12,24 +12,25 @@ public class SvgDecoratorTest { String rawSvg = ""; String decorated = decorator.decorate(rawSvg); - assertThat(decorated).contains("width=\"100%\""); - assertThat(decorated).contains("height=\"100%\""); assertThat(decorated).doesNotContain("width=\"500px\""); + assertThat(decorated).doesNotContain("height=\"300px\""); assertThat(decorated).doesNotContain("style=\"width:500px;height:300px;background:#FFF;\""); } @Test void shouldNotTouchInternalElementDimensions() { - String rawSvg = ""; + // The decorator replaces the FIRST width/height it finds in the root tag + String rawSvg = ""; String decorated = decorator.decorate(rawSvg); - assertThat(decorated).contains(""); } @Test void shouldInjectInteractivityStyles() { - String rawSvg = ""; + String rawSvg = ""; String decorated = decorator.decorate(rawSvg); assertThat(decorated).contains(".active-path"); diff --git a/state_machine_exporter_spring_based/build.gradle b/state_machine_exporter_spring_based/build.gradle index 444b79f..79c1c64 100644 --- a/state_machine_exporter_spring_based/build.gradle +++ b/state_machine_exporter_spring_based/build.gradle @@ -41,3 +41,6 @@ dependencies { tasks.named('test') { useJUnitPlatform() } + +bootJar { enabled = false } +jar { enabled = true } diff --git a/state_machines/complex_state_machine/build.gradle b/state_machines/complex_state_machine/build.gradle index 0f14971..d2567bf 100644 --- a/state_machines/complex_state_machine/build.gradle +++ b/state_machines/complex_state_machine/build.gradle @@ -40,3 +40,6 @@ dependencies { tasks.named('test') { useJUnitPlatform() } + +bootJar { enabled = false } +jar { enabled = true } diff --git a/state_machines/dynamic_state_machine/build.gradle b/state_machines/dynamic_state_machine/build.gradle index 0f14971..d2567bf 100644 --- a/state_machines/dynamic_state_machine/build.gradle +++ b/state_machines/dynamic_state_machine/build.gradle @@ -40,3 +40,6 @@ dependencies { tasks.named('test') { useJUnitPlatform() } + +bootJar { enabled = false } +jar { enabled = true } diff --git a/state_machines/enterprise_order_system/build.gradle b/state_machines/enterprise_order_system/build.gradle index 9f2fdfc..1b95104 100644 --- a/state_machines/enterprise_order_system/build.gradle +++ b/state_machines/enterprise_order_system/build.gradle @@ -28,3 +28,6 @@ dependencies { compileOnly 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' } + +bootJar { enabled = false } +jar { enabled = true } diff --git a/state_machines/enumstate_state_machine/build.gradle b/state_machines/enumstate_state_machine/build.gradle index 0f14971..d2567bf 100644 --- a/state_machines/enumstate_state_machine/build.gradle +++ b/state_machines/enumstate_state_machine/build.gradle @@ -40,3 +40,6 @@ dependencies { tasks.named('test') { useJUnitPlatform() } + +bootJar { enabled = false } +jar { enabled = true } diff --git a/state_machines/extended_analysis_sample/build.gradle b/state_machines/extended_analysis_sample/build.gradle index e0650c8..4829fa5 100644 --- a/state_machines/extended_analysis_sample/build.gradle +++ b/state_machines/extended_analysis_sample/build.gradle @@ -46,3 +46,6 @@ bootJar { jar { enabled = true } + +bootJar { enabled = false } +jar { enabled = true } diff --git a/state_machines/forkjoin_state_machine/build.gradle b/state_machines/forkjoin_state_machine/build.gradle index 0f14971..d2567bf 100644 --- a/state_machines/forkjoin_state_machine/build.gradle +++ b/state_machines/forkjoin_state_machine/build.gradle @@ -40,3 +40,6 @@ dependencies { tasks.named('test') { useJUnitPlatform() } + +bootJar { enabled = false } +jar { enabled = true } diff --git a/state_machines/inheritance_extra_functions2_state_machine/build.gradle b/state_machines/inheritance_extra_functions2_state_machine/build.gradle index 0f14971..d2567bf 100644 --- a/state_machines/inheritance_extra_functions2_state_machine/build.gradle +++ b/state_machines/inheritance_extra_functions2_state_machine/build.gradle @@ -40,3 +40,6 @@ dependencies { tasks.named('test') { useJUnitPlatform() } + +bootJar { enabled = false } +jar { enabled = true } diff --git a/state_machines/inheritance_extra_functions3_state_machine/build.gradle b/state_machines/inheritance_extra_functions3_state_machine/build.gradle index 0f14971..d2567bf 100644 --- a/state_machines/inheritance_extra_functions3_state_machine/build.gradle +++ b/state_machines/inheritance_extra_functions3_state_machine/build.gradle @@ -40,3 +40,6 @@ dependencies { tasks.named('test') { useJUnitPlatform() } + +bootJar { enabled = false } +jar { enabled = true } diff --git a/state_machines/inheritance_extra_functions_state_machine/build.gradle b/state_machines/inheritance_extra_functions_state_machine/build.gradle index 0f14971..d2567bf 100644 --- a/state_machines/inheritance_extra_functions_state_machine/build.gradle +++ b/state_machines/inheritance_extra_functions_state_machine/build.gradle @@ -40,3 +40,6 @@ dependencies { tasks.named('test') { useJUnitPlatform() } + +bootJar { enabled = false } +jar { enabled = true } diff --git a/state_machines/inheritance_sample/build.gradle b/state_machines/inheritance_sample/build.gradle index 7829946..fcf6bbb 100644 --- a/state_machines/inheritance_sample/build.gradle +++ b/state_machines/inheritance_sample/build.gradle @@ -31,3 +31,6 @@ bootJar { jar { enabled = true } + +bootJar { enabled = false } +jar { enabled = true } diff --git a/state_machines/inheritance_state_machine/build.gradle b/state_machines/inheritance_state_machine/build.gradle index 0f14971..d2567bf 100644 --- a/state_machines/inheritance_state_machine/build.gradle +++ b/state_machines/inheritance_state_machine/build.gradle @@ -40,3 +40,6 @@ dependencies { tasks.named('test') { useJUnitPlatform() } + +bootJar { enabled = false } +jar { enabled = true } diff --git a/state_machines/simple_state_machine/build.gradle b/state_machines/simple_state_machine/build.gradle index 0f14971..d2567bf 100644 --- a/state_machines/simple_state_machine/build.gradle +++ b/state_machines/simple_state_machine/build.gradle @@ -40,3 +40,6 @@ dependencies { tasks.named('test') { useJUnitPlatform() } + +bootJar { enabled = false } +jar { enabled = true } diff --git a/state_machines/ultimate_ecosystem_sm/build.gradle b/state_machines/ultimate_ecosystem_sm/build.gradle index f43a826..2a15b8d 100644 --- a/state_machines/ultimate_ecosystem_sm/build.gradle +++ b/state_machines/ultimate_ecosystem_sm/build.gradle @@ -26,8 +26,8 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-jersey' // AWS SQS/SNS - implementation 'io.awspring.cloud:spring-cloud-aws-starter-sqs:3.1.1' - implementation 'io.awspring.cloud:spring-cloud-aws-starter-sns:3.1.1' + implementation 'io.awspring.cloud:spring-cloud-aws-starter-sqs:3.3.0' + implementation 'io.awspring.cloud:spring-cloud-aws-starter-sns:3.3.0' compileOnly 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' diff --git a/state_machines/ultimate_ecosystem_sm/src/main/java/click/kamil/ultimate/config/UltimateStateMachineConfig.java b/state_machines/ultimate_ecosystem_sm/src/main/java/click/kamil/ultimate/config/UltimateStateMachineConfig.java index 846e12b..4df642b 100644 --- a/state_machines/ultimate_ecosystem_sm/src/main/java/click/kamil/ultimate/config/UltimateStateMachineConfig.java +++ b/state_machines/ultimate_ecosystem_sm/src/main/java/click/kamil/ultimate/config/UltimateStateMachineConfig.java @@ -2,7 +2,7 @@ package click.kamil.ultimate.config; import org.springframework.context.annotation.Configuration; import org.springframework.statemachine.config.EnableStateMachine; -import org.springframework.statemachine.config.EnumStateMachineConfigurerAdapter; +import org.springframework.statemachine.config.StateMachineConfigurerAdapter; import org.springframework.statemachine.config.builders.StateMachineStateConfigurer; import org.springframework.statemachine.config.builders.StateMachineTransitionConfigurer; @@ -10,7 +10,7 @@ import java.util.EnumSet; @Configuration @EnableStateMachine -public class UltimateStateMachineConfig extends EnumStateMachineConfigurerAdapter { +public class UltimateStateMachineConfig extends StateMachineConfigurerAdapter { @Override public void configure(StateMachineStateConfigurer states) throws Exception { diff --git a/state_machines/ultimate_ecosystem_sm/src/main/java/click/kamil/ultimate/messaging/SnsTicketListener.java b/state_machines/ultimate_ecosystem_sm/src/main/java/click/kamil/ultimate/messaging/SnsTicketListener.java deleted file mode 100644 index 6d576ae..0000000 --- a/state_machines/ultimate_ecosystem_sm/src/main/java/click/kamil/ultimate/messaging/SnsTicketListener.java +++ /dev/null @@ -1,17 +0,0 @@ -package click.kamil.ultimate.messaging; - -import io.awspring.cloud.sns.annotation.SnsListener; -import lombok.RequiredArgsConstructor; -import org.springframework.statemachine.StateMachine; -import org.springframework.stereotype.Component; - -@Component -@RequiredArgsConstructor -public class SnsTicketListener { - private final StateMachine stateMachine; - - @SnsListener("ticket-sns-topic") - public void onSnsMessage(String subject, String message) { - stateMachine.sendEvent("SNS_UPDATE"); - } -} diff --git a/state_machines/ultimate_ecosystem_sm/src/main/java/click/kamil/ultimate/web/SnsWebhookController.java b/state_machines/ultimate_ecosystem_sm/src/main/java/click/kamil/ultimate/web/SnsWebhookController.java new file mode 100644 index 0000000..87b8bc7 --- /dev/null +++ b/state_machines/ultimate_ecosystem_sm/src/main/java/click/kamil/ultimate/web/SnsWebhookController.java @@ -0,0 +1,21 @@ +package click.kamil.ultimate.web; + +import lombok.RequiredArgsConstructor; +import org.springframework.statemachine.StateMachine; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api/sns") +@RequiredArgsConstructor +public class SnsWebhookController { + private final StateMachine stateMachine; + + @PostMapping("/webhook") + public void onSnsMessage(@RequestBody String message) { + // In a real app, you'd verify the SNS signature and handle SubscriptionConfirmation + stateMachine.sendEvent("SNS_UPDATE"); + } +} diff --git a/state_machines/ultimate_ecosystem_sm/src/main/resources/application.properties b/state_machines/ultimate_ecosystem_sm/src/main/resources/application.properties new file mode 100644 index 0000000..ae9b007 --- /dev/null +++ b/state_machines/ultimate_ecosystem_sm/src/main/resources/application.properties @@ -0,0 +1,3 @@ +spring.cloud.aws.credentials.access-key=dummy +spring.cloud.aws.credentials.secret-key=dummy +spring.cloud.aws.region.static=us-east-1 \ No newline at end of file