Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Commit

Permalink
Merge pull request #76 from iowusu/bug/timeWaitUnfiltered
Browse files Browse the repository at this point in the history
changed the time base wait task to use filtered query
  • Loading branch information
aclavio authored Jun 23, 2020
2 parents 273a949 + 97259f8 commit bf85ab2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ protected StringHandle loadTokenizedResource(String name, Map<String, String> to
}

File file = new File(resource.getFile());
String content = Files.readString(file.toPath());
String content = new String(Files.readAllBytes(file.toPath()));

for (Map.Entry<String, String> token : tokens.entrySet()) {
content = content.replaceAll(token.getKey(), token.getValue());
Expand All @@ -126,7 +126,7 @@ protected StringHandle loadTokenizedResource(String name, Map<String, String> to
}

protected StringHandle replaceTokensInResource(FileHandle file, Map<String, String> tokens) throws IOException {
String content = Files.readString(file.get().toPath());
String content = new String(Files.readAllBytes(file.get().toPath()));

for (Map.Entry<String, String> token : tokens.entrySet()) {
content = content.replaceAll(token.getKey(), token.getValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,19 @@ jobDoc = xdmp.toJSON({
errors: {},
});

//"test excute job")
//"test excute job")
assertion = sc.executeStateByJobDoc(jobDoc, false);
assertions.push(test.assertEqual('waiting', assertion.flowStatus, 'waiting flowStatus'));
assertions.push(
test.assertTrue(assertion.hasOwnProperty('currentlyWaiting'), 'waiting currentlyWaiting')
test.assertEqual('waiting', assertion.flowStatus, 'waiting flowStatus'));
assertions.push(
test.assertTrue(assertion.hasOwnProperty('currentlyWaiting'))
);
assertions.push(
test.assertTrue(assertion.currentlyWaiting.hasOwnProperty("nextTaskTime"))
);
assertions.push(
test.assertTrue(assertion.provenance[0].waiting.hasOwnProperty("doneNextTaskTime"))
);

jobDoc = xdmp.toJSON({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -584,10 +584,14 @@ function transition(jobDoc, jobObj, stateName, state, flowObj, save = true) {
if (jobObj.flowStatus === FLOW_STATUS_WAITING) {
xdmp.trace(TRACE_EVENT, `transition wait: ${stateName}`);

let pro = JSON.parse(JSON.stringify(jobObj.currentlyWaiting));
pro['doneNextTaskTime'] = pro['nextTaskTime'];
delete pro['nextTaskTime'];

jobObj.provenance.push({
date: new Date().toISOString(),
state: stateName,
waiting: jobObj.currentlyWaiting,
waiting: pro,
});
} else if (!inTerminalState(jobObj, flowObj)) {
xdmp.trace(TRACE_EVENT, `transition from non-terminal state: ${stateName}`);
Expand Down

0 comments on commit bf85ab2

Please sign in to comment.