WorkflowQueuingService.GetWorkflowQueue(IComparable) 메서드

정의

지정된 WorkflowQueue를 검색합니다.

public:
 System::Workflow::Runtime::WorkflowQueue ^ GetWorkflowQueue(IComparable ^ queueName);
public System.Workflow.Runtime.WorkflowQueue GetWorkflowQueue (IComparable queueName);
member this.GetWorkflowQueue : IComparable -> System.Workflow.Runtime.WorkflowQueue
Public Function GetWorkflowQueue (queueName As IComparable) As WorkflowQueue

매개 변수

queueName
IComparable

검색할 WorkflowQueue의 이름입니다.

반환

WorkflowQueue 개체입니다.

예외

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

지정된 WorkflowQueue를 찾을 수 없는 경우

예제

다음 코드 예제에서는 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

적용 대상

추가 정보