public class BETestEngine
extends java.lang.Object
Constructor and Description |
---|
BETestEngine(java.lang.String propertyFile)
Creates a new
BETestEngine and sets the engine
properties based on the propertyFile provide. |
Modifier and Type | Method and Description |
---|---|
void |
assertConcept(Concept c,
boolean executeRules)
Asserts a new concept into the current run's working memory
|
void |
assertConcepts(java.util.List concepts,
boolean executeRules)
Asserts all concepts into the current run's working memory
|
void |
assertEvent(SimpleEvent event,
boolean executeRules)
Asserts a new event into the current run's working memory
|
void |
assertEvent(SimpleEvent event,
boolean executeRules,
java.lang.String preprocessorUri)
Asserts a new event into the current run's working memory
|
void |
assertEvents(java.util.List events,
boolean executeRules)
Asserts all events into the current run's working memory
|
void |
assertScorecard(Concept sc,
boolean executeRules)
Asserts a new scorecard into the current run's working memory
|
void |
assertScorecards(java.util.List scorecards,
boolean executeRules)
Asserts Scorecard into the current run's working memory
|
void |
clearWorkingMemory()
Clear the working memory for the current tester rule session.
|
void |
executeRules()
Execute the rules in the current rule session.
|
java.lang.Object |
invokeCatalogFunction(java.lang.String functionFQName,
java.lang.Object[] args)
Invoke a catalog function on the current tester
RuleSession . |
java.lang.Object |
invokeDecisionTable(java.lang.String vrfURI,
java.lang.Object[] args)
Invoke the default Decision Table for the virtual rule function on the current tester
RuleSession . |
java.lang.Object |
invokeDecisionTable(java.lang.String vrfURI,
java.lang.String tableURI,
java.lang.Object[] args)
Invoke a specific Decision Table on the current tester
RuleSession . |
java.lang.Object |
invokeRuleFunction(java.lang.String funcNameUri,
java.lang.Object[] args)
Invoke a RuleFunction on the current tester
RuleSession . |
void |
resetSession()
Reset the current tester rule session to a start state.
|
void |
shutdown()
Shut down the test engine and the current rule session
|
void |
start()
Create a new
RuleServiceProvider and start the rule session specified by the agent constructor parameter |
public BETestEngine(java.lang.String propertyFile)
BETestEngine
and sets the engine
properties based on the propertyFile provide. These properties
include:propertyFile
- java.io.IOException
public void assertConcept(Concept c, boolean executeRules) throws DuplicateExtIdException
c
- - the Concept to insertexecuteRules
- - if true, asserting the Concept will execute any related rulesDuplicateExtIdException
- - if the external ID of the object to assert already exists in the session.public void assertScorecard(Concept sc, boolean executeRules) throws DuplicateExtIdException
sc-
- the Scorecard to insertexecuteRules
- - if true, asserting the Concept will execute any related rulesDuplicateExtIdException
public void assertConcepts(java.util.List concepts, boolean executeRules)
concepts
- - a List of the Concepts to insertexecuteRules
- - if true, asserting the Concepts will execute any related rulespublic void assertScorecards(java.util.List scorecards, boolean executeRules)
scorecards
- - a List of the scorecards to insertexecuteRules
- - if true, asserting the Concepts will execute any related rulespublic void assertEvent(SimpleEvent event, boolean executeRules, java.lang.String preprocessorUri) throws DuplicateExtIdException
event
- - the Event to insertexecuteRules
- - if true, asserting the Event will execute any related rulespreprocessorUri
- - if specified, the Rule Function will be called with the event
to simulate a preprocessor.
The specified preprocessorUri's arguments must match the SimpleEvent typeDuplicateExtIdException
- - if the external ID of the object to assert already exists in the session.public void assertEvent(SimpleEvent event, boolean executeRules) throws DuplicateExtIdException
event
- - the Event to insertexecuteRules
- - if true, asserting the Event will execute any related rulesDuplicateExtIdException
- - if the external ID of the object to assert already exists in the session.public void assertEvents(java.util.List events, boolean executeRules)
events
- - a List of the Events to insertexecuteRules
- - if true, asserting the Events will execute any related rulespublic void clearWorkingMemory()
public void executeRules()
Expecter
can then be used to inspect the resultspublic java.lang.Object invokeCatalogFunction(java.lang.String functionFQName, java.lang.Object[] args)
RuleSession
.functionFQName
- the fully qualified Catalog function name to be invoked i.e. "System.debugOut"args
- a variable argument specifying the input argumentspublic java.lang.Object invokeRuleFunction(java.lang.String funcNameUri, java.lang.Object[] args)
RuleSession
.functionURI
- the URI of the RuleFunction to be invokedargs
- an Object array specifies the input argumentspublic java.lang.Object invokeDecisionTable(java.lang.String vrfURI, java.lang.String tableURI, java.lang.Object[] args)
RuleSession
.vrfURI
- the URI of the virtual rule functiontableURI
- the URI of the Decision Table to be invokedargs
- an Object array specifies the input argumentspublic java.lang.Object invokeDecisionTable(java.lang.String vrfURI, java.lang.Object[] args)
RuleSession
.vrfURI
- the URI of the virtual rule functionargs
- an Object array specifies the input argumentspublic void resetSession()
java.lang.Exception
public void shutdown()
public void start()
RuleServiceProvider
and start the rule session specified by the agent constructor parameter