Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Use the WorkFlowStatus instance instead of name() #293

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,4 @@ public enum WorkFlowStatus {

FAILED, IN_PROGRESS, COMPLETED, PENDING, REJECTED;

public boolean isFailed() {
return FAILED.name().equals(name());
}

public boolean isRejected() {
return REJECTED.name().equals(name());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ public WorkReport handlePostWorkFlowExecution() {
.collect(Collectors.toList());

for (WorkFlowExecution checkerExecution : checkerExecutions)
if (checkerExecution != null && checkerExecution.getStatus().isRejected()) {
if (checkerExecution != null && checkerExecution.getStatus() == WorkFlowStatus.FAILED) {
log.info("fail workflow: {} because it has declined checker(s)", workFlowDefinition.getName());
workFlowExecution.setStatus(WorkFlowStatus.FAILED);
report = new DefaultWorkReport(WorkStatus.FAILED, workContext);
break;
}
else if (checkerExecution == null || checkerExecution.getStatus().isFailed()) {
else if (checkerExecution == null || checkerExecution.getStatus() == WorkFlowStatus.FAILED) {
log.info("workflow: {} has a pending/running checker: {}", workFlowDefinition.getName(),
checkerExecution == null ? "checker is pending"
: checkerExecution.getWorkFlowDefinitionId().toString());
Expand Down