Package it.unito.di.logic.exception

Examples of it.unito.di.logic.exception.CommitmentOperationNotPerformable


    }
    if (cToCancel == null) throw new CommitmentNotFoundInInteractionStateException(c);
   
    // check lifecyclestatus of commitment
    if (c.getLifeCycleStatus() != LifeCycleState.CONDITIONAL && c.getLifeCycleStatus() != LifeCycleState.DETACHED) {
      throw new CommitmentOperationNotPerformable(c, ProtocolArtifact.CANCEL_COMMITMENT);
    }
   
   
    // UPDATE STRUCTURE BY LIFECYCLE
    logger.trace("Commitment to cancel found");
    logger.debug("Updating roles-commitments support datastructures");
   
    // UPDATE COMMITMENT LIFECYCLE STATUS
    logger.trace("Updating commitments by LifeCycleStatus "+c.getLifeCycleStatus());
    HashSet<Commitment> actualCommits = commitments.get(c.getLifeCycleStatus());
    if (actualCommits != null) {
      logger.trace("At least a commitment found with status "+c.getLifeCycleStatus()+".");
      if (actualCommits.contains(c)) {
        logger.trace("Commitment individuated");
        logger.debug("Actual commitments with status "+c.getLifeCycleStatus());
        logger.debug(printHashSet(actualCommits));
        actualCommits.remove(c);
        logger.debug("After removal: ");
        logger.debug(printHashSet(actualCommits));
       
        // now change commitment status
        switch (c.getLifeCycleStatus()) {
        case CONDITIONAL:
          c.setStatus(LifeCycleState.TERMINATED);
          break;         
        case DETACHED:
          c.setStatus(LifeCycleState.VIOLATED);
          break;
        default:
          throw new CommitmentOperationNotPerformable(c, ProtocolArtifact.CANCEL_COMMITMENT);
       
        }
        // UPDATE COMMITMENT LIST BY LIFECYCLE STATUS
        logger.trace("Updating commitments by LifeCycleStatus "+c.getLifeCycleStatus());
        actualCommits = commitments.get(c.getLifeCycleStatus());
View Full Code Here


    }
    if (cToCancel == null) throw new CommitmentNotFoundInInteractionStateException(c);
   
    // check lifecyclestatus of commitment
    if (c.getLifeCycleStatus() != LifeCycleState.CONDITIONAL && c.getLifeCycleStatus() != LifeCycleState.DETACHED) {
      throw new CommitmentOperationNotPerformable(c, ProtocolArtifact.CANCEL_COMMITMENT);
    }
   
   
    // UPDATE STRUCTURE BY LIFECYCLE
    logger.trace("Commitment to cancel found");
    logger.debug("Updating roles-commitments support datastructures");
   
    // UPDATE COMMITMENT LIFECYCLE STATUS
    logger.trace("Updating commitments by LifeCycleStatus "+c.getLifeCycleStatus());
    HashSet<Commitment> actualCommits = commitments.get(c.getLifeCycleStatus());
    if (actualCommits != null) {
      logger.trace("At least a commitment found with status "+c.getLifeCycleStatus()+".");
      if (actualCommits.contains(c)) {
        logger.trace("Commitment individuated");
        logger.debug("Actual commitments with status "+c.getLifeCycleStatus());
        logger.debug(printHashSet(actualCommits));
        actualCommits.remove(c);
        logger.debug("After removal: ");
        logger.debug(printHashSet(actualCommits));
       
        // now change commitment status
        switch (c.getLifeCycleStatus()) {
        case CONDITIONAL:
          c.setStatus(LifeCycleState.TERMINATED);
          break;         
        case DETACHED:
          c.setStatus(LifeCycleState.VIOLATED);
          break;
        default:
          throw new CommitmentOperationNotPerformable(c, ProtocolArtifact.CANCEL_COMMITMENT);
       
        }
        // UPDATE COMMITMENT LIST BY LIFECYCLE STATUS
        logger.trace("Updating commitments by LifeCycleStatus "+c.getLifeCycleStatus());
        actualCommits = commitments.get(c.getLifeCycleStatus());
View Full Code Here

TOP

Related Classes of it.unito.di.logic.exception.CommitmentOperationNotPerformable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.