Skip to content

Commit

Permalink
Merge pull request #6 from Extended-Green-Cloud/release-1.3
Browse files Browse the repository at this point in the history
Release 1.3.1
  • Loading branch information
soffi49 authored May 5, 2024
2 parents f6dbe3d + 8bffaee commit 6c1f951
Show file tree
Hide file tree
Showing 51 changed files with 209 additions and 242 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<!-- Basic configuration of the project -->
<groupId>io.github.extended-green-cloud</groupId>
<artifactId>jrba</artifactId>
<version>1.3</version>
<version>1.3.1</version>
<packaging>jar</packaging>

<!-- Metadata configuration -->
Expand Down
9 changes: 0 additions & 9 deletions src/main/java/org/jrba/agentmodel/domain/AbstractAgent.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.annotations.VisibleForTesting;

import jade.core.Agent;
import jade.core.behaviours.Behaviour;
import lombok.Getter;
Expand Down Expand Up @@ -52,7 +50,6 @@ public AbstractAgent() {
/**
* Abstract method used to validate if arguments of the given agent are correct
*/
@VisibleForTesting
protected void validateAgentArguments() {
if (isNull(properties)) {
logger.warn("Agent properties have not been set!");
Expand All @@ -64,7 +61,6 @@ protected void validateAgentArguments() {
*
* @param arguments arguments passed by the user
*/
@VisibleForTesting
protected void initializeAgent(final Object[] arguments) {
//TO BE OVERRIDDEN BY USER
}
Expand All @@ -74,7 +70,6 @@ protected void initializeAgent(final Object[] arguments) {
*
* @return list of behaviours that are to be initially initiated by the Agent
*/
@VisibleForTesting
protected List<Behaviour> prepareStartingBehaviours() {
return emptyList();
}
Expand All @@ -83,15 +78,13 @@ protected List<Behaviour> prepareStartingBehaviours() {
* Abstract method responsible for running starting behaviours,
* By default
*/
@VisibleForTesting
protected void runStartingBehaviours() {
addBehaviour(new ListenForControllerObjects(this, prepareStartingBehaviours(), getObjectsNumber()));
}

/**
* Abstract method responsible for running initial custom behaviours prepared only for selected rule set
*/
@VisibleForTesting
protected void runInitialBehavioursForRuleSet() {
final RuleSetFacts facts = new RuleSetFacts(rulesController.getLatestLongTermRuleSetIdx().get());
facts.put(RULE_TYPE, INITIALIZE_BEHAVIOURS_RULE);
Expand Down Expand Up @@ -151,7 +144,6 @@ protected String getDefaultRuleSet() {
}

@Override
@VisibleForTesting
protected void setup() {
final Object[] arguments = getArguments();

Expand All @@ -161,7 +153,6 @@ protected void setup() {
}

@Override
@VisibleForTesting
protected void takeDown() {
logger.info("I'm finished. Bye!");
super.takeDown();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
import static org.jrba.rulesengine.constants.FactTypeConstants.CFP_RESULT;
import static org.jrba.rulesengine.constants.FactTypeConstants.RULE_STEP;
import static org.jrba.rulesengine.constants.FactTypeConstants.RULE_TYPE;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.CFP_COMPARE_MESSAGES_STEP;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.CFP_CREATE_STEP;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.CFP_HANDLE_NO_AVAILABLE_AGENTS_STEP;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.CFP_HANDLE_NO_RESPONSES_STEP;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.CFP_HANDLE_REJECT_PROPOSAL_STEP;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.CFP_HANDLE_SELECTED_PROPOSAL_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.CFP_COMPARE_MESSAGES_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.CFP_CREATE_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.CFP_HANDLE_NO_AVAILABLE_AGENTS_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.CFP_HANDLE_NO_RESPONSES_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.CFP_HANDLE_REJECT_PROPOSAL_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.CFP_HANDLE_SELECTED_PROPOSAL_STEP;
import static org.jrba.utils.messages.MessageReader.readForPerformative;

import java.util.Vector;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import static org.jrba.rulesengine.constants.FactTypeConstants.PROPOSAL_REJECT_MESSAGE;
import static org.jrba.rulesengine.constants.FactTypeConstants.RULE_STEP;
import static org.jrba.rulesengine.constants.FactTypeConstants.RULE_TYPE;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.PROPOSAL_CREATE_STEP;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.PROPOSAL_HANDLE_ACCEPT_STEP;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.PROPOSAL_HANDLE_REJECT_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.PROPOSAL_CREATE_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.PROPOSAL_HANDLE_ACCEPT_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.PROPOSAL_HANDLE_REJECT_STEP;

import org.jrba.rulesengine.RulesController;
import org.jrba.rulesengine.ruleset.RuleSetFacts;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
import static org.jrba.rulesengine.constants.FactTypeConstants.REQUEST_REFUSE_MESSAGE;
import static org.jrba.rulesengine.constants.FactTypeConstants.RULE_STEP;
import static org.jrba.rulesengine.constants.FactTypeConstants.RULE_TYPE;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.REQUEST_CREATE_STEP;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.REQUEST_HANDLE_ALL_RESULTS_STEP;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.REQUEST_HANDLE_FAILURE_STEP;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.REQUEST_HANDLE_INFORM_STEP;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.REQUEST_HANDLE_REFUSE_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.REQUEST_CREATE_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.REQUEST_HANDLE_ALL_RESULTS_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.REQUEST_HANDLE_FAILURE_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.REQUEST_HANDLE_INFORM_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.REQUEST_HANDLE_REFUSE_STEP;
import static org.jrba.utils.messages.MessageReader.readForPerformative;

import java.util.Vector;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import static org.jrba.rulesengine.constants.FactTypeConstants.SUBSCRIPTION_ADDED_AGENTS;
import static org.jrba.rulesengine.constants.FactTypeConstants.SUBSCRIPTION_CREATE_MESSAGE;
import static org.jrba.rulesengine.constants.FactTypeConstants.SUBSCRIPTION_REMOVED_AGENTS;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.SUBSCRIPTION_CREATE_STEP;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.SUBSCRIPTION_HANDLE_AGENTS_RESPONSE_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.SUBSCRIPTION_CREATE_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.SUBSCRIPTION_HANDLE_AGENTS_RESPONSE_STEP;
import static org.jrba.utils.mapper.FactsMapper.mapToRuleSetFacts;
import static org.jrba.utils.yellowpages.YellowPagesRegister.decodeSubscription;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import static org.jrba.rulesengine.constants.FactTypeConstants.RULE_SET_IDX;
import static org.jrba.rulesengine.constants.FactTypeConstants.RULE_STEP;
import static org.jrba.rulesengine.constants.FactTypeConstants.RULE_TYPE;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.MESSAGE_READER_READ_CONTENT_STEP;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.MESSAGE_READER_READ_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.MESSAGE_READER_READ_CONTENT_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.MESSAGE_READER_READ_STEP;
import static org.jrba.utils.mapper.FactsMapper.mapToRuleSetFacts;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import static org.jrba.rulesengine.constants.FactTypeConstants.RECEIVED_MESSAGE;
import static org.jrba.rulesengine.constants.FactTypeConstants.RULE_STEP;
import static org.jrba.rulesengine.constants.FactTypeConstants.RULE_TYPE;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.SINGLE_MESSAGE_READER_CREATE_STEP;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.SINGLE_MESSAGE_READER_HANDLE_MESSAGE_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.SINGLE_MESSAGE_READER_CREATE_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.SINGLE_MESSAGE_READER_HANDLE_MESSAGE_STEP;

import org.jrba.rulesengine.RulesController;
import org.jrba.rulesengine.ruleset.RuleSetFacts;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import static org.jrba.rulesengine.constants.FactTypeConstants.RULE_STEP;
import static org.jrba.rulesengine.constants.FactTypeConstants.RULE_TYPE;
import static org.jrba.rulesengine.constants.FactTypeConstants.TRIGGER_TIME;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.SCHEDULED_EXECUTE_ACTION_STEP;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.SCHEDULED_SELECT_TIME_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.SCHEDULED_EXECUTE_ACTION_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.SCHEDULED_SELECT_TIME_STEP;
import static org.jrba.utils.mapper.FactsMapper.mapToRuleSetFacts;
import static org.jrba.utils.rules.RuleSetSelector.selectRuleSetIndex;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import static org.jrba.rulesengine.constants.FactTypeConstants.RULE_STEP;
import static org.jrba.rulesengine.constants.FactTypeConstants.RULE_TYPE;
import static org.jrba.rulesengine.constants.FactTypeConstants.TRIGGER_PERIOD;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.PERIODIC_EXECUTE_ACTION_STEP;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.PERIODIC_SELECT_PERIOD_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.PERIODIC_EXECUTE_ACTION_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.PERIODIC_SELECT_PERIOD_STEP;
import static org.jrba.utils.mapper.FactsMapper.mapToRuleSetFacts;

import org.jrba.rulesengine.RulesController;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import static org.jrba.rulesengine.constants.FactTypeConstants.RESULT;
import static org.jrba.rulesengine.constants.FactTypeConstants.RULE_STEP;
import static org.jrba.rulesengine.constants.FactTypeConstants.RULE_TYPE;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.SEARCH_AGENTS_STEP;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.SEARCH_HANDLE_NO_RESULTS_STEP;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.SEARCH_HANDLE_RESULTS_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.SEARCH_AGENTS_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.SEARCH_HANDLE_NO_RESULTS_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.SEARCH_HANDLE_RESULTS_STEP;

import java.util.Set;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.jrba.rulesengine.rest.controller;

import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR;
import static org.springframework.http.HttpStatus.NOT_FOUND;

import org.jrba.exception.CannotFindAgentException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.io.Serializable;
import java.util.List;

import org.jrba.rulesengine.enums.rulecombinationtype.AgentCombinedRuleType;
import org.jrba.rulesengine.types.rulecombinationtype.AgentCombinedRuleType;

import com.fasterxml.jackson.annotation.JsonInclude;

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/jrba/rulesengine/rule/AgentBasicRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import static org.jrba.rulesengine.constants.MVELParameterConstants.FACTS;
import static org.jrba.rulesengine.constants.MVELParameterConstants.LOGGER;
import static org.jrba.rulesengine.constants.MVELParameterConstants.RULES_CONTROLLER;
import static org.jrba.rulesengine.enums.ruletype.AgentRuleTypeEnum.BASIC;
import static org.jrba.rulesengine.types.ruletype.AgentRuleTypeEnum.BASIC;
import static org.jrba.rulesengine.mvel.MVELObjectType.getObjectForType;
import static org.slf4j.LoggerFactory.getLogger;

Expand All @@ -34,6 +34,7 @@
import jade.core.Agent;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
* Abstract class defining structure of a rule, executed within an agent's behaviour.
Expand All @@ -43,6 +44,7 @@
*/
@Getter
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@SuppressWarnings("unchecked")
public class AgentBasicRule<T extends AgentProps, E extends AgentNode<T>> extends BasicRule
implements AgentRule, Serializable {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.jrba.rulesengine.rule;

import org.jrba.rulesengine.enums.rulesteptype.RuleStepType;
import org.jrba.rulesengine.types.rulesteptype.RuleStepType;

/**
* Class storing common properties which describe a given rule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import static java.util.Collections.singletonList;
import static org.jrba.rulesengine.constants.RuleTypeConstants.DEFAULT_COMBINED_RULE;
import static org.jrba.rulesengine.enums.ruletype.AgentRuleTypeEnum.BASIC;
import static org.jrba.rulesengine.enums.ruletype.AgentRuleTypeEnum.COMBINED;
import static org.jrba.rulesengine.mvel.MVELRuleMapper.getRuleForType;
import static org.jrba.rulesengine.types.ruletype.AgentRuleTypeEnum.BASIC;
import static org.jrba.rulesengine.types.ruletype.AgentRuleTypeEnum.COMBINED;

import java.io.Serializable;
import java.util.ArrayList;
Expand All @@ -18,13 +18,13 @@
import org.jrba.agentmodel.domain.node.AgentNode;
import org.jrba.agentmodel.domain.props.AgentProps;
import org.jrba.rulesengine.RulesController;
import org.jrba.rulesengine.enums.rulecombinationtype.AgentCombinedRuleType;
import org.jrba.rulesengine.rest.domain.CombinedRuleRest;
import org.jrba.rulesengine.rule.AgentBasicRule;
import org.jrba.rulesengine.rule.AgentRule;
import org.jrba.rulesengine.rule.AgentRuleDescription;
import org.jrba.rulesengine.ruleset.RuleSet;
import org.jrba.rulesengine.ruleset.RuleSetFacts;
import org.jrba.rulesengine.types.rulecombinationtype.AgentCombinedRuleType;

import lombok.Getter;
import lombok.Setter;
Expand Down Expand Up @@ -83,6 +83,21 @@ protected AgentCombinedRule(final RulesController<T, E> controller, final AgentC
this.rulesToCombine = new ArrayList<>(constructRules());
}

/**
* Constructor
*
* @param controller rules controller connected to the agent
* @param combinationType way in which agent rules are to be combined
* @param rulesToCombine list of nested rules
*/
protected AgentCombinedRule(final RulesController<T, E> controller, final AgentCombinedRuleType combinationType,
final List<AgentRule> rulesToCombine) {
super(controller);
this.combinationType = combinationType.getType();
this.ruleSet = null;
this.rulesToCombine = new ArrayList<>(rulesToCombine);
}

/**
* Constructor
*
Expand Down Expand Up @@ -205,7 +220,7 @@ public boolean evaluate(final Facts facts) {
if (preEvaluated.test((RuleSetFacts) facts)) {
preExecute.accept((RuleSetFacts) facts);
}
return preEvaluated.test((RuleSetFacts) facts) && AgentCombinedRule.this.evaluate(facts);
return preEvaluated.test((RuleSetFacts) facts) && super.evaluate(facts);
}

@Override
Expand Down Expand Up @@ -266,7 +281,7 @@ public AgentRuleDescription initializeRuleDescription() {
public boolean evaluate(final Facts facts) {
if (preEvaluated.test((RuleSetFacts) facts)) {
preExecute.accept((RuleSetFacts) facts);
return AgentCombinedRule.this.evaluate(facts);
return super.evaluate(facts);
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import static java.util.Objects.nonNull;
import static org.jrba.rulesengine.constants.MVELParameterConstants.FACTS;
import static org.jrba.rulesengine.constants.RuleTypeConstants.INITIALIZE_BEHAVIOURS_RULE;
import static org.jrba.rulesengine.enums.ruletype.AgentRuleTypeEnum.BEHAVIOUR;
import static org.jrba.rulesengine.types.ruletype.AgentRuleTypeEnum.BEHAVIOUR;

import java.io.Serializable;
import java.util.ArrayList;
Expand All @@ -16,12 +16,10 @@
import org.jrba.agentmodel.domain.node.AgentNode;
import org.jrba.agentmodel.domain.props.AgentProps;
import org.jrba.rulesengine.RulesController;
import org.jrba.rulesengine.enums.ruletype.AgentRuleType;
import org.jrba.rulesengine.rest.domain.BehaviourRuleRest;
import org.jrba.rulesengine.rule.AgentBasicRule;
import org.jrba.rulesengine.rule.AgentRule;
import org.jrba.rulesengine.rule.AgentRuleDescription;
import org.jrba.rulesengine.ruleset.RuleSet;
import org.jrba.rulesengine.ruleset.RuleSetFacts;
import org.mvel2.MVEL;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
import static java.util.Objects.isNull;
import static org.jrba.rulesengine.constants.MVELParameterConstants.FACTS;
import static org.jrba.rulesengine.constants.RuleTypeConstants.DEFAULT_CHAIN_RULE;
import static org.jrba.rulesengine.enums.ruletype.AgentRuleTypeEnum.CHAIN;
import static org.jrba.rulesengine.types.ruletype.AgentRuleTypeEnum.CHAIN;

import java.io.Serializable;

import org.jeasy.rules.api.Facts;
import org.jrba.agentmodel.domain.node.AgentNode;
import org.jrba.agentmodel.domain.props.AgentProps;
import org.jrba.rulesengine.RulesController;
import org.jrba.rulesengine.enums.ruletype.AgentRuleType;
import org.jrba.rulesengine.rest.domain.RuleRest;
import org.jrba.rulesengine.rule.AgentBasicRule;
import org.jrba.rulesengine.rule.AgentRule;
Expand All @@ -32,7 +31,7 @@
public class AgentChainRule<T extends AgentProps, E extends AgentNode<T>> extends AgentBasicRule<T, E> implements
Serializable {

private RuleSet ruleSet;
private final RuleSet ruleSet;

/**
* Copy constructor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
import static org.jrba.rulesengine.constants.MVELParameterConstants.NEW_PROPOSAL;
import static org.jrba.rulesengine.constants.MVELParameterConstants.PROPOSAL_TO_REJECT;
import static org.jrba.rulesengine.constants.RuleTypeConstants.DEFAULT_CFP_RULE;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.CFP_COMPARE_MESSAGES_STEP;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.CFP_CREATE_STEP;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.CFP_HANDLE_NO_AVAILABLE_AGENTS_STEP;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.CFP_HANDLE_NO_RESPONSES_STEP;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.CFP_HANDLE_REJECT_PROPOSAL_STEP;
import static org.jrba.rulesengine.enums.rulesteptype.RuleStepTypeEnum.CFP_HANDLE_SELECTED_PROPOSAL_STEP;
import static org.jrba.rulesengine.enums.ruletype.AgentRuleTypeEnum.CFP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.CFP_COMPARE_MESSAGES_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.CFP_CREATE_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.CFP_HANDLE_NO_AVAILABLE_AGENTS_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.CFP_HANDLE_NO_RESPONSES_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.CFP_HANDLE_REJECT_PROPOSAL_STEP;
import static org.jrba.rulesengine.types.rulesteptype.RuleStepTypeEnum.CFP_HANDLE_SELECTED_PROPOSAL_STEP;
import static org.jrba.rulesengine.types.ruletype.AgentRuleTypeEnum.CFP;

import java.io.Serializable;
import java.util.ArrayList;
Expand Down Expand Up @@ -274,8 +274,7 @@ public void executeRule(final RuleSetFacts facts) {
if (nonNull(AgentCFPRule.this.initialParameters)) {
AgentCFPRule.this.initialParameters.replace(FACTS, facts);
}

int result = 0;
int result;

if (isNull(expressionCompareProposals)) {
result = compareProposals(facts, bestProposal, newProposal);
Expand Down
Loading

0 comments on commit 6c1f951

Please sign in to comment.