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