13. dubna 2012 17:07
My code is taken from the VS 2010 help file for Workflow class:
Typetype = typeof(ImportXml);
WorkflowInstanceworkflowInstance = WfRuntime.CreateWorkflow(type);
Where ImportXml is my Workflow - it is actually a Flowchart.
The exception "The input workflow type must be an Activity" is thrown. The base type of ImportXml is System.Activities.Activity so I don't understand this.
16. dubna 2012 7:24Moderátor
We use WorkflowRuntime in Workflow 3(WF3) to host workflow and workflow service. However, Flowchart is not available in WF3, it is available in Workflow 4(WF4). Please make sure the target framework of your project is .NET Framework 4 or later version, then you can host your workflow by using WorkflowInvoker or WorkflowApplication. For example:
WorkflowApplication wfApp = new WorkflowApplication(new ImportXml());
For more information about hosting workflows in WF4, you can refer to:
If you still want to use WF3, then you need to use StateMachine workflow instead of FlowChart. Thanks.
- Označen jako odpověď LeoTangModerator 23. dubna 2012 0:42