WorkflowInstance.Load 메서드

정의

이전에 언로드된 워크플로 인스턴스를 로드합니다.

public:
 void Load();
public void Load ();
member this.Load : unit -> unit
Public Sub Load ()

예외

워크플로 런타임 엔진이 실행되고 있지 않은 경우

예제

다음 예제에서는 이전에 언로드된 WorkflowInstance 개체를 로드하는 방법을 보여 줍니다.

// Create a WorkflowRuntime object
WorkflowRuntime workflowRuntime = new WorkflowRuntime();
// Create a new instance of the out-of-box SqlWorkflowPersistenceService
SqlWorkflowPersistenceService persistenceService =
   new SqlWorkflowPersistenceService(
   "Initial Catalog=SqlPersistenceService;Data Source=localhost;Integrated Security=SSPI;");
// Add the service to the runtime
workflowRuntime.AddService(persistenceService);
// Create a WorkflowInstance object
WorkflowInstance workflowInstance = workflowRuntime.CreateWorkflow(typeof(Workflow1));
// Start the workflow instance
workflowInstance.Start();
//Unload the instance
workflowInstance.Unload();
//Reload the previously unloaded instance
workflowInstance.Load();
' Create a WorkflowRuntime object
Dim workflowRuntime As New WorkflowRuntime()
' Create a new instance of the out-of-box SqlWorkflowPersistenceService
Dim persistenceService As _
   New SqlWorkflowPersistenceService( _
   "Initial Catalog=SqlPersistenceServiceData Source=localhostIntegrated Security=SSPI")
' Add the service to the runtime
workflowRuntime.AddService(persistenceService)
' Create a WorkflowInstance object
Dim workflowInstance As WorkflowInstance = workflowRuntime.CreateWorkflow(GetType(Workflow1))
' Start the workflow instance
workflowInstance.Start()
'Unload the instance
workflowInstance.Unload()
'Reload the previously unloaded instance
workflowInstance.Load()

설명

Load는 동기적입니다. 워크플로 인스턴스를 로드할 수 있는 경우 워크플로 런타임 엔진이 워크플로 인스턴스를 메모리에 로드하고 예약한 후 Load가 반환됩니다. 지속성 서비스가 메모리의 워크플로 인스턴스를 복원한 후, 워크플로 런타임 엔진이 인스턴스를 예약하기 전에 런타임에서 WorkflowLoaded 이벤트를 발생시킵니다.

적용 대상