.
The SetState activity transitions a state machine to a new state. In figure 16, we are handling the BugAssigned event. When a bug is assigned, we want to transition to the AssignedState, so we set the TargetStateName property to AssignedState. The AssignedState activity will then have it's own set of Event Driven activities, each with SetState activities to transition to other states (and hopefully one day reach the ClosedState).
Force a StateWorkflow into a specific state.
23-11-2009 15:28:23 - -80.126.16.139
Click to read this topic23-11-2009 15:16:54 - dssweow-167.206.55.215
Click to read this topic23-11-2009 15:16:35 - -80.126.16.139
Click to read this topic23-11-2009 15:30:25 - xiqclvfz-86.161.231.146
Click to read this topic23-11-2009 15:16:35 - -80.126.16.139
Click to read this topic23-11-2009 15:16:35 - -80.126.16.139
Force a StateWorkflow into a specific state.
23-11-2009 15:28:23 - -80.126.16.139
.
Use the TargetStateName just as in the standard SetStateActivity to indicate the target state.
Click to read this topic23-11-2009 15:30:25 - xiqclvfz-86.161.231.146
Provides the transition to a State Activity in a state machine workflow.
23-11-2009 15:28:25 - -80.126.16.139
.
Public Shared TargetStateNameProperty As DependencyProperty = DependencyProperty.Register("TargetStateName", GetType(String), GetType(DynamicSetStateActivity))
.
Public Property TargetStateName() As String
.
Return (CType((MyBase.GetValue(DynamicSetStateActivity.TargetStateNameProperty)), String))
.
MyBase.SetValue(DynamicSetStateActivity.TargetStateNameProperty, Value)
.
Dim e As New SetStateEventArgs(TargetStateName)
.
The SetState activity transitions a state machine to a new state. In figure 16, we are handling the BugAssigned event. When a bug is assigned, we want to transition to the AssignedState, so we set the TargetStateName property to AssignedState. The AssignedState activity will then have it's own set of Event Driven activities, each with SetState activities to transition to other states (and hopefully one day reach the ClosedState).
Force a StateWorkflow into a specific state.
23-11-2009 15:28:23 - -80.126.16.139
Click to read this topic23-11-2009 15:16:54 - dssweow-167.206.55.215
Click to read this topic23-11-2009 15:16:35 - -80.126.16.139
Click to read this topic23-11-2009 15:30:25 - xiqclvfz-86.161.231.146
Click to read this topic23-11-2009 15:16:35 - -80.126.16.139
Click to read this topic23-11-2009 15:16:35 - -80.126.16.139
Force a StateWorkflow into a specific state.
23-11-2009 15:28:23 - -80.126.16.139
.
The TargetStateName property of a SetStateActivity cannot be changed at runtime. Use the DynamicSetStateActivity if that kind of behavior is needed.
Click to read this topic23-11-2009 15:30:25 - xiqclvfz-86.161.231.146
Provides the transition to a State Activity in a state machine workflow.
23-11-2009 15:28:25 - -80.126.16.139
Allows setting the target state name at runtime.
23-11-2009 15:21:41 - MauriceDeBeijer-80.126.16.139
.
And the second cool behavior is that you can actually execute multiple SetStateActivity objects with different TargetStateName definitions and only the last one will be executed. Again something that might make the logic quite a bit simple as you can set a default TargetStateName at the beginning of your and make changes to the target as exceptional cases arise.
Provides the transition to a State Activity in a state machine workflow.
23-11-2009 15:28:25 - -80.126.16.139
Click to read this topic23-11-2009 15:30:25 - xiqclvfz-86.161.231.146
Click to read this topic23-11-2009 15:30:25 - xiqclvfz-86.161.231.146
.
Both of these behaviors are especially important as the TargetStateName is a meta property, meaning it cannot be changed at runtime but only at design time. So the option of dynamically changing the SetStateActivity doesn't really exist.
Click to read this topic23-11-2009 15:30:25 - xiqclvfz-86.161.231.146
Provides the transition to a State Activity in a state machine workflow.
23-11-2009 15:28:25 - -80.126.16.139