コード例 #1
0
 @Override
 public void suspend(
     ProtocolBase protocol,
     org.kuali.kra.protocol.actions.genericactions.ProtocolGenericActionBean actionBean)
     throws Exception {
   if (ProtocolActionType.REQUEST_FOR_SUSPENSION.equals(
       protocol.getLastProtocolAction().getProtocolActionType().getProtocolActionTypeCode())) {
     // if previous action is request to suspend then the new status is suspend by investigator
     performGenericAction(
         protocol, actionBean, ProtocolActionType.SUSPENDED, ProtocolStatus.SUSPENDED_BY_PI);
   } else {
     // else suspend by IRB
     performGenericAction(
         protocol, actionBean, ProtocolActionType.SUSPENDED, ProtocolStatus.SUSPENDED_BY_IRB);
   }
 }
  protected void buildAndAttachProtocolCorrespondence(
      ProtocolBase protocol, byte[] data, String correspTypeCode) {

    ProtocolCorrespondence protocolCorrespondence = getNewProtocolCorrespondenceHook();
    protocolCorrespondence.setProtocol(protocol);
    protocolCorrespondence.setProtocolId(protocol.getProtocolId());
    protocolCorrespondence.setProtocolNumber(protocol.getProtocolNumber());
    protocolCorrespondence.setSequenceNumber(protocol.getSequenceNumber());
    protocolCorrespondence.setProtoCorrespTypeCode(correspTypeCode);

    ProtocolActionBase lastAction = protocol.getLastProtocolAction();
    protocolCorrespondence.setProtocolAction(lastAction);
    protocolCorrespondence.setActionIdFk(lastAction.getProtocolActionId());
    protocolCorrespondence.setCorrespondence(data);
    protocolCorrespondence.setActionId(lastAction.getActionId());

    // What is Final flag used for? ANSWER: the final flag is used by the IRB admin to denote
    // correspondences
    // that are ready to be sent/published to the PI etc.
    protocolCorrespondence.setFinalFlag(false);
    protocolCorrespondence.setCreateUser(GlobalVariables.getUserSession().getPrincipalName());
    protocolCorrespondence.setCreateTimestamp(dateTimeService.getCurrentTimestamp());

    if (lastAction.getProtocolCorrespondences() == null) {
      List<ProtocolCorrespondence> correspondences = new ArrayList<ProtocolCorrespondence>();
      correspondences.add(protocolCorrespondence);
      lastAction.setProtocolCorrespondences(correspondences);
      protocol.refreshReferenceObject("protocolSubmissions");
    } else {
      lastAction.getProtocolCorrespondences().add(protocolCorrespondence);
    }

    getBusinessObjectService().save(protocolCorrespondence);

    getBusinessObjectService().save(protocol);
  }