| java.lang.Object com.xoetrope.survey.DefaultRuleEngine
DefaultRuleEngine | public class DefaultRuleEngine implements RuleEngine(Code) | | DefaultRuleEngine is responsible for managing rules contained in a survey.
Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
the GNU Public License (GPL), please see license.txt for more details. If
you make commercial use of this software you must purchase a commercial
license from Xoetrope.
$Revision: 1.5 $
|
currentProject | protected XProject currentProject(Code) | | |
DefaultRuleEngine | public DefaultRuleEngine()(Code) | | |
checkRules | protected int checkRules(Vector rules, Vector responses)(Code) | | Checks whether the specified responses match the specified rules,
if so the target question group is returned
Parameters: rules - the rules to be queried Parameters: respones - the responses given by the user the id of the target question group or -1if the responses and rules do not match. |
createRules | public Vector createRules(QuestionGroup group)(Code) | | Creates the rules from the xml element stored
in the specified question group.
Parameters: group - the question group whose rulesare to be created Vector containing rules. |
handleAnswer | public void handleAnswer(int group, Condition response, XmlElement rules)(Code) | | Handles user's answer according to the rules. This method is called after user's
answer for single question.
Parameters: group - id of the current question group Parameters: response - Parameters: rules - xml node describing rules of the current survey. |
handleGroup | public void handleGroup(QuestionGroup group, Vector conditions, XmlElement xmlRules)(Code) | | Handles set of answers given by the user. This method is called after user's answer for all
questions from the current question group.
Parameters: group - current question group Parameters: conditions - answers given by the user Parameters: xmlRules - xml node describing rules of the current survey. |
makeRules | public XmlElement makeRules(Vector rules)(Code) | | Creates the xml element describing the specified rules
Parameters: rule - Vector containing rules xml element describing specified rules |
|
|