View Javadoc
1   /**
2    * Copyright 2011 The Kuali Foundation Licensed under the Educational Community License, Version 2.0 (the "License"); you may not
3    * use this file except in compliance with the License. You may obtain a copy of the License at
4    *
5    * http://www.osedu.org/licenses/ECL-2.0
6    *
7    * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS"
8    * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
9    * governing permissions and limitations under the License.
10   */
11  package org.kuali.student.core.krms.proposition;
12  
13  import java.util.Date;
14  import org.kuali.rice.krms.api.engine.ExecutionEnvironment;
15  import org.kuali.rice.krms.api.engine.ResultEvent;
16  import org.kuali.rice.krms.framework.engine.PropositionResult;
17  import org.kuali.rice.krms.framework.engine.result.BasicResult;
18  import org.kuali.student.common.util.krms.RulesExecutionConstants;
19  import org.kuali.student.common.util.krms.proposition.AbstractLeafProposition;
20  
21  /**
22   * This proposition is used to evaluate whether or not a person is alive
23   *
24   * @author alubbers
25   */
26  public class IsAliveProposition extends AbstractLeafProposition {
27  
28      @Override
29      public PropositionResult evaluate(ExecutionEnvironment environment) {
30          Date deceasedDate = environment.resolveTerm(RulesExecutionConstants.STUDENT_DECEASED_DATE_TERM, this);
31  
32          if (deceasedDate == null) {
33              return this.recordResultWithNoDetails(environment, true);
34          }
35          return this.recordResultWithNoDetails(environment, false);
36      }
37  }