-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DT-1678 Safer interface for posting party input to the orchestrator
- Loading branch information
Showing
14 changed files
with
37 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,7 +129,24 @@ public String getCounterpartRole() { | |
return counterpartConfiguration.getRole(); | ||
} | ||
|
||
protected void asyncOrchestratorPostPartyInput(JsonNode jsonPartyInput) { | ||
/** | ||
* To be invoked like this: | ||
* <pre> | ||
* {@code | ||
* asyncOrchestratorPostPartyInput( | ||
* actionPrompt.required("actionId").asText(), | ||
* OBJECT_MAPPER.createObjectNode() | ||
* .put("keyOne", valueOne) | ||
* .put("keyTwo", valueTwo)); | ||
* } | ||
* </pre> | ||
*/ | ||
protected void asyncOrchestratorPostPartyInput(String actionId, ObjectNode inputObjectNode) { | ||
if (actionId == null) throw new IllegalArgumentException("The actionId may not be null"); | ||
if (inputObjectNode == null) | ||
This comment has been minimized.
Sorry, something went wrong.
jkosternl
Collaborator
|
||
throw new IllegalArgumentException("The inputObjectNode may not be null"); | ||
ObjectNode jsonPartyInput = | ||
OBJECT_MAPPER.createObjectNode().put("actionId", actionId).set("input", inputObjectNode); | ||
if (partyConfiguration.isInManualMode()) { | ||
log.info( | ||
"Party {} NOT posting its input automatically (it is in manual mode): {}", | ||
|
@@ -198,7 +215,7 @@ protected void asyncCounterpartNotification(String actionId, String path, JsonNo | |
"Party {} notifying orchestrator that action {} is completed instead of sending notification: no counterpart URL is configured", | ||
actionId, | ||
partyConfiguration.getName()); | ||
asyncOrchestratorPostPartyInput(OBJECT_MAPPER.createObjectNode().put("actionId", actionId)); | ||
asyncOrchestratorPostPartyInput(actionId, OBJECT_MAPPER.createObjectNode()); | ||
} else { | ||
log.info( | ||
"Party {} NOT sending a notification and NOT notifying orchestrator either: no counterpart URL is configured", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ah yes, I just missed the fact that I added here a
null
input object, causing the issue in the SupplyParametersAction. This is a better solution indeed.