StateMachineWorkflowActivity.DynamicUpdateCondition 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
파생 클래스에서 재정의되는 경우 동적 업데이트를 워크플로에서 수행할 수 있는지 여부를 결정하는 ActivityCondition을 가져오거나 설정합니다.
public:
property System::Workflow::ComponentModel::ActivityCondition ^ DynamicUpdateCondition { System::Workflow::ComponentModel::ActivityCondition ^ get(); void set(System::Workflow::ComponentModel::ActivityCondition ^ value); };
public System.Workflow.ComponentModel.ActivityCondition DynamicUpdateCondition { get; set; }
member this.DynamicUpdateCondition : System.Workflow.ComponentModel.ActivityCondition with get, set
Public Property DynamicUpdateCondition As ActivityCondition
속성 값
동적 업데이트를 수행할 수 있는 시기를 식별하는 ActivityCondition입니다.
예제
다음 예제에서는 DynamicUpdateCondition
속성을 설정하는 방법을 보여 줍니다. 이 예제는 Ordering State Machine SDK 샘플에 포함되어 있습니다. 자세한 내용은 Ordering State Machine 샘플합니다.
internal List<SqlTrackingWorkflowInstance> GetWorkflows(string workflowEvent, DateTime from, DateTime until, TrackingDataItemValue trackingDataItemValue)
{
try
{
List<SqlTrackingWorkflowInstance> queriedWorkflows = new List<SqlTrackingWorkflowInstance>();
SqlTrackingQuery sqlTrackingQuery = new SqlTrackingQuery(connectionString);
SqlTrackingQueryOptions sqlTrackingQueryOptions = new SqlTrackingQueryOptions();
sqlTrackingQueryOptions.StatusMinDateTime = from.ToUniversalTime();
sqlTrackingQueryOptions.StatusMaxDateTime = until.ToUniversalTime();
// If QualifiedName, FieldName, or DataValue is not supplied, we will not query since they are all required to match
if (!((string.Empty == trackingDataItemValue.QualifiedName) || (string.Empty == trackingDataItemValue.FieldName) || ((string.Empty == trackingDataItemValue.DataValue))))
sqlTrackingQueryOptions.TrackingDataItems.Add(trackingDataItemValue);
queriedWorkflows.Clear();
if ("created" == workflowEvent.ToLower(CultureInfo.InvariantCulture))
{
sqlTrackingQueryOptions.WorkflowStatus = WorkflowStatus.Created;
queriedWorkflows.AddRange(sqlTrackingQuery.GetWorkflows(sqlTrackingQueryOptions));
}
else if ("completed" == workflowEvent.ToLower(CultureInfo.InvariantCulture))
{
sqlTrackingQueryOptions.WorkflowStatus = WorkflowStatus.Completed;
queriedWorkflows.AddRange(sqlTrackingQuery.GetWorkflows(sqlTrackingQueryOptions));
}
else if ("running" == workflowEvent.ToLower(CultureInfo.InvariantCulture))
{
sqlTrackingQueryOptions.WorkflowStatus = WorkflowStatus.Running;
queriedWorkflows.AddRange(sqlTrackingQuery.GetWorkflows(sqlTrackingQueryOptions));
}
else if ("suspended" == workflowEvent.ToLower(CultureInfo.InvariantCulture))
{
sqlTrackingQueryOptions.WorkflowStatus = WorkflowStatus.Suspended;
queriedWorkflows.AddRange(sqlTrackingQuery.GetWorkflows(sqlTrackingQueryOptions));
}
else if ("terminated" == workflowEvent.ToLower(CultureInfo.InvariantCulture))
{
sqlTrackingQueryOptions.WorkflowStatus = WorkflowStatus.Terminated;
queriedWorkflows.AddRange(sqlTrackingQuery.GetWorkflows(sqlTrackingQueryOptions));
}
else if (("all" == workflowEvent.ToLower(CultureInfo.InvariantCulture)) || string.IsNullOrEmpty(workflowEvent))
{
sqlTrackingQueryOptions.WorkflowStatus = WorkflowStatus.Created;
queriedWorkflows.AddRange(sqlTrackingQuery.GetWorkflows(sqlTrackingQueryOptions));
sqlTrackingQueryOptions.WorkflowStatus = WorkflowStatus.Completed;
queriedWorkflows.AddRange(sqlTrackingQuery.GetWorkflows(sqlTrackingQueryOptions));
sqlTrackingQueryOptions.WorkflowStatus = WorkflowStatus.Running;
queriedWorkflows.AddRange(sqlTrackingQuery.GetWorkflows(sqlTrackingQueryOptions));
sqlTrackingQueryOptions.WorkflowStatus = WorkflowStatus.Suspended;
queriedWorkflows.AddRange(sqlTrackingQuery.GetWorkflows(sqlTrackingQueryOptions));
sqlTrackingQueryOptions.WorkflowStatus = WorkflowStatus.Terminated;
queriedWorkflows.AddRange(sqlTrackingQuery.GetWorkflows(sqlTrackingQueryOptions));
}
return queriedWorkflows;
}
catch (Exception exception)
{
throw new Exception("Exception in GetWorkflows", exception);
}
}
Friend Function GetWorkflows( _
ByVal workflowEvent As String, _
ByVal from As System.DateTime, _
ByVal until As DateTime, _
ByVal trackingDataItemValue As TrackingDataItemValue) _
As List(Of SqlTrackingWorkflowInstance)
Try
Dim queriedWorkflows As List(Of SqlTrackingWorkflowInstance) = New List(Of SqlTrackingWorkflowInstance)()
Dim sqlTrackingQuery As SqlTrackingQuery = New SqlTrackingQuery(connectionString)
Dim sqlTrackingQueryOptions As SqlTrackingQueryOptions = New SqlTrackingQueryOptions()
sqlTrackingQueryOptions.StatusMinDateTime = from.ToUniversalTime()
sqlTrackingQueryOptions.StatusMaxDateTime = until.ToUniversalTime()
' If QualifiedName, FieldName, or DataValue is not supplied, we will not query since they are all required to match
If (Not ((trackingDataItemValue.QualifiedName = String.Empty) Or (trackingDataItemValue.FieldName = String.Empty) Or ((trackingDataItemValue.DataValue = String.Empty)))) Then
sqlTrackingQueryOptions.TrackingDataItems.Add(trackingDataItemValue)
End If
queriedWorkflows.Clear()
If (workflowEvent.ToLower(CultureInfo.InvariantCulture) = "created") Then
sqlTrackingQueryOptions.WorkflowStatus = System.Workflow.Runtime.WorkflowStatus.Created
queriedWorkflows.AddRange(sqlTrackingQuery.GetWorkflows(sqlTrackingQueryOptions))
ElseIf (workflowEvent.ToLower(CultureInfo.InvariantCulture) = "completed") Then
sqlTrackingQueryOptions.WorkflowStatus = System.Workflow.Runtime.WorkflowStatus.Completed
queriedWorkflows.AddRange(sqlTrackingQuery.GetWorkflows(sqlTrackingQueryOptions))
ElseIf (workflowEvent.ToLower(CultureInfo.InvariantCulture) = "running") Then
sqlTrackingQueryOptions.WorkflowStatus = System.Workflow.Runtime.WorkflowStatus.Running
queriedWorkflows.AddRange(sqlTrackingQuery.GetWorkflows(sqlTrackingQueryOptions))
ElseIf (workflowEvent.ToLower(CultureInfo.InvariantCulture) = "suspended") Then
sqlTrackingQueryOptions.WorkflowStatus = System.Workflow.Runtime.WorkflowStatus.Suspended
queriedWorkflows.AddRange(sqlTrackingQuery.GetWorkflows(sqlTrackingQueryOptions))
ElseIf (workflowEvent.ToLower(CultureInfo.InvariantCulture) = "terminated") Then
sqlTrackingQueryOptions.WorkflowStatus = System.Workflow.Runtime.WorkflowStatus.Terminated
queriedWorkflows.AddRange(sqlTrackingQuery.GetWorkflows(sqlTrackingQueryOptions))
ElseIf ((workflowEvent = Nothing) Or _
(workflowEvent.ToLower(CultureInfo.InvariantCulture) = "all") Or _
(workflowEvent = String.Empty)) Then
sqlTrackingQueryOptions.WorkflowStatus = System.Workflow.Runtime.WorkflowStatus.Created
queriedWorkflows.AddRange(sqlTrackingQuery.GetWorkflows(sqlTrackingQueryOptions))
sqlTrackingQueryOptions.WorkflowStatus = System.Workflow.Runtime.WorkflowStatus.Completed
queriedWorkflows.AddRange(sqlTrackingQuery.GetWorkflows(sqlTrackingQueryOptions))
sqlTrackingQueryOptions.WorkflowStatus = System.Workflow.Runtime.WorkflowStatus.Running
queriedWorkflows.AddRange(sqlTrackingQuery.GetWorkflows(sqlTrackingQueryOptions))
sqlTrackingQueryOptions.WorkflowStatus = System.Workflow.Runtime.WorkflowStatus.Suspended
queriedWorkflows.AddRange(sqlTrackingQuery.GetWorkflows(sqlTrackingQueryOptions))
sqlTrackingQueryOptions.WorkflowStatus = System.Workflow.Runtime.WorkflowStatus.Terminated
queriedWorkflows.AddRange(sqlTrackingQuery.GetWorkflows(sqlTrackingQueryOptions))
End If
Return queriedWorkflows
Catch exception As Exception
'Dim errorMessage As String = "Exception in GetWorkflows" + vbCrLf + "Database: " + databaseName + vbCrLf + "Server: " + serverName
Throw (New Exception("Exception in GetWorkflows", exception))
End Try
End Function