Since there are many questions about a state machine automata in VL and the recent prototype patched in VL, I was looking into which options the C#/.NET world has to offer and found a crazy system that everyone seems to have on their windows pc already. Its’s called Windows Workflow Foundation and is usually used to model enterprise workflows that run on servers and connect to data bases.
Turns out they implemented some kind of visual programming environment and a state machine workflow and it is also a common scenario to host the workflow designer in an application. I’ve customized such a sample project to the needs of using the state machine and it works very good so far. Most time was spent on understanding the system and finalize the nodes, but it shows how software systems can be integrated and used in VL without much effort:
It comes with:
Workflow Designer
- Workflow Designer - Rehosting in one Form with one tab per state machine
- ToolboxControl - Selected for working with state machines
- Workflow Execution - Retrieve real-time Execution Log (TrackData)
- Workflow Management - Store to file / Run / Stop
- Nested State Machines - Build state machine hierachies
- IStateMachineControl - Interface to control a state machine by code
Custom Activities
- Wait - Waits for a message with name of parent transition, must be placed in the “Trigger” of a transition
- WaitFor - Waits for a given message, can be placed anywhere
VL Nodes
- StateMachine - Instance as process node
- SendMessage - Trigger state machine transitions and custom wait points
- State - Get info from a selected state
- ActiveStates - Get a spread of active states
- EditorWindow - Show/hide the designer
Pros:
- Fully working editor
- Normal shortcuts like ctrl+s, undo/redo work
- Many events like state enter, close, transition enter/close etc.
- Can wait on each event for a custom message
- Variables that can be used to further refine the logic
- Developed and tested by microsoft engineers
- Debugging via execution log
- Restart while running with latest edit
Cons:
- Windows only
- Boring visual style
- No direct jump to certain states, but would be possible with more coding
- Realtime update possible, also would need more time
So now the question, does it run on other computers? Would be nice if you can give it a testing round. Donwload and unzip this file, open the file vvvv\Demo.v4p with vvvv beta38.1 and see what happens:
VL.WorkflowFoundation.0.1.0.zip (3.5 MB)
You should end up with this patch:
More info and source code: