Not able to compile this workflow in run time
-
24. dubna 2012 20:18
Hi,
I tried to create a run time flowchart with a collection of activities ,as below. I tried to compile this flow but was getting the below errors as
"The Root activity is invalid" / "The Root element is invalid " . So how to solve this issue.
The idea is to show the end user in run time the xoml and on compilation ,view the step by step process on execution.
<Flowchart mc:Ignorable="sap" DisplayName="Loan Process Flow" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:l="clr-namespace:Business;assembly=Business" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">False</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<Flowchart.StartNode>
<x:Reference>__ReferenceID3</x:Reference>
</Flowchart.StartNode>
<FlowStep x:Name="__ReferenceID3">
<l:StepProcess1 Data="{x:Null}" Result="{x:Null}" DisplayName="Step1" />
<FlowStep.Next>
<FlowStep x:Name="__ReferenceID0">
<l:StepProcess2 Data="{x:Null}" IsSaved="{x:Null}" Result="{x:Null}" DisplayName="Step3" />
<FlowStep.Next>
<FlowStep x:Name="__ReferenceID1">
<l:StepProcess3 Data="{x:Null}" IsSaved="{x:Null}" Result="{x:Null}" DisplayName="Step4" />
<FlowStep.Next>
<FlowStep x:Name="__ReferenceID2">
<l:StepProcess4 Data="{x:Null}" IsSaved="{x:Null}" Result="{x:Null}" DisplayName="Step5" />
</FlowStep>
</FlowStep.Next>
</FlowStep>
</FlowStep.Next>
</FlowStep>
</FlowStep.Next>
</FlowStep>
<x:Reference>__ReferenceID0</x:Reference>
<x:Reference>__ReferenceID1</x:Reference>
<x:Reference>__ReferenceID2</x:Reference>
</Flowchart>
Všechny reakce
-
26. dubna 2012 3:32Moderátor
Hi,
How did you build the Flowchart workflow? Could you please share a simple project or send it to me at: liangliang(dot)tang(at)hotmail(dot)com. It will be convenient for us reproduce this issue, thanks.
Leo Tang [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help. -
29. dubna 2012 20:31Moderátor
If you are compiling with XamlBuildTask, by setting the file properties in VS to XamlAppDef, then the root element must be <Activity x:Class>.
On the other hand, you can also use your workflow XAML (no longer called XOML in WF4) without compiling.
Just by using ActivityXamlServices.Load() to load it as a DynamicActivity object, then using WorkflowInvoker or WorkflowApplication to run that.In this case you can set the file properties in VS to None, and enable copying to the output directory.
Tim
- Označen jako odpověď LeoTangModerator 2. května 2012 3:27