org.kuali.rice.kew.rule
Class BSFRuleExpression

java.lang.Object
  extended by org.kuali.rice.kew.rule.BSFRuleExpression
All Implemented Interfaces:
RuleExpression
Direct Known Subclasses:
AccumulatingBSFRuleExpression

public class BSFRuleExpression
extends Object
implements RuleExpression

A rule expression implementation that uses Bean Scripting Framework. The language is given by the type qualifier, e.g.: <expression type="BSF:groovy">...

Author:
Kuali Rice Team (rice.collab@kuali.org)

Nested Class Summary
protected static class BSFRuleExpression.WorkflowRuleAPI
          A helper bean that is declared for use by BSF scripts.
 
Constructor Summary
BSFRuleExpression()
           
 
Method Summary
protected  void declareBeans(ScriptEngine engine, Rule rule, RouteContext context)
          Populates the BSFManager with beans that are accessible to BSF scripts.
 RuleExpressionResult evaluate(Rule rule, RouteContext context)
          Performs an evaluation and returns a list of 0 or more RuleResponsibilitys to which to dispatch action requests
protected  String parseLang(String type, String deflt)
          Parses the language component from the type string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BSFRuleExpression

public BSFRuleExpression()
Method Detail

evaluate

public RuleExpressionResult evaluate(Rule rule,
                                     RouteContext context)
                              throws org.kuali.rice.kew.exception.WorkflowException
Description copied from interface: RuleExpression
Performs an evaluation and returns a list of 0 or more RuleResponsibilitys to which to dispatch action requests

Specified by:
evaluate in interface RuleExpression
Parameters:
rule - the rule that this rule expression applies to
context - the RouteContext under which the expression is being evaluated
Returns:
the result of the rule evaluation
Throws:
org.kuali.rice.kew.exception.WorkflowException

parseLang

protected String parseLang(String type,
                           String deflt)
Parses the language component from the type string

Parameters:
type - the type string
deflt - the default language if none is present in the type string
Returns:
the language component or null

declareBeans

protected void declareBeans(ScriptEngine engine,
                            Rule rule,
                            RouteContext context)
                     throws ScriptException
Populates the BSFManager with beans that are accessible to BSF scripts. May be overridden by subclasses. The standard implementation exposes the rule and routeContext

Parameters:
manager - the BSFManager
rule - the current Rule object
context - the current RouteContext
Throws:
ScriptException


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.