Skip to content

Commit

Permalink
[Upd] Share input graph file path within generated link
Browse files Browse the repository at this point in the history
  • Loading branch information
blcham committed Nov 27, 2021
1 parent 93890c5 commit be9902c
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ public ExecutionContext execute() {
loadModuleFlags();
loadConfiguration();
loadModuleConstraints();
String inputModelFilePath = null;
if (AuditConfig.isEnabled() || isInDebugMode) {
LOG.debug("Saving module execution input to file {}.", saveModelToTemporaryFile(executionContext.getDefaultModel()));
inputModelFilePath = saveModelToTemporaryFile(executionContext.getDefaultModel());
LOG.debug("Saving module execution input to file {}.", inputModelFilePath);
}
if (ExecutionConfig.isCheckValidationConstrains()) {
checkInputConstraints();
Expand All @@ -80,7 +82,7 @@ public ExecutionContext execute() {
}

if (ExecutionConfig.getEnvironment().equals(Environment.development)) {
generateLinkToRerunExecution();
generateLinkToRerunExecution(inputModelFilePath);
}

return outputContext;
Expand All @@ -96,11 +98,12 @@ private String encodeValue(String value) {
return "";
}

private void generateLinkToRerunExecution() {
private void generateLinkToRerunExecution(String inputModelFilePath) {
final String FILE_PREFIX = "file://";
final String SPIPES_SERVICE_URL = "http://localhost:8080/s-pipes";

String inputModelFileUrl = FILE_PREFIX + saveModelToTemporaryFile(executionContext.getDefaultModel());
String inputModelFileUrl = FILE_PREFIX + Optional.ofNullable(inputModelFilePath)
.orElse(saveModelToTemporaryFile(executionContext.getDefaultModel()));
String inputBindingFileUrl = FILE_PREFIX + saveModelToTemporaryFile(executionContext.getVariablesBinding().getModel());
String configModelFileUrl = FILE_PREFIX + saveModelToTemporaryFile(this.resource.getModel());

Expand Down

0 comments on commit be9902c

Please sign in to comment.