WorkflowQueuingService.Exists(IComparable) 메서드

정의

지정된 WorkflowQueue가 있는지 테스트합니다.

public:
 bool Exists(IComparable ^ queueName);
public bool Exists (IComparable queueName);
member this.Exists : IComparable -> bool
Public Function Exists (queueName As IComparable) As Boolean

매개 변수

queueName
IComparable

WorkflowQueue의 이름입니다.

반환

true가 있으면 WorkflowQueue이고, 그렇지 않으면 false입니다.

예외

queueName이 null 참조(Visual Basic의 경우 Nothing)인 경우

예제

다음 코드 예제에서는 CreateQueue 메서드를 호출하여 WorkflowQueuingService 개체를 초기화하는 ActivityExecutionContext.GetService라는 메서드를 보여 줍니다. 그런 다음 Exists 메서드를 사용하여 지정된 이름의 WorkflowQueue가 있는지 확인합니다. 없는 경우 코드에서 CreateWorkflowQueue 메서드를 호출하고, 있는 경우 코드에서 GetWorkflowQueue 메서드를 호출합니다.

이 코드 예제는 FileSystemEvent.cs 파일에 있는 File Watcher Activity SDK 샘플의 일부입니다. 자세한 내용은 파일 시스템 감시자 작업합니다.

private WorkflowQueue CreateQueue(ActivityExecutionContext context)
{
    Console.WriteLine("CreateQueue");
    WorkflowQueuingService qService = context.GetService<WorkflowQueuingService>();

    if (!qService.Exists(this.QueueName))
    {
        qService.CreateWorkflowQueue(this.QueueName, true);
    }

    return qService.GetWorkflowQueue(this.QueueName);
}
Private Function CreateQueue(ByVal context As ActivityExecutionContext) As WorkflowQueue
    Console.WriteLine("CreateQueue")
    Dim qService As WorkflowQueuingService = context.GetService(Of WorkflowQueuingService)()

    If Not qService.Exists(Me.queueName) Then
        qService.CreateWorkflowQueue(Me.queueName, True)
    End If

    Return qService.GetWorkflowQueue(Me.QueueName)
End Function

적용 대상

추가 정보