public CreateWorkflowInstanceCommandWithResult(Gateway.GatewayClient client, CreateWorkflowInstanceRequest createRequest)
 {
     this.client             = client;
     createWithResultRequest = new CreateWorkflowInstanceWithResultRequest {
         Request = createRequest
     };
 }
예제 #2
0
        public async Task ShouldSendRequestWithWorkflowKeyAsExpected()
        {
            // given
            var expectedRequest = new CreateWorkflowInstanceRequest
            {
                WorkflowKey = 1
            };

            // when
            await ZeebeClient.NewCreateWorkflowInstanceCommand()
            .WorkflowKey(1)
            .Send();

            // then
            var request = TestService.Requests[typeof(CreateWorkflowInstanceRequest)][0];

            Assert.AreEqual(expectedRequest, request);
        }
예제 #3
0
        public async Task ShouldSendRequestWithVersionAsExpected()
        {
            // given
            var expectedRequest = new CreateWorkflowInstanceRequest
            {
                BpmnProcessId = "process",
                Version       = 1
            };

            // when
            await ZeebeClient.NewCreateWorkflowInstanceCommand()
            .BpmnProcessId("process")
            .Version(1)
            .Send();

            // then
            var request = TestService.Requests[typeof(CreateWorkflowInstanceRequest)][0];

            Assert.AreEqual(expectedRequest, request);
        }
예제 #4
0
        public async Task shouldSendRequestWithVariablesAsExpected()
        {
            // given
            var expectedRequest = new CreateWorkflowInstanceRequest
            {
                WorkflowKey = 1,
                Variables   = "{\"foo\":1}"
            };

            // when
            await ZeebeClient.NewCreateWorkflowInstanceCommand()
            .WorkflowKey(1)
            .Variables("{\"foo\":1}")
            .Send();

            // then
            var request = TestService.Requests[0];

            Assert.AreEqual(expectedRequest, request);
        }
예제 #5
0
        public async Task ShouldSendRequestWithVariablesAndProcessIdAsExpected()
        {
            // given
            var expectedRequest = new CreateWorkflowInstanceRequest
            {
                BpmnProcessId = "process",
                Version       = -1,
                Variables     = "{\"foo\":1}"
            };

            // when
            await ZeebeClient.NewCreateWorkflowInstanceCommand()
            .BpmnProcessId("process")
            .LatestVersion()
            .Variables("{\"foo\":1}")
            .Send();

            // then
            var request = TestService.Requests[typeof(CreateWorkflowInstanceRequest)][0];

            Assert.AreEqual(expectedRequest, request);
        }
예제 #6
0
 public override Task <CreateWorkflowInstanceResponse> CreateWorkflowInstance(CreateWorkflowInstanceRequest request, ServerCallContext context)
 {
     return(Task.FromResult((CreateWorkflowInstanceResponse)HandleRequest(request, context)));
 }
 public CreateWorkflowInstanceCommand(Gateway.GatewayClient client)
 {
     this.client = client;
     request     = new CreateWorkflowInstanceRequest();
 }
 public override AsyncUnaryCall <CreateWorkflowInstanceResponse> CreateWorkflowInstanceAsync(CreateWorkflowInstanceRequest request, CallOptions options)
 {
     throw new ObjectDisposedException(ZeebeClientWasAlreadyDisposed);
 }
 public override AsyncUnaryCall <CreateWorkflowInstanceResponse> CreateWorkflowInstanceAsync(CreateWorkflowInstanceRequest request, Metadata headers = null,
                                                                                             DateTime?deadline = null, CancellationToken cancellationToken = default(CancellationToken))
 {
     throw new ObjectDisposedException(ZeebeClientWasAlreadyDisposed);
 }