in my workflow, I wanna dynamically create a WPF window, with several buttons on it. When I click the buttons, it will invoke a sub-process. The sub-processes are all located in a folder in my project. I’ve done it by writing some codes in an Invoke Code activity. Here is my code. The sub-process can be invoked, but if there’re Invoke Workflow File activities in the sub-process, a runtime error, Object reference not set to an instance of an object, would be thrown when executing the Invoke Workflow File. Any ideas on why would this happen? What am I missing? Thanks!
AddHandler btn.Click, Sub(sender2, e2) Dim btnEvent As System.Windows.Controls.Button = CType(sender2, System.Windows.Controls.Button) Dim processName As String = btnEvent.Tag.ToString Dim act As Activity = ActivityXamlServices.Load("General\" + processName + "\Main.xaml") Dim inputs As Dictionary(Of String, Object) = New Dictionary(Of String, Object) inputs.Add("BasePath", Path.Combine(Environment.CurrentDirectory,"General",processName)) WorkflowInvoker.Invoke(act, inputs) End Sub