-
Notifications
You must be signed in to change notification settings - Fork 4
Creating an FSM from Move code
Pranav Patel edited this page Mar 23, 2021
·
4 revisions
The FSMGenerator plugin uses the code inside the customMoveCode
attribute of the model to create the FSM.
The plugin will go into the Model Editor panel and remove all the nodes already in the panel (clear the panel) and then create an initial state and a base state as well as a createTransition
transition from the initial state to the base state. The functions defined in the code will then be used as transitions to loop back the base state.
An example process is as follows:
- Note the empty contract (the model editor can either be empty or have previous nodes, the plugin will delete whatever is already in the model editor panel)
- Ensure there is a
customMoveCode
attribute in the contract by clicking save code in theMove Code Editor
panel with the correct code being displayed.
- Click on the
GenerateFSM
plugin
- Click
Run...
to activate the plugin
- Navigate back to the
Model Editor
panel to view the newly created FSM
Note: multiple transitions stack upon each other, to show all, double click each transition and move them around so that all can be viewed.