| java.lang.Object org.osbl.agent.model.condition.BeanShellCondition
BeanShellCondition | public class BeanShellCondition implements Condition(Code) | | This Condition class executes a beanshell script and evaluates to true if
the script's last expression is either true (primitive or wrapper class)
or, for any other type, not null.
At evaluation time, a variable subject is bound to the subjectInstance of
the runtime context, so that beanshell scripts can refer to this value.
See Also: http://www.beanshell.org/ author: Sebastian Nozzi. |
Method Summary | |
public boolean | equals(Object obj) | public boolean | evaluate(RuleContext context) Evaluates the beanshell script and returns true if the last
expression of the script evaluates to true or, in case its
type is neither boolean or Boolean, the last expression is not null. | public String | getScript() Gets the script's source-code. | public void | setScript(String script) Sets the script source-code. |
BeanShellCondition | public BeanShellCondition(String script)(Code) | | Instantiates a new beanshell condition with an initial script source-code.
Parameters: script - the script |
BeanShellCondition | public BeanShellCondition()(Code) | | Instantiates a new beanshell condition.
|
evaluate | public boolean evaluate(RuleContext context)(Code) | | Evaluates the beanshell script and returns true if the last
expression of the script evaluates to true or, in case its
type is neither boolean or Boolean, the last expression is not null.
In case the script is empty, not set or has errors, it returns false.
Parameters: context - the context true, if evaluate See Also: org.osbl.agent.model.condition.Condition.evaluate(org.osbl.agent.model.RuleContext) |
getScript | public String getScript()(Code) | | Gets the script's source-code.
the script's souce-code. |
setScript | public void setScript(String script)(Code) | | Sets the script source-code.
Parameters: script - the new script's souce-code. |
|
|