Skip to content

Commit

Permalink
server: fix metadata values after resume
Browse files Browse the repository at this point in the history
  • Loading branch information
brig committed May 14, 2024
1 parent 577b0ec commit 62d39c8
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -546,4 +546,17 @@ public void testRestart() throws Exception {
assertFalse(waitConditions.getIsWaiting());
assertNull(waitConditions.getWaits());
}

@Test
public void metaAfterSuspend() throws Exception {
Payload payload = new Payload()
.archive(resource("metaAfterSuspend"));

ConcordProcess proc = concord.processes().start(payload);
ProcessEntry pe = expectStatus(proc, ProcessEntry.StatusEnum.FAILED);

// ---
Object myMetaValue = pe.getMeta().get("myMetaVar");
assertEquals("myMetaVarValue", myMetaValue);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
configuration:
runtime: "concord-v2"
meta:
myMetaVar: "n/a"

flows:
default:
- set:
myMetaVar: "myMetaVarValue"

- task: concord
in:
action: start
payload: payload
sync: true
suspend: true
arguments:
name: "Concord"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
configuration:
runtime: "concord-v2"

flows:
default:
- throw: "BOOM"
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ public Payload process(Chain chain, Payload payload) {
// we'll use the arguments only from the request
workspaceCfg.remove(Constants.Request.ARGUMENTS_KEY);

// we do not needed meta from request
workspaceCfg.remove(Constants.Request.META);

// TODO automatically provided variables

// TODO overrides from policies
Expand Down

0 comments on commit 62d39c8

Please sign in to comment.