proposal.setRoleReceiver(initiator);
proposal.setPerformative(ACLMessage.PROPOSE);
send(proposal);
try {
assertFact(new Fact("propose", participant, prop));
createCommitment(new Commitment(participant, initiator, new Fact("accept"), new CompositeExpression(
LogicalOperatorType.OR, new Fact("done"), new Fact("failure"))));
//**** DEBUG: CAMBIO STATO DI VITA A COMMITMENT GIUSTO, SARA' IL SOCIAL STATE CHE DOVRA' GESTIRLO
for (Commitment com : interactionState.retrieveCommitmentsByCreditorRoleId(participant)) {
if (com.getAntecedent().equals(new Fact("propose")) && com.getLifeCycleStatus().equals(LifeCycleState.CONDITIONAL)) {
Commitment cToAdd = new Commitment(com.getDebtor(), com.getCreditor(), new Fact("true"), com.getConsequent(), LifeCycleState.DETACHED);
interactionState.removeCommitment(com);
logger.debug("Commitment da rimuovere: "+com);
createCommitment(cToAdd);
actualProposals++;
}
}
if (actualProposals == numberMaxProposals) {
acceptingProposals = false;
RoleId groupParticipant = new RoleId(PARTICIPANT_ROLE, RoleId.GROUP_ROLE);
createCommitment(new Commitment(initiator, groupParticipant, new CompositeExpression(
LogicalOperatorType.OR, new Fact("accept"), new Fact("reject"))));
// defineObsProperty("cc", initiator.getCanonicalName(), "GroupParticipant",
// "true", "(accept OR reject)", "DETACHED");
}