Skip to content

Commit

Permalink
Merge pull request #120 from OHDSI/ARACHNE-119
Browse files Browse the repository at this point in the history
The list of the Incomplete submission was defended incorrectly
  • Loading branch information
YaroslavTir authored Jan 10, 2025
2 parents e259918 + c91dca6 commit 18d5fb3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ public class Analysis {
@Convert(converter = StringMapConverter.class)
private Map<String, String> parameters;

public AnalysisState getState() {
return Optional.ofNullable(state).orElse(AnalysisState.UNKNOWN);
}

public String getStage() {
return Optional.ofNullable(currentState).map(AnalysisStateEntry::getStage).orElse(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ public List<Long> getIncompleteIds() {
Join<Analysis, AnalysisStateEntry> state = root.join(Analysis_.currentState, JoinType.LEFT);
javax.persistence.criteria.Path<String> stage = state.get(AnalysisStateEntry_.stage);
return q.where(
cb.isNull(root.get(Analysis_.error)),
cb.or(stage.isNull(), stage.in(Stage.EXECUTE, Stage.INITIALIZE, Stage.ABORT))
);
}).getResultStream().map(Analysis::getId).collect(Collectors.toList());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
UPDATE analysis_state_journal SET
stage = analyses.stage,
error = analyses.error
FROM analyses WHERE analyses.current_state_id = analyses.id;

0 comments on commit 18d5fb3

Please sign in to comment.