001 /**
002 * Copyright 2005-2012 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.rice.krms.framework;
017
018 import org.kuali.rice.krms.api.engine.ExecutionEnvironment;
019 import org.kuali.rice.krms.api.engine.ResultEvent;
020 import org.kuali.rice.krms.framework.engine.Action;
021 import org.kuali.rice.krms.framework.engine.ResultLogger;
022 import org.kuali.rice.krms.framework.engine.result.BasicResult;
023
024 /**
025 * A test action class for the KRMS POC
026 *
027 */
028 public class SayHelloAction implements Action {
029 private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(SayHelloAction.class);
030 private static final ResultLogger KLog = ResultLogger.getInstance();
031
032 public SayHelloAction(){}
033
034 @Override
035 public void execute(ExecutionEnvironment environment) {
036 LOG.info("Hello! Im executing an action.");
037 KLog.logResult(new BasicResult(ResultEvent.ACTION_EXECUTED, this, environment));
038 }
039
040 @Override
041 public void executeSimulation(ExecutionEnvironment environment) {
042 throw new UnsupportedOperationException();
043 }
044
045 public String toString(){
046 return getClass().getSimpleName();
047 }
048 }