Windows Workflow Foundation 3


invoke sub StateMachine workflow


Hi, All,
I'm hosting the State Machine workflow in ASP.NET that uses InvokeWorkflow activity for sub State Machine WF.  But  at the TargetWorkflow property of Parent WF,  I could not choose a subWorkflow for that property in the current project at Designer UI, it always is empty.  What am I missing?
BTW, if my stateMachineWF invokes Sub StateMachineWF, and this sub stateMachine WF will invoke another one. how many levels could it be?
for example, workflow 1, WF(1): A1-->A2-->A3-->A4-->A5                      WF(2): A2-->A3-->A4-->A5                      WF(3): A3-->A4-->A5                      WF(4):A4-->A5
So, it will be possible for              WF(1): A1-->WF(2)             WF(2): A2-->WF(3)             WF(3): A3-->WF(4)             WF(4): A4-->A5 // this one will be same as old one
I just simplify this mode for description( it is stateMachine, but here,it looks like sequential WF)
Is there a sample for article for me to reference for this? 
Best Regards,
Brain
With Beta 2.2 you need to have the invoked workflows in a different project from the invoking workflow.  This restriction has been removed in current builds.
You can add the assemblies to the TypeProvider there but don't have to.  They just need to be added to the type provider before the runtime needs to resolve them.  Anywhere you have access to the runtime you can get the type provider back, calling GetService, and add new assembly references.
I've actually never been able to get a state machine workflow to successfully spawn a sub-workflow. I tried it in the Feb CTP and got nothing but crashes and exceptions. I'm interested in seeing if there's a good recommendation here.What I ended up doing was just encapsulating the sub-workflow in a larger encapsulation state and mimicking the hierarchical composition of states pattern.
With Beta 2.2 you need to have the invoked workflows in a different project from the invoking workflow.  This restriction has been removed in current builds.
Tom,
Thanks, BTW,  based on your stateMachine WF sample on Asp.net, we need to add Workflow assemble at Application_Start(), for invoke sub workflow, do I need to add all the sub workflow assembleies at there?
like,
typeProvider.AddAssembly(typeof(ActivityLibrary1.Workflow1).Assembly);typeProvider.AddAssembly(typeof(ActivityLibrary2.Workflow2).Assembly);typeProvider.AddAssembly(typeof(ActivityLibrary3.Workflow3).Assembly);
Thanks
Brian 
void Application_Start(object sender, EventArgs e) {// Code that runs on application startuSystem.Workflow.Runtime.WorkflowRuntime workflowRuntime = new System.Workflow.Runtime.WorkflowRuntime("WorkflowRuntime");
Application["WorkflowRuntime"] = workflowRuntime;
System.Workflow.ComponentModel.Compiler.TypeProvider typeProvider = new System.Workflow.ComponentModel.Compiler.TypeProvider(workflowRuntime);
typeProvider.AddAssembly(typeof(ActivityLibrary1.Workflow1).Assembly);
workflowRuntime.AddService(typeProvider);workflowRuntime.StartRuntime();}
You can add the assemblies to the TypeProvider there but don't have to.  They just need to be added to the type provider before the runtime needs to resolve them.  Anywhere you have access to the runtime you can get the type provider back, calling GetService, and add new assembly references.

Related Links

Dynamic Update
The Executing event of all my SetStateActivity objects dont fire
Design guidance needed for WWF application
Custom pub/sub service for WF message correlation
Is there any event get fired when I changed the content in the workflow designer?
Subscription handler threw System.FormatException
How can I designate string[] field as returnValue for ReceiveActivity?
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

Categories

MSDN
Internet Explorer Deve...
Microsoft ISV Communit...
Bing
Microsoft Research
Samsung PC
Archived Forums X-Z
Internet of Things
Microsoft R
Suggestions and Feedba...
MSDN and TechNet Profi...
Visual C#
Visual Basic
Visual Studio Setup an...
Visual Studio Tools fo...
Visual Studio Unit Tes...
Visual Studio Tools fo...
Submitting and Publish...
App & Ad Unit Management
Store Engagement Frame...
Developing Windows Des...
Windows Desktop Develo...
Windows Desktop Optica...
Windows Imaging Compon...
SharePoint 2013 - Setu...
SharePoint 2010 - Setu...
Cloud Services (Web an...
Azure Multi-Factor Aut...
Azure BizTalk Services
Microsoft Azure Site R...
Azure Scheduler
Azure Stream Analytics
Azure App Service - AP...
Azure Security Center
Azure Disk Encryption
Azure Functions
Windows Communication ...
Team Foundation Server...
Team Foundation Server...
WCF Data Services
Debugger Canvas
Microsoft Translator H...
ISV Open Discussions
Small Basic
SyncFx - SyncToy-File ...
Microsoft Robotics - C...
Visual Studio Smart De...
SQL Server Documentation
SQL Server Notificatio...
SQL Server Samples and...
Microsoft StreamInsight
SQL Server Data Qualit...
SQL Server Data Tools
Standard 7: Misc
Windows Live ID: Devel...
CRM
CRM Deployment
CRM Development
MSDN, TechNet and Expr...
Windows Protocols
Silverlight 5
Reference Source Serve...
.NET StockTrader Sampl...
Architecture Events
General Troubleshootin...
HealthVault Data Types
JScript for the .NET F...
Moderator Posting Only...
Phoenix
Popfly Game Creator
NUI API and Programmin...
Search Server: Feature...
Search Server: Report ...
Search, Organize, and ...
Software Transactional...
SyncFx - Feedback [Rea...
SQL Server 2014 Master...
SQL Server 2014 In-Mem...
Team Foundation Server...
Team Foundation Server...
Team Foundation Server...
Tools for Windows Stor...
UI Design for Windows ...
Visual Basic 2008 (Pre...
Visual Basic IDE
Visual C# 2008 (Pre-re...
Visual C# Express Edition
Visual C++ 2008 (Pre-r...
Visual Studio Async CTP
Visual Studio Database...
Visual Studio Online "...
Web Gadget Development
Building Windows Store...
XML in Visual Studio 2...
Windows IoT
Windows Containers
Cortana Skills Kit

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile