Search in sources :

Example 6 with SubmissionAction

use of com.odysseusinc.arachne.portal.service.impl.submission.SubmissionAction in project ArachneCentralAPI by OHDSI.

the class BaseSubmissionServiceImpl method getPublishAction.

protected SubmissionAction getPublishAction(Submission submission) {
    SubmissionAction publishAction = new SubmissionAction(PUBLISH.name());
    publishAction.setAvailable(Arrays.asList(EXECUTED, FAILED, IN_PROGRESS).contains(submission.getStatus()));
    switch(submission.getStatus()) {
        case EXECUTED_PUBLISHED:
        case FAILED_PUBLISHED:
            publishAction.setResult(true);
            break;
        case EXECUTED_REJECTED:
        case FAILED_REJECTED:
            publishAction.setResult(false);
            break;
        default:
            publishAction.setResult(null);
            break;
    }
    return publishAction;
}
Also used : SubmissionAction(com.odysseusinc.arachne.portal.service.impl.submission.SubmissionAction)

Aggregations

SubmissionAction (com.odysseusinc.arachne.portal.service.impl.submission.SubmissionAction)6 SubmissionStatus (com.odysseusinc.arachne.portal.model.SubmissionStatus)1 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)1