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
24
25
26
27
28
29
30 public class ExpressionBasedProposition implements Proposition {
31
32 private final Expression<Boolean> expression;
33
34 public ExpressionBasedProposition(Expression<Boolean> expression) {
35 this.expression = expression;
36 }
37
38 @Override
39 public boolean evaluate(ExecutionEnvironment environment) {
40 return expression.invoke(environment).booleanValue();
41 }
42
43
44 @Override
45 public List<Proposition> getChildren() {
46 return Collections.emptyList();
47 }
48
49 @Override
50 public boolean isCompound() {
51 return false;
52 }
53 }