WorkflowQueuingService.CreateWorkflowQueue(IComparable, Boolean) 메서드

정의

지정된 이름과 트랜잭션 범위를 사용하여 WorkflowQueue를 만듭니다.

public:
 System::Workflow::Runtime::WorkflowQueue ^ CreateWorkflowQueue(IComparable ^ queueName, bool transactional);
public System.Workflow.Runtime.WorkflowQueue CreateWorkflowQueue (IComparable queueName, bool transactional);
member this.CreateWorkflowQueue : IComparable * bool -> System.Workflow.Runtime.WorkflowQueue
Public Function CreateWorkflowQueue (queueName As IComparable, transactional As Boolean) As WorkflowQueue

매개 변수

queueName
IComparable

큐의 이름입니다.

transactional
Boolean

WorkflowQueue가 현재 트랜잭션의 범위 외부에 표시되는지 여부를 지정하는 값입니다.

반환

WorkflowQueue 개체입니다.

예외

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

지정된 이름을 가진 WorkflowQueuequeueName에 이미 있는 경우

예제

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

설명

지정된 WorkflowQueue을 가진 queueName가 만들어집니다. 트랜잭션이 true이면 WorkflowQueue가 현재 트랜잭션 내부에만 표시됩니다.

적용 대상

추가 정보