Windows Workflow Foundation 3


CreateWorkflow failing validation


I am trying to start a workflow using a xoml file. I am getting Workflow failed validation in CreateWorkflow with a very simple workflow containing start, delay 1 sec and stop. Is there a trick in getting this to work? Thanks.
// create and start an instance of the workflow runtime
WorkflowRuntime runtime = new WorkflowRuntime();
runtime.StartRuntime();
// get an XML reader to the XAML-based workflow definition
System.Xml.XmlReader xaml = System.Xml.XmlTextReader.Create(txtWorkflowFile.Text);
// create a running instance of our workflow
WorkflowInstance instance;
try
{
instance = runtime.CreateWorkflow(xaml);
instance.Start();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
Right - there are two kind of XAML.
 
Executable XAML - this is XAML where you can get back an Activity Tree from calling WorkflowRuntime.CreateWorkflow.
Compilable XAML - this XAML that can be compiled into a new Activity type (either in VS.NET, via the WFC tool or WorkflowCompiler class).
 
Executable XAML cannot have the Class attribute.  Compilable XAML *must* have the Class attribute.  Executable XAML cannot have any inline code, compilable XAML can.  There are of course other differences as well - but those are the main two.
We really need to see the XAML.  And the error message.
Jon,
Here is the XOML file. If we strip the x:Class="WorkflowDesignerControl.CustomWorkflow" from the Xoml then we execute fine.
<?xml version="1.0" encoding="utf-8"?><SequentialWorkflowActivity x:Name="CustomWorkflow" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/workflow" x:Class="WorkflowDesignerControl.CustomWorkflow">  <DelayActivity TimeoutDuration="00:00:05" x:Name="Sleep" /></SequentialWorkflowActivity>
error 1564: x:calss cannot be used when the markup is executed directlywithout creating a new activity type.
 
I also saw some code that talked about serilizing and deserilizing the XOML...
 
Thanks.
Right - there are two kind of XAML.
 
Executable XAML - this is XAML where you can get back an Activity Tree from calling WorkflowRuntime.CreateWorkflow.
Compilable XAML - this XAML that can be compiled into a new Activity type (either in VS.NET, via the WFC tool or WorkflowCompiler class).
 
Executable XAML cannot have the Class attribute.  Compilable XAML *must* have the Class attribute.  Executable XAML cannot have any inline code, compilable XAML can.  There are of course other differences as well - but those are the main two.
Thank you for the clarification.
Here is the problem:
1. The designer creates a XOML with x:Class
2. We can strip this out and create a new XOML and get it to execute
3. But the Workflow monitor then complains because it uses the designer and the XOML stored at run time is missing the X:Class and this we do not have control over.
Thoughts?
Hi Soheil,
I am running into the same problem and was worndring if you got answers to your questions?
How did you solve the issue?
Thanks
Sonali

Related Links

is the "workflows in memory" performance counter failing to be reset?
Creating a workflow dynamically
writing non-persistance data to Oracle from a workflow app
Is Workflow Foundation a good fit for multiple workflow processes
The workflow failed validation
Can SQL compact edition be used for persistence and tracking storage?
Invoking multiple web service using InvokeWebServiceActivity combined with transaction
Workflow, HandleExternalEvent and WCF
XOML Only - How to change an integer in the argument dictionary
WorkflowTheme Exception
Pass in parameters to declarative workflow
WorkflowOutline
Workflow Correlation
How do I get the singleton instance of an "InstanceContextMode.Single" from wcf plumbing?
Correlation in a state machine workflow, where each state handles N distinct events?
Batch Point For Persistence and State Machine

Categories

MSDN
BizTalk Server
Internet Explorer Deve...
Windows Forms
Microsoft Research
Bing Maps
Microsoft Azure
Archived Forums X-Z
Kinect for Windows SDKs
Software Entwicklung f...
Cortana
Forums Issues (not pro...
Visual Studio Tools fo...
Visual Studio LightSwi...
Tools for Apache Cordova
Visual Studio Graphics...
Promote Your App
App & Ad Unit Management
Windows Desktop Optica...
Peer-to-Peer Networkin...
Windows Desktop Pro-Au...
SharePoint 2013 - Gene...
SharePoint 2013 - Search
SharePoint 2010 - Deve...
Azure Multi-Factor Aut...
Azure Pack
Azure App Service - We...
Microsoft Azure Site R...
Azure Automation
Azure IoT Hub
Azure Analysis Services
.NET Framework Class L...
Team Foundation Server...
Software Modeling Tools
BizTalk Server General
BizTalk Server Adapter...
TPL Dataflow
SyncFx - SyncToy-File ...
SyncFx - Microsoft Syn...
Windows Mobile Develop...
SQL Server Tools
SQL Server Security
SQL Server Notificatio...
SQL Server Data Tools
Standard 2009: Embedde...
Standard 2009: Misc
Standard 7: Embedded E...
SQL Server 2012 High A...
Live Connect (Archived)
Windows Live General: ...
CRM Development
MSDN, TechNet and Expr...
WebsitePanel - Develop...
Developing for the Mob...
Office XML, ODF, and B...
Project Customization ...
Silverlight 5
Performance Profiling ...
MVVM / ViewModel Patte...
Customer Care Framework
Windows Performance To...
Retired SharePoint Wor...
Retired SharePoint Acc...
ADO.NET Entity Framewo...
Building Windows Store...
Casablanca
Doloto
Feedback for Visual Ba...
Popfly Game Creator
Parallel Programming w...
Security for Azure
SQL Server 2014 Data Q...
Team Foundation Server...
Team Foundation Server...
TFS Deployment to Azure
Tools for Windows Stor...
Visual C++ 2008 (Pre-r...
Visual C++ MFC and ATL
Visual Studio 2008 (Pr...
Visual Studio Lab Mana...
Web Development in Vis...
XML in Windows (MSXML ...
Microsoft Partner Cent...
Windows Containers

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile