public ProtocolDocument getDeferredVersionedDocument(Protocol protocol) throws Exception {
    getDocumentService()
        .cancelDocument(
            protocol.getProtocolDocument(),
            "Protocol document cancelled - protocol has been deferred.");
    getProtocolOnlineReviewService()
        .cancelOnlineReviews(
            protocol.getProtocolSubmission(),
            "Protocol Review cancelled - protocol has been deferred.");

    ProtocolDocument newDocument = (ProtocolDocument) getVersionedDocument(protocol);
    setReferencesForProtocolCorrespondence(newDocument);

    ProtocolAction assignToAgendaProtocolAction =
        (ProtocolAction)
            getProtocolAssignToAgendaService()
                .getAssignedToAgendaProtocolAction((Protocol) newDocument.getProtocol());
    if (assignToAgendaProtocolAction != null) {
      newDocument.getProtocol().getProtocolActions().remove(assignToAgendaProtocolAction);
      getBusinessObjectService().delete(assignToAgendaProtocolAction);
    }
    newDocument.getProtocol().refreshReferenceObject("protocolStatus");
    getDocumentService().saveDocument(newDocument);

    return newDocument;
  }
Esempio n. 2
0
  @Test
  public void testProcessApproveCommitteeDecision() throws Exception {
    Protocol protocol = getProtocolAssignedToAgenda();

    CommitteeDecision committeeDecision =
        getMockCommitteeDecisionBean(CommitteeDecisionMotionType.APPROVE);
    service.processCommitteeDecision(protocol, committeeDecision);

    ProtocolAction lastAction = protocol.getLastProtocolAction();
    assertNotNull(lastAction);
    assertEquals(
        ProtocolActionType.RECORD_COMMITTEE_DECISION, lastAction.getProtocolActionTypeCode());
    ProtocolSubmission submission = protocol.getProtocolSubmission();
    assertNotNull(submission);
    assertEquals(
        CommitteeDecisionMotionType.APPROVE, submission.getCommitteeDecisionMotionTypeCode());
    assertEquals(YES_COUNT, submission.getYesVoteCount());
    assertEquals(NO_COUNT, submission.getNoVoteCount());
    assertEquals(ABSTAIN_COUNT, submission.getAbstainerCount());
    assertEquals(RECUSED_COUNT, submission.getRecusedCount());
    assertEquals(VOTING_COMMENTS, submission.getVotingComments());
  }
 private boolean isStatusValid(Protocol protocol) {
   String submissionStatusCode =
       protocol.getProtocolSubmission().getSubmissionStatus().getProtocolSubmissionStatusCode();
   return StringUtils.isNotBlank(submissionStatusCode)
       && (ProtocolSubmissionStatus.SUBMITTED_TO_COMMITTEE.equals(submissionStatusCode));
 }