SqlWorkflowInstanceStore.InstanceCompletionAction 속성

정의

워크플로 인스턴스가 완료된 후 수행할 작업을 지정합니다. 가능한 값은 "DeleteNothing" 및 "DeleteAll"입니다. 기본값은 "DeleteAll"입니다. 속성이 "DeleteNothing"으로 설정된 경우에는 지속성 공급자는 워크플로 인스턴스가 완료된 후 지속성 데이터베이스에 모든 인스턴스 데이터 및 메타데이터를 유지합니다. 속성이 "DeleteAll"로 설정된 경우에는 워크플로 인스턴스가 완료된 후 지속성 공급자가 모든 인스턴스 데이터와 메타데이터를 삭제합니다.

public:
 property System::Activities::DurableInstancing::InstanceCompletionAction InstanceCompletionAction { System::Activities::DurableInstancing::InstanceCompletionAction get(); void set(System::Activities::DurableInstancing::InstanceCompletionAction value); };
public System.Activities.DurableInstancing.InstanceCompletionAction InstanceCompletionAction { get; set; }
member this.InstanceCompletionAction : System.Activities.DurableInstancing.InstanceCompletionAction with get, set
Public Property InstanceCompletionAction As InstanceCompletionAction

속성 값

워크플로 인스턴스가 완료된 후 수행할 작업입니다.

예제

다음 코드 샘플에서는 SqlWorkflowInstanceStore에 InstanceCompletionAction을 사용하는 방법을 보여 줍니다.

static void Main(string[] args)
{
    // Create service host.
    WorkflowServiceHost host = new WorkflowServiceHost(new CountingWorkflow(), new Uri(hostBaseAddress));

    // Add service endpoint.
    host.AddServiceEndpoint("ICountingWorkflow", new BasicHttpBinding(), "");

    // Define SqlWorkflowInstanceStoreBehavior:
    //   Set interval to renew instance lock to 5 seconds.
    //   Set interval to check for runnable instances to 2 seconds.
    //   Instance Store does not keep instances after it is completed.
    //   Select exponential back-off algorithm when retrying to load a locked instance.
    //   Instance state information is compressed using the GZip compressing algorithm.
    SqlWorkflowInstanceStoreBehavior instanceStoreBehavior = new SqlWorkflowInstanceStoreBehavior(connectionString);
    instanceStoreBehavior.HostLockRenewalPeriod = new TimeSpan(0, 0, 5);
    instanceStoreBehavior.RunnableInstancesDetectionPeriod = new TimeSpan(0, 0, 2);
    instanceStoreBehavior.InstanceCompletionAction = InstanceCompletionAction.DeleteAll;
    instanceStoreBehavior.InstanceLockedExceptionAction = InstanceLockedExceptionAction.AggressiveRetry;
    instanceStoreBehavior.InstanceEncodingOption = InstanceEncodingOption.GZip;
    host.Description.Behaviors.Add(instanceStoreBehavior);

    // Open service host.
    host.Open();

    // Create a client that sends a message to create an instance of the workflow.
    ICountingWorkflow client = ChannelFactory<ICountingWorkflow>.CreateChannel(new BasicHttpBinding(), new EndpointAddress(hostBaseAddress));
    client.start();

    Console.WriteLine("(Press [Enter] at any time to terminate host)");
    Console.ReadLine();
    host.Close();
}

설명

가능한 값은 "DeleteNothing" 및 "DeleteAll"입니다. 기본값은 "DeleteAll"입니다. 속성이 "DeleteNothing"으로 설정된 경우에는 지속성 공급자는 워크플로 인스턴스가 완료된 후 지속성 데이터베이스에 모든 인스턴스 데이터 및 메타데이터를 유지합니다. 속성이 "DeleteAll"로 설정된 경우에는 워크플로 인스턴스가 완료된 후 지속성 공급자가 모든 인스턴스 데이터와 메타데이터를 삭제합니다.

적용 대상