fix(workflow): read task query variables from 'variables', not 'processVariables' (refs #13)
All checks were successful
CI / lint (pull_request) Successful in 1m28s
CI / build (pull_request) Successful in 1m8s
CI / unit (pull_request) Successful in 1m34s
CI / frontend (pull_request) Successful in 2m24s
CI / mutation (pull_request) Successful in 6m3s
CI / verify-stack (pull_request) Successful in 7m43s

Flowable's POST query/tasks returns the included process variables under the key
'variables' (the request opts in via includeProcessVariables). The client DTO, its
unit test, and the live-check parser all looked for 'processVariables', so the
werkbak never matched a task's registrationId and verify-domain timed out. Verified
by driving a real Flowable instance end-to-end locally: start -> complete external
job -> the Beoordelen task carries registrationId under 'variables'.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-15 10:29:43 +02:00
parent c53354cd22
commit 94a506cbfc
3 changed files with 8 additions and 5 deletions

View File

@@ -87,8 +87,9 @@ try:
except Exception: except Exception:
d={} d={}
rid=os.environ['REG_ID'] rid=os.environ['REG_ID']
# Flowable's task-query returns the included process variables under 'variables'.
print(next((t['id'] for t in (d.get('data') or []) print(next((t['id'] for t in (d.get('data') or [])
if any(v.get('name')=='registrationId' and v.get('value')==rid for v in (t.get('processVariables') or []))), ''))"; } if any(v.get('name')=='registrationId' and v.get('value')==rid for v in (t.get('variables') or []))), ''))"; }
flcurl() { docker run --rm --network "$net" curlimages/curl:latest -fsS -u rest-admin:test "$@"; } flcurl() { docker run --rm --network "$net" curlimages/curl:latest -fsS -u rest-admin:test "$@"; }
query='{"processDefinitionKey":"registratie","taskDefinitionKey":"Beoordelen","includeProcessVariables":true}' query='{"processDefinitionKey":"registratie","taskDefinitionKey":"Beoordelen","includeProcessVariables":true}'

View File

@@ -137,11 +137,13 @@ public sealed class FlowableWorkflowClient(HttpClient http, FlowableOptions opti
private sealed record UserTaskDto( private sealed record UserTaskDto(
[property: JsonPropertyName("id")] string Id, [property: JsonPropertyName("id")] string Id,
[property: JsonPropertyName("processVariables")] IReadOnlyList<Variable>? ProcessVariables) // Flowable's task-query returns the (included) process variables under "variables", not
// "processVariables"; the request opts in via includeProcessVariables.
[property: JsonPropertyName("variables")] IReadOnlyList<Variable>? Variables)
{ {
/// <summary>The registration id this task carries as a process variable.</summary> /// <summary>The registration id this task carries as a process variable.</summary>
public string RegistrationId() => public string RegistrationId() =>
ProcessVariables?.SingleOrDefault(v => v.Name == "registrationId")?.Value Variables?.SingleOrDefault(v => v.Name == "registrationId")?.Value
?? throw new InvalidOperationException($"Beoordelen task {Id} carries no registrationId variable."); ?? throw new InvalidOperationException($"Beoordelen task {Id} carries no registrationId variable.");
} }

View File

@@ -158,7 +158,7 @@ public class FlowableWorkflowClientTests
var capture = new RequestCapture(); var capture = new RequestCapture();
var client = Client(capture.Responds(HttpStatusCode.OK, var client = Client(capture.Responds(HttpStatusCode.OK,
$$""" $$"""
{"data":[{"id":"task-1","processVariables":[{"name":"registrationId","type":"string","value":"{{rid}}"}]}],"total":1} {"data":[{"id":"task-1","variables":[{"name":"registrationId","type":"string","value":"{{rid}}"}]}],"total":1}
""")); """));
var tasks = await client.GetOpenBeoordelingenAsync(); var tasks = await client.GetOpenBeoordelingenAsync();
@@ -192,7 +192,7 @@ public class FlowableWorkflowClientTests
{ {
var capture = new RequestCapture(); var capture = new RequestCapture();
var client = Client(capture.Responds(HttpStatusCode.OK, var client = Client(capture.Responds(HttpStatusCode.OK,
"""{"data":[{"id":"task-1","processVariables":[]}],"total":1}""")); """{"data":[{"id":"task-1","variables":[]}],"total":1}"""));
var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => client.GetOpenBeoordelingenAsync()); var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => client.GetOpenBeoordelingenAsync());
Assert.Contains("task-1", ex.Message); Assert.Contains("task-1", ex.Message);