org.kuali.rice.krms.framework.engine
Class BasicExecutionEnvironment

java.lang.Object
  extended by org.kuali.rice.krms.framework.engine.BasicExecutionEnvironment
All Implemented Interfaces:
ExecutionEnvironment

public final class BasicExecutionEnvironment
extends Object
implements ExecutionEnvironment

An implementation of ExecutionEnvironment given SelectionCriteria, facts (Map<Term, Object> ), ExecutionOptions and TermResolutionEngine.

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

Constructor Summary
BasicExecutionEnvironment(SelectionCriteria selectionCriteria, Map<Term,Object> facts, ExecutionOptions executionOptions, TermResolutionEngine termResolutionEngine)
          Constructor for a BasicExecutionEnvironment with the given SelectionCriteria, facts, ExecutionOptions and TermResolutionEngine
 
Method Summary
 void addTermResolver(TermResolver<?> termResolver)
          Add a TermResolver
 EngineResults getEngineResults()
          Return the EngineResults
 ExecutionOptions getExecutionOptions()
          Return the ExecutionOptions
 Map<Term,Object> getFacts()
          Returns an immutable Map of facts available within this environment.
 SelectionCriteria getSelectionCriteria()
          Returns the selection criteria that was used to initialize the environment.
 Set<Term> getTermsForCaller(Object caller)
          Return a set of Term for the given value
 boolean publishFact(Term factName, Object factValue)
          Publishes a new fact
<T> T
resolveTerm(Term term, Object caller)
          Resolve
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicExecutionEnvironment

public BasicExecutionEnvironment(SelectionCriteria selectionCriteria,
                                 Map<Term,Object> facts,
                                 ExecutionOptions executionOptions,
                                 TermResolutionEngine termResolutionEngine)
Constructor for a BasicExecutionEnvironment with the given SelectionCriteria, facts, ExecutionOptions and TermResolutionEngine

Parameters:
selectionCriteria - to set selectionCriteria to, cannot be null
facts - to set facts to, cannot be null
executionOptions - to set executionOptions to
termResolutionEngine - to set termResolutionEngine to
Throws:
IllegalArgumentException - if the selectionCriteria or facts are null
Method Detail

getSelectionCriteria

public SelectionCriteria getSelectionCriteria()
Description copied from interface: ExecutionEnvironment
Returns the selection criteria that was used to initialize the environment.

Specified by:
getSelectionCriteria in interface ExecutionEnvironment
Returns:
the selection criteria for this environment

getFacts

public Map<Term,Object> getFacts()
Description copied from interface: ExecutionEnvironment
Returns an immutable Map of facts available within this environment.

Specified by:
getFacts in interface ExecutionEnvironment
Returns:
the facts in this environment

addTermResolver

public void addTermResolver(TermResolver<?> termResolver)
Description copied from interface: ExecutionEnvironment
Add a TermResolver

Specified by:
addTermResolver in interface ExecutionEnvironment

resolveTerm

public <T> T resolveTerm(Term term,
                         Object caller)
              throws TermResolutionException
Description copied from interface: ExecutionEnvironment
Resolve

Specified by:
resolveTerm in interface ExecutionEnvironment
Parameters:
term - Term
Returns:
T
Throws:
TermResolutionException

getTermsForCaller

public Set<Term> getTermsForCaller(Object caller)
Description copied from interface: ExecutionEnvironment
Return a set of Term for the given value

Specified by:
getTermsForCaller in interface ExecutionEnvironment
Returns:
Set

publishFact

public boolean publishFact(Term factName,
                           Object factValue)
Description copied from interface: ExecutionEnvironment
Publishes a new fact

Specified by:
publishFact in interface ExecutionEnvironment
Parameters:
factName - name of the fact to publish
factValue - value of the fact to publish // TODO: we don't support updating facts, refactor this method
Returns:
true if an existing fact was updated, false if this was a new fact

getExecutionOptions

public ExecutionOptions getExecutionOptions()
Description copied from interface: ExecutionEnvironment
Return the ExecutionOptions

Specified by:
getExecutionOptions in interface ExecutionEnvironment
Returns:
ExecutionOptions

getEngineResults

public EngineResults getEngineResults()
Description copied from interface: ExecutionEnvironment
Return the EngineResults

Specified by:
getEngineResults in interface ExecutionEnvironment
Returns:
EngineResults


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.