1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krms.framework.engine.expression;
17
18 import java.util.Collections;
19 import java.util.List;
20
21 import org.kuali.rice.krms.api.engine.ExecutionEnvironment;
22 import org.kuali.rice.krms.framework.engine.Proposition;
23 import org.kuali.rice.krms.framework.engine.PropositionResult;
24
25
26
27
28
29
30 public class ExpressionBasedProposition implements Proposition {
31
32 private final Expression<Boolean> expression;
33
34
35
36
37
38 public ExpressionBasedProposition(Expression<Boolean> expression) {
39 this.expression = expression;
40 }
41
42 @Override
43 public PropositionResult evaluate(ExecutionEnvironment environment) {
44 return new PropositionResult(expression.invoke(environment).booleanValue());
45 }
46
47
48 @Override
49 public List<Proposition> getChildren() {
50 return Collections.emptyList();
51 }
52
53 @Override
54 public boolean isCompound() {
55 return false;
56 }
57 }