WorkflowStatus Sabit listesi
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Dikkat
The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*
İş akışı örneğinin durumunu belirtir.
public enum class WorkflowStatus
public enum WorkflowStatus
[System.Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")]
public enum WorkflowStatus
type WorkflowStatus =
[<System.Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")>]
type WorkflowStatus =
Public Enum WorkflowStatus
- Devralma
- Öznitelikler
Alanlar
Completed | 1 | İş akışı örneği tamamlandı. |
Created | 4 | İş akışı örneği, aşırı yüklenmiş CreateWorkflow(Type) yöntemlerden birine yapılan bir çağrı tarafından oluşturulmuştur. |
Running | 0 | İş akışı örneği çalışıyor. |
Suspended | 2 | İş akışı örneği bir SuspendActivity etkinlik tarafından, çağrısıyla Suspend(String)veya iş akışı çalışma zamanı altyapısı tarafından askıya alındı. |
Terminated | 3 | İş akışı örneği bir TerminateActivity etkinlik, çağrısı Terminate(String)veya iş akışı çalışma zamanı altyapısı tarafından sonlandırıldı. |
Örnekler
Aşağıdaki kod örneği, özelliğini ayarlamak WorkflowStatus için değerleri nasıl kullanabileceğinizi WorkflowStatus gösterir. Her değer, öğesini SqlTrackingWorkflowInstance farklı bir şekilde kısıtlar.
Bu kod örneği, DatabaseService.cs dosyasındaki İş Akışı İzleyicisi SDK Örneği'nin bir parçasıdır. Daha fazla bilgi için bkz . İş Akışı İzleyicisi.
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
Açıklamalar
Not
Bu malzeme artık kullanılmayan türleri ve ad alanlarını açıklamaktadır. Daha fazla bilgi için bkz. Windows Workflow Foundation 4.5'te Kullanım Dışı Türler.