Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ContextProvider |
|
| 1.0;1 |
1 | package org.kuali.rice.krms.framework.engine; | |
2 | ||
3 | import java.util.Map; | |
4 | ||
5 | import org.kuali.rice.krms.api.engine.ExecutionOptions; | |
6 | import org.kuali.rice.krms.api.engine.SelectionCriteria; | |
7 | import org.kuali.rice.krms.api.engine.Term; | |
8 | ||
9 | /** | |
10 | * Loads a {@link Context} for the given set of criteria. Applications who | |
11 | * want to provide their own means for creating a context and supplying it to | |
12 | * the KRMS engine can do so by implementing a custom ContextProvider. | |
13 | * | |
14 | * @see Context | |
15 | * | |
16 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
17 | * | |
18 | */ | |
19 | public interface ContextProvider { | |
20 | ||
21 | /** | |
22 | * Loads the context for the given selection criteria, facts, and execution | |
23 | * options. If no context can be located based on the given criteria, then | |
24 | * this method should return null. | |
25 | * | |
26 | * <p>In the case where multiple Contexts could potentially be identified | |
27 | * from the same set of selection criteria, it is up to the implementer | |
28 | * of the ContextProvider to ensure that the most appropriate Context is | |
29 | * returned. Or alternatively, an exception could be thrown indicating | |
30 | * context ambiguity. | |
31 | * | |
32 | * <p>The sectionCriteria, facts, and executionOptions which are passed to | |
33 | * this method should never be null. However, they might be empty. | |
34 | * | |
35 | * @param selectionCriteria the criteria to use during the selection phase of engine operation | |
36 | * @param facts the set of facts that are supplied to the engine at execution time | |
37 | * @param executionOptions a collection of options that can be used to customize engine execution behavior | |
38 | * | |
39 | * @return the context which matches the given criteria, or null if no context matches | |
40 | */ | |
41 | public Context loadContext(SelectionCriteria selectionCriteria, Map<Term, Object> facts, ExecutionOptions executionOptions); | |
42 | ||
43 | } |