https://kotlinlang.org logo
#opensource
Title
# opensource
c

corneil

02/09/2020, 9:08 PM
I have added a module for visualising the finite state-machine definition as both a plantuml state diagram and an asciidoc table. https://github.com/open-jumpco/kfsm-viz
👍 2
j

jimn

02/19/2020, 11:35 AM
this is incredible. is there a bigger tool framework this is aimed at? or at leaszt a gradle/maven plugin for the home gamer?
c

corneil

02/20/2020, 7:39 AM
I am working on the gradle plugin for generating the visualisations should not be too long now.
The main aim with KFSM is support all Kotlin platforms. The gradle plugin will obviously be able to render any of the definitions because it parses the code in question in order to obtain the full lambdas for actions and guard expressions.
This example still uses a unit test to generate the diagram. https://github.com/open-jumpco/kfsm-samples
j

jimn

02/20/2020, 8:05 PM
i noticed the fsm's being drawn conform to a convention. fwiw i'm in agreement with what i know of it so far. is there any genre of coding that applies to the conventions?
c

corneil

02/21/2020, 8:12 AM
Go look at the samples to see how to define and use the FSMs. KFSM provides a DSL for defining an FSM which you can then instanciate and use. In some case like UI you may want to keep the FSM instance active. In the backend you want to externalise the state and supply the state when instanciating the FSM before use.
There are samples for Spring MVC and Spring REST with HATEOAS and then browser with pure Kotlin/JS and one where Javascript is invoking FSM.
j

jimn

02/21/2020, 8:14 AM
@raulraja ^
👍 1
c

corneil

02/21/2020, 8:22 AM
I'll be finalizing and publishing the gradle plugin this weekend.
r

raulraja

02/21/2020, 8:39 AM
Amazing work @corneil! Thanks for sharing and thanks for the mention @jimn
c

corneil

02/21/2020, 11:11 AM
Any input would be welcome
Hi @raulraja if you have some time I would really appreciate some feedback from someone wear a functional hat.
r

raulraja

02/25/2020, 8:09 AM
Hi @corneil, just saw your message, I'll DM you on slack