index > Windows Workflow Foundation > SetStateActivity - set TargetStateName during Execution of Statem...

SetStateActivity - set TargetStateName during Execution of Statem...

Hi all,

I have a statemachine. In several states I can get into a "special" state. From the "special"state I have to go back to the state I came from.
Now there is the Statemachine property PreviousStateName available.
I wanted to set the Dependencyproperty "TargetStatename" of the SetStateActivity to that PreviousStateName by a codeactivity.
But setting the targetstatename of the setStateActivity is only allowed during DesignTime...

Now I tried to reflector the SetStateActivity(in order to create my own SetState) but its quite a deal of effort since its got a helper procedure tail in several workflow helperclasses which are internal.

Are there already any activities around which fullfill the requirements above?
Any hints, ideas?

thanks

David
Urpcor

You might try sending the SetStateEventArgs to the SetStateQueue like the StateMachineWorkflowInstance does.

SetStateEventArgs args1 = new SetStateEventArgs(targetStateName);

//get workflow queing service and get the SetStateQueue.

q.Enqueue(args1);

Matt




See What You Can Learn -- http://www.pluralsight.com/courses/IntroducingWF.aspx
Matt Milner - Pluralsight
reply 2

You can use google to search for other answers

 

More Articles

• Problem with a Custom WF in a Designer Re-Hosted scenario.
• Project type is not supported by this installation
• BPEL conversion
• Workflow terminated by runtime - error details
• workflows memory consumption
• Debugging in the designer when triggering workflow from another l...
• ToolboxBitmap
• Using InvokeWorkFlow Activity
• Windows Workflow Foundation Guide
• break out of a parrallel Activity.
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• Custom State Activity with Custom Designer
• Beta 2 HOL code snippets broken ?
• About WorkflowCompiler
• WF and the MSDN Product Feedback Center
• asp.net error continues in the RC versio
• Parallel Webservice Invocation
• Stack Overflow in the rule designer
• Where is the documentation
• Problem exposing webservice after renami
• Limit Values of Dependency Properties
• Web services and runtime compilation
• How to create .rules file
• workflow designer - properties
• Edit lock in the designer?
• importing activities into sharepoint des

Hot Articles

• Microsoft Sharepoint Workflow(7 Files).zip
• Cannot create more than one WorkflowRunt
• Rulesets that define/build ASP.NET GUI
• tracking when exception occurs
• Tracking Service
• Activity.DesignMode true when initializi
• Is WF 2.2 Beta compatible with WinFX Feb
• Where's the beef? (actually, the runtime
• WWF Scenario using ASP.NET
• Designer fails: could not load type Runt
• Article State Machine Workflows in Windo
• Workflow Designer not accessible
• how to customize icons shown in the desi
• Visual Studio 2005 Crashes upon Compilat
• Normative Schema for WF XAML?

Recommend Articles

• Can not use StateMachineWorkflowInstance
• Hiding workflow tabs (Exceptions, events
• Activity.DesignMode true when initializi
• Creating Publising Site
• How can an activity close itself?
• WorkFlow designer is availability
• Windows Workflow Foundation January CTP
• Expense Reporting Instructions & Con
• considerations when designing a new cust
• Spawn new workflows from within a workflow
• Rehosting WWF and a simply expression
• ToolboxService class and Workflow Design
• Exernal rule set tool kit
• Using the Rules Engine with complex data
• Lack of "go to" functionality