VL.WorkflowFoundation

Added a simplified zip for gamma only users. @remony

2 Likes

I try to Export Project at vvvv gamma 2.6 and run file, but got exception!!

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at RehostedWorkflowDesigner.Views.StateMachineControl.SetDesigner(String filePath)
at RehostedWorkflowDesigner.Views.StateMachineControl.OnInitialized(EventArgs e)
at System.Windows.FrameworkElement.TryFireInitialized()
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.InitializationGuard(XamlType xamlType, Object obj, Boolean begin)
at System.Xaml.XamlObjectWriter.Logic_EndInit(ObjectWriterContext ctx)
at System.Xaml.XamlObjectWriter.WriteEndObject()
at System.Windows.Markup.WpfXamlLoader.TransformNodes(XamlReader xamlReader, XamlObjectWriter xamlWriter, Boolean onlyLoadOneNode, Boolean skipJournaledProperties, Boolean shouldPassLineNumberInfo, IXamlLineInfo xamlLineInfo, IXamlLineInfoConsumer xamlLineInfoConsumer, XamlContextStack`1 stack, IStyleConnector styleConnector)
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at RehostedWorkflowDesigner.Views.StateMachineControlā€¦ctor()
at RehostedWorkflowDesigner.Views.StateMachineTabs.AddMachine(String name)
at RehostedWorkflowDesigner.StateMachineService.AddStateMachine(String name)
at VL_WorkflowFoundation.WorkflowFoundation.StateMachine_JrmSMngRBoDO07t63iDcIo.Create(NodeContext Node_Context)
at Machine_2.Main.Machine_2Application_ODb0lIhZy1cOIQE4POLruR.Create(NodeContext Node_Context)
at VL.App.AppHost.d__5.MoveNext()
ā€” End of stack trace from previous location where exception was thrown ā€”
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at VL.App.WindowsForms.WindowsFormsAppHost.<Application_Idle>d__2.MoveNext()
ā€” End of stack trace from previous location where exception was thrown ā€”
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

It looks like the designer file is not found. You need to place the file relative to the exe, in the same way it was relative to the vl doc. Or patch a logic to find the file locally. See also: https://thegraybook.vvvv.org/reference/hde/exporting.html

@tonfilm I place 'DemoMachine.xaml" relative to the exe still not workā€¦(build at gamma 3.2)

Hi guys. Would you recommand the workflowFoundation as state maschine or is there another tool out yet?
Than I would give it a try.

I think it is the most complete and flexible solution at the moment. it can be improved by storing the data in a pin, so it doesnā€™t need file handling, making it a tiny bit easier to use. but having files is also a good thing sometimes. The editor can also handle multiple machines simultaneously, and a state can have a state machine inside, so it is quite advanced.

there are two alternatives, this patched one, as linked above in this thread: VL.Automata
and you could also implement the state pattern with VL, as it is done in VL.Elementa for the interaction, as linked here: https://github.com/vvvv/VL-Language/issues/8

Thank you. Iā€™ll check it out.
** Charismatic Guy explaining the workflow with states, thanks for the link ;)

Hi, while testing this contrib I made this simple state machine :


DisplaySlotStateMachine.zip (2.3 KB)

Now just starting this create a monster memory leak. Is there something wrong with the way Iā€™m using it ?

EDIT ā€“
Damn, my bad indeed. Now in case someone wonder, donā€™t forget to add a Wait inside a transition, otherwise the StateMachine might be spinning forever until your computer explode.
image

1 Like