WorkflowRuntime.IsStarted 屬性


取得指出工作流程執行階段引擎是否已啟動的值。Gets a value that indicates whether the workflow run-time engine has been started.

 property bool IsStarted { bool get(); };
public bool IsStarted { get; }
member this.IsStarted : bool
Public ReadOnly Property IsStarted As Boolean


如果工作流程執行階段引擎已啟動則為 true,否則為 falsetrue if the workflow run-time engine has been started; otherwise, false. 預設為 falseThe default is false.


下列範例示範如何存取 IsStarted 物件的 WorkflowRuntime 屬性。The following example demonstrates how to access the IsStarted property of a WorkflowRuntime object. 在這個範例中,如果執行階段已啟動,則訊息會列印到主控台中。In this example, if the runtime is started, a message is printed to the console.

// Create a new workflow runtime
WorkflowRuntime workflowRuntime = new WorkflowRuntime();
// Start the runtime
// If the runtime is started, report to the console.
if (workflowRuntime.IsStarted)
    Console.WriteLine("Runtime is started.");
' Create a new workflow runtime
Dim workflowRuntime As New WorkflowRuntime()
' Start the runtime
' If the runtime is started, report to the console.
If workflowRuntime.IsStarted Then
    Console.WriteLine("Runtime is started.")
End If


IsStarted 表示工作流程執行階段引擎服務正在執行中。IsStarted indicates that the workflow run-time engine services are running. IsStartedfalse ,直到主機呼叫StartRuntime為止。IsStarted is false until the host calls StartRuntime. 在主機呼叫 true 之前,它都會保持為 StopRuntimeIt remains true until the host calls StopRuntime.


工作流程執行階段引擎正在執行時,無法將核心服務加入到引擎中。You cannot add core services to the workflow run-time engine while it is running. 核心服務是衍生自 WorkflowSchedulerService 類別、DefaultWorkflowCommitWorkBatchService 類別、WorkflowPersistenceService 類別和 TrackingService 類別的服務。Core services are services that derive from the WorkflowSchedulerService class, the DefaultWorkflowCommitWorkBatchService class, the WorkflowPersistenceService class, and the TrackingService class.