SqlWorkflowInstanceStore.RunnableInstancesDetectionPeriod 속성

정의

SQL 워크플로 인스턴스 저장소가 검색 작업을 실행하여 이전 검색 주기 이후 지속성 데이터베이스에서 실행 가능하거나 활성화 가능한 워크플로 인스턴스를 검색하는 기간을 지정합니다.

public:
 property TimeSpan RunnableInstancesDetectionPeriod { TimeSpan get(); void set(TimeSpan value); };
public TimeSpan RunnableInstancesDetectionPeriod { get; set; }
member this.RunnableInstancesDetectionPeriod : TimeSpan with get, set
Public Property RunnableInstancesDetectionPeriod As TimeSpan

속성 값

TimeSpan을(를) 반환합니다.

예제

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

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();
}

설명

SqlWorkflowInstanceStore 주기적으로 절전 모드를 해제하고 지속성 데이터베이스에 실행 가능한 인스턴스가 있는지 확인하는 내부 작업을 실행합니다. 인스턴스가 일시 중단된 상태 또는 완료된 상태가 아니고 다음 조건을 충족하는 경우 인스턴스를 실행할 수 있습니다.

  • 인스턴스가 잠금 해제되었고 보류 중이던 타이머가 만료되었습니다.

  • 인스턴스가 잠금 해제되고 해당 상태가 실행되고 있습니다.

  • 인스턴스에 만료된 잠금이 있습니다.

SQL 워크플로 인스턴스 저장소는 데이터베이스에서 실행 가능한 인스턴스를 찾을 때 발생 HasRunnableWorkflowEvent 하며 컴퓨터에서 실행 중인 인스턴스를 로드할 수 있는 워크플로 호스트도 찾습니다.

워크플로 호스트가 이 이벤트를 받으면 인스턴스 저장소에 대해 실행 TryLoadRunnableWorkflowCommand 하여 인스턴스를 메모리에 로드합니다.

속성의 형식은 TimeSpan이고 값은 "hh:mm:ss" 형식입니다. 최소값은 "00:00:01"(1초)입니다. 생략하면 기본값은 "00:00:05"(5초)입니다. 이 매개 변수는 선택적 매개 변수입니다.

적용 대상