public void TestHappyPath() { /* Creating the message and sending it to Camunda */ var message = new CorrelationMessage() { MessageName = "MessagePaymentRequested", BusinessKey = Guid.NewGuid().ToString() }; message.ProcessVariables .Set("paymentAmount", 10000) .Set("error", false) .Set("fail", false) .Set("resolvable", true); testHelper.CorrelateMessage(message); List <LockedExternalTask> chargeCreditTasks = testHelper.FetchAndLockTasks("charge-credit"); Assert.AreEqual(chargeCreditTasks.Count, 1); Dictionary <string, VariableValue> variables = new Dictionary <string, VariableValue>(); variables.Set("remainingAmount", 0); testHelper.RunExternalTasks(chargeCreditTasks, variables); List <LockedExternalTask> paymentFinishedTasks = testHelper.FetchAndLockTasks("payment-finished"); testHelper.RunExternalTasks(paymentFinishedTasks, null); List <ProcessInstanceInfo> runningInstances = testHelper.QueryProcessInstances(new ProcessInstanceQuery() { ProcessDefinitionKey = "PaymentProcess" }); Assert.AreEqual(runningInstances.Count, 0); }
public void CorrelateMessage(CorrelationMessage message) { CamundaClient.Messages.DeliverMessage(message).Wait(); }