View Javadoc

1   /**
2    * Copyright 2005-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.krms.framework;
17  
18  import org.kuali.rice.krms.api.engine.ExecutionEnvironment;
19  import org.kuali.rice.krms.api.engine.ResultEvent;
20  import org.kuali.rice.krms.framework.engine.Action;
21  import org.kuali.rice.krms.framework.engine.ResultLogger;
22  import org.kuali.rice.krms.framework.engine.result.BasicResult;
23  
24  /**
25   * A test action class for the KRMS POC
26   *
27   */
28  public class SayHelloAction implements Action {
29  	private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(SayHelloAction.class);
30  	private static final ResultLogger KLog = ResultLogger.getInstance();
31  	
32  	public SayHelloAction(){}
33  	
34  	@Override
35  	public void execute(ExecutionEnvironment environment) {
36  		LOG.info("Hello!  Im executing an action.");
37  		KLog.logResult(new BasicResult(ResultEvent.ACTION_EXECUTED, this, environment));
38  	}
39  	
40  	@Override
41  	public void executeSimulation(ExecutionEnvironment environment) {
42  		throw new UnsupportedOperationException();
43  	}
44  
45  	public String toString(){
46  		return getClass().getSimpleName();
47  	}
48  }