Comments (10)
PlantUml accepts titles for entities:
state InvalidBarcode as "Title"
- unique state.name is converted to entity itself and
- non-unique state.displayName to title
transition.displayName is converted to arrow description without any problem
from kstatemachine.
Added PR from my personal Github account. Should not break any existing code.
#90
Published to local maven, added to my project - works.
from kstatemachine.
I dont think it is safe to relax "unique name" restriction.
APIs like findState(name: String, ...)
if based on it.
But possibly we can upgrade exportToPlantUml() function to accept converters/beautifiers for names.
Converters/beautifiers are functions that take original state/transition/machine and return printable name.
So if your state names follow some schema like Block1.Group1.State1 you can simply drop the path and leave only State1 as printable name.
What do you think about it?
from kstatemachine.
I have another idea:
displayName
or umlName
which can be defaulted to name
, but can be overriden and will be used solely in umls
from kstatemachine.
yes, this is also possible, but this requires to change many APIs that are not related to the export feature.
What about plantUml itself, how it handles non unique names? I suppose it can have a problems with transitions directions?
from kstatemachine.
I can create PR, if you do not see that it might have side effects
from kstatemachine.
looks this issue is related to #82
Some kind of meta data objects should cover both cases.
I do not see any side effects, yes you can open a PR, thank you.
from kstatemachine.
Started with PR and already have one question.
internal class CheckUniqueNamesVisitor : RecursiveVisitor {
...
private val transitionNames = mutableSetOf<String>()
...
override fun <E : Event> visit(transition: Transition<E>) {
transition.name?.let { check(transitionNames.add(it)) { "Transition name is not unique: $it" } }
}
}
transition.name visitor has no sense so far. Name is used only there and in export to uml. Can this check be omitted?
If check not applicable, then name
can be not unique and can be safely used for uml labels
from kstatemachine.
it is also used here, so the name behaviour should not change.
/**
* Find transition by name. This might be used to start listening to transition after state machine setup.
*/
fun TransitionStateApi.findTransition(name: String) = transitions.find { it.name == name }
from kstatemachine.
Done in https://github.com/nsk90/kstatemachine/releases/tag/v0.27.0
Thanks, for the contribution!
from kstatemachine.
Related Issues (20)
- onEntry with Transition or Conditional Transition without Event HOT 5
- Update Data of a DataState HOT 4
- data transition should no be self targeted, use simple transition instead HOT 2
- please add choiceDataState method HOT 3
- java.lang.IllegalArgumentException: Cannot set current state in child mode PARALLEL HOT 1
- State machine and Android lifecycle HOT 6
- Export to PlantUml: GuardedTransitionOnBuilder are not drawn in diagram HOT 4
- Sources are not packaged correctly HOT 2
- app crash when sending multiple events at once(through for loop) HOT 11
- Versions HOT 3
- Getting crash if I try to use `machine.startBlocking` from machine created with `createStdLibStateMachine` HOT 3
- Support wasmJs HOT 6
- Clarification of concurrency HOT 5
- Event queue is not empty, internal error HOT 5
- Need explanation for choice states HOT 3
- Data validation and transformation via events or state HOT 4
- How to do parallel data states? HOT 2
- Initial Choice State as Nested State of Data State HOT 3
- Implement Intellij visualisation plugin
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kstatemachine.