public CreateWorkflowInstanceCommandWithResult(Gateway.GatewayClient client, CreateWorkflowInstanceRequest createRequest)
 {
     this.client             = client;
     createWithResultRequest = new CreateWorkflowInstanceWithResultRequest {
         Request = createRequest
     };
 }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
 }