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를 반환합니다.

예제

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

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는 정기적으로 다시 시작되는 내부 작업을 실행하여 지속성 데이터베이스에 실행 가능한 인스턴스가 있는지 여부를 확인합니다. 인스턴스가 runnable일시 중단 된 상태나 완료 된 상태가 아니며 다음 조건을 충족 하는 경우:

  • 인스턴스가 잠금 해제되었으며 만료된 보류 중인 타이머가 있습니다.

  • 인스턴스를 잠금 해제 하 고 해당 상태가 Executing합니다.

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

SQL 워크플로 인스턴스 저장소는 데이터베이스에서 실행 가능한 인스턴스를 찾았으며 컴퓨터에서 실행 중인 인스턴스를 로드할 수 있는 워크플로 호스트도 찾은 경우 HasRunnableWorkflowEvent를 발생시킵니다.

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

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

적용 대상