From 2bffbb7e2e0f669d361c59a1b9b0f7342934ada7 Mon Sep 17 00:00:00 2001 From: Stefan Zilske Date: Thu, 17 Oct 2024 13:01:27 +0200 Subject: [PATCH] Fix http script for c8 example to complete correct task, closes #105 --- examples/java-c8/simple-process-demo.http | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/java-c8/simple-process-demo.http b/examples/java-c8/simple-process-demo.http index 6861016..b2afa82 100644 --- a/examples/java-c8/simple-process-demo.http +++ b/examples/java-c8/simple-process-demo.http @@ -28,6 +28,7 @@ POST http://localhost:18082/simple-service-tasks/start-process?value={{correlati ### Get user tasks < {% import {wait} from "wait"; + console.log("waiting 5 secs"); wait(5); %} @@ -46,7 +47,11 @@ Accept: application/json }) const tasks = response.body; - const taskId = jsonPath(tasks, "$[0].taskId"); + + const processInstanceId = client.global.get("instanceId") + const taskIds = jsonPath(tasks, "$[?(@.meta.processInstanceId == '" + processInstanceId + "')].taskId"); + const taskId = jsonPath(taskIds, "$[0]"); + console.log("Created user task: ", taskId); client.global.set("taskId", taskId); %} @@ -63,6 +68,7 @@ POST http://localhost:18082/simple-service-tasks/tasks/{{taskId}}/complete?value ### Correlate message < {% import {wait} from "wait"; + console.log("waiting 5 secs"); wait(5); %}