Skip to content

Commit

Permalink
Fix http script for c8 example to complete correct task, closes #105
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanzilske committed Oct 17, 2024
1 parent be81e84 commit 2bffbb7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion examples/java-c8/simple-process-demo.http
Original file line number Diff line number Diff line change
Expand Up @@ -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);
%}
Expand All @@ -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);
%}
Expand All @@ -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);
%}
Expand Down

0 comments on commit 2bffbb7

Please sign in to comment.