Skip to content

🥳 New Feature 🥳 PlantUML visualization #1158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 42 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
5f7a0e9
test: add testStateMachineVsStateMachineModelConsistency()
Mar 4, 2024
79eb82a
test: testStateMachineVsStateMachineModelConsistency() add png image …
Mar 4, 2024
2d07152
test: testStateMachineVsStateMachineModelConsistency() update png
Mar 6, 2024
3a496b4
test: testStateMachineVsStateMachineModelConsistency() update javadoc…
Mar 6, 2024
b7d2387
Merge branch 'main' of https://github.com/pdalfarr/spring-statemachine
Jun 16, 2024
1381468
feat: add PlantUml rendering feature
Jul 5, 2024
238be9c
feat: illustrate use of hiddenTransitions
Jul 5, 2024
1fca598
fix: fix NPE
Jul 9, 2024
5f1a4f4
fix: Fix TransitionComparator
Jul 10, 2024
a7b2add
fix: Fix TransitionComparator
Jul 10, 2024
961f5ce
chore: code cleaning
Jul 11, 2024
59df160
feat: add global diagram settings + update arrow colors + update unit…
Jul 11, 2024
935fa33
chore: Add Apache license header
Jul 11, 2024
bbab08e
chore: make attributes private
Jul 17, 2024
ceecb4e
feat: improve NameGetter (AopProxyUtils) + add 'ignoredTransitions' +…
Oct 8, 2024
42ccaa4
feat: add arrow length parameter
Nov 6, 2024
7245eba
chore: keep hiddenTransitions sorted + fix getArrowLength
Nov 7, 2024
b77ee89
feat: add PlantUmlWriterParameters.note()
Mar 4, 2025
9ed56eb
Merge branch 'spring-projects:main' into main
pdalfarr Mar 4, 2025
3b29592
feat: add PlantUmlWriterParameters.note() - update png
Mar 4, 2025
b9f3ef7
fix: fix collectAllStates() typo + bump to plantuml-asl-1.2025.2
Mar 11, 2025
f17dcd9
test: testStateMachineVsStateMachineModelConsistency() add png image …
Mar 4, 2024
73437d0
test: testStateMachineVsStateMachineModelConsistency() update png
Mar 6, 2024
6c58ace
test: testStateMachineVsStateMachineModelConsistency() update javadoc…
Mar 6, 2024
5e34b86
feat: add PlantUml rendering feature
Jul 5, 2024
7efd7d9
feat: illustrate use of hiddenTransitions
Jul 5, 2024
b101283
fix: fix NPE
Jul 9, 2024
5631a8e
fix: Fix TransitionComparator
Jul 10, 2024
2afe0dd
fix: Fix TransitionComparator
Jul 10, 2024
ed95830
chore: code cleaning
Jul 11, 2024
fe58235
feat: add global diagram settings + update arrow colors + update unit…
Jul 11, 2024
07ba7c4
chore: Add Apache license header
Jul 11, 2024
92bbacb
chore: make attributes private
Jul 17, 2024
bc84234
feat: improve NameGetter (AopProxyUtils) + add 'ignoredTransitions' +…
Oct 8, 2024
7f9a27e
feat: add arrow length parameter
Nov 6, 2024
aaecace
chore: keep hiddenTransitions sorted + fix getArrowLength
Nov 7, 2024
00048f3
feat: add PlantUmlWriterParameters.note()
Mar 4, 2025
eaec709
feat: add PlantUmlWriterParameters.note() - update png
Mar 4, 2025
c81786e
fix: fix collectAllStates() typo + bump to plantuml-asl-1.2025.2
Mar 11, 2025
2215b1b
Merge branch 'main' of https://github.com/pdalfarr/spring-statemachine
pdalfarr Mar 12, 2025
a5c8b6e
Merge branch 'spring-projects:main' into main
pdalfarr Mar 12, 2025
39de9c4
chore: remove lombok dependency
pdalfarr Mar 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions spring-statemachine-uml/spring-statemachine-uml.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,17 @@ dependencies {
api 'org.eclipse.emf:org.eclipse.emf.ecore.xmi'
api 'org.eclipse.emf:org.eclipse.emf.ecore'
api 'org.eclipse.emf:org.eclipse.emf.common'

implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation'net.sourceforge.plantuml:plantuml-asl:1.2025.2'
implementation 'jakarta.validation:jakarta.validation-api:3.1.0'

testImplementation(testFixtures(project(":spring-statemachine-core")))
testImplementation 'org.assertj:assertj-core'
testImplementation 'io.projectreactor:reactor-test'
testImplementation 'org.springframework:spring-test'
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.junit.jupiter:junit-jupiter-engine'
testImplementation 'org.junit.jupiter:junit-jupiter-params'
testImplementation 'org.awaitility:awaitility'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.springframework.statemachine.plantuml;

import org.springframework.lang.Nullable;
import org.springframework.statemachine.StateContext;

public record ContextTransition<S, E>(S source, E event, S target) {

public static <S, E> ContextTransition<S, E> of(@Nullable StateContext<S, E> stateContext) {
if (stateContext != null) {
return new ContextTransition<>(
stateContext.getSource() != null
? stateContext.getSource().getId()
: null,
stateContext.getEvent(),
stateContext.getTarget() != null
? stateContext.getTarget().getId()
: null
);
}
return null;
}
}
Loading