I’ve been looking for help all over the internet for a couple of hours now.
I found out that the invoke code activity can invoke other workflows with little effort
var settings = new ActivityXamlServicesSettings();
settings.CompileExpressions=true;
var xaml = ActivityXamlServices.Load(@“TestWorkflow2.xaml”,settings);
WorkflowInvoker invoker = new WorkflowInvoker(xaml);
argout=invoker.Invoke(argin,new TimeSpan(0,0,30));
where argout and argin are dictionary<string,object>()
The workflow gets invoked. However, when the invoked workflow enters an application scope, it freezes. The application will boot up (so it enters the scope), but none of the activities inside its scope will be executed. Neither will any activities after the application scope be executed.
Am I missing some settings?
All the other activities inside workflows seem to work, it’s only the application scope that breaks.
The workflow works fine with an Invoke workflow file activity.
The test workflow that’s being invoked is a simple ‘use application/browser’ pointing to a blank/new notepad.exe, and then a ‘type into’ with a constant “hello world”.
an Invoke workflow file will produce the desired result. (open notepad → type “hello world” into notepad)
an Invoke code with the for mentioned code will result in the notepad starting but nothing ever gets typed. The invoke code contains an invoke function that takes a timeout, when this timeout expires an exception is thrown (timeout exception as expected) at the invoke code activity.
Any workflow will start executing, and as far as i’ve tested, any activity will work except the use application/browser scope. It won’t execute its child/inner activities and pause until timeout.
It seems like i’m missing something UI related setting/configuration in an object, but i can’t figure out what.
Can you create a dummy Wokflow only with some other webpage without much child activities and try to invoke using the invoke Workflow activity.
You can use to open a calculator also for the demo.If its working then you need to check the actual workflow you are trying to invoke. Maybe the exe path of the application.
the workflow im testing is a application activity pointing to a blank notepad, and a typeinto actity typing “hello world” into the notepad. I’ve already boiled this down as far as i could to a test case
@temp_dillen Can you disable type into activity an keep some message just for testing. Now run this snippet and check that message box is executing. Copy this snippet in a different sequence and check the results.
Also tried that! I replaced the type into with a messagebox activity, a few comments up i sent a screenshot, the “Start - message box” shows, the messagebox inside the application (so the one replacing the type into) never shows, and the 'Stop - message box" also never shows.