Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ExecutionEnvironment |
|
| 1.0;1 |
1 | package org.kuali.rice.krms.api.engine; | |
2 | ||
3 | import java.util.Map; | |
4 | import java.util.Set; | |
5 | ||
6 | /** | |
7 | * The ExecutionEnvironment manages contextual information which is made available to | |
8 | * different components of the rules engine during execution. Facts can be retrieved | |
9 | * from and published to the environment. It also provides a reference to the | |
10 | * {@link EngineResults} or tracking engine activity and returning values back to | |
11 | * the client of the rules engine. | |
12 | * | |
13 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
14 | * | |
15 | */ | |
16 | public interface ExecutionEnvironment { | |
17 | ||
18 | /** | |
19 | * Returns the selection criteria that was used to initialize the environment. | |
20 | * | |
21 | * @return the selection criteria for this environment | |
22 | */ | |
23 | public SelectionCriteria getSelectionCriteria(); | |
24 | ||
25 | /** | |
26 | * Returns an immutable Map of facts available within this environment. | |
27 | * | |
28 | * @return the facts in this environment | |
29 | */ | |
30 | public Map<Term, Object> getFacts(); | |
31 | ||
32 | /** | |
33 | * Publishes a new fact | |
34 | * | |
35 | * @param factName name of the fact to publish | |
36 | * @param factValue value of the fact to publish | |
37 | * // TODO: we don't support updating facts, refactor this method | |
38 | * @return true if an existing fact was updated, false if this was a new fact | |
39 | */ | |
40 | public boolean publishFact(Term factName, Object factValue); | |
41 | ||
42 | public void addTermResolver(TermResolver<?> termResolver); | |
43 | ||
44 | public <T> T resolveTerm(Term term, Object caller) throws TermResolutionException; | |
45 | ||
46 | public Set<Term> getTermsForCaller(Object caller); | |
47 | ||
48 | public ExecutionOptions getExecutionOptions(); | |
49 | ||
50 | public EngineResults getEngineResults(); | |
51 | ||
52 | } |