failure.setPerformative(ACLMessage.FAILURE);
send(failure);
try {
ArrayList<Commitment> arrComm = new ArrayList<Commitment>();
for (Commitment com : interactionState.retrieveCommitmentsByDebtorRoleId(participant)) {
if (com.getConsequent().equals(new CompositeExpression(LogicalOperatorType.OR, new Fact("done"), new Fact("failure")))) {
arrComm.add(com);
}
}
for (Commitment com :arrComm) {
if (com.getConsequent().equals(new CompositeExpression(LogicalOperatorType.OR, new Fact("done"), new Fact("failure")))) {
Commitment cToAdd = new Commitment(com.getDebtor(), com.getCreditor(), com.getAntecedent(), com.getConsequent(), LifeCycleState.DISCHARGED);
interactionState.removeCommitment(com);
logger.debug("Commitment da rimuovere: "+com);
createCommitment(cToAdd);
}
}
assertFact(new Fact("failure"));
logger.trace("OPERATION PERFORMED: FAILURE by "+participant);
} catch (MissingOperandException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (WrongOperandsNumberException e) {