001/**
002 * Copyright 2005-2016 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 */
016package org.kuali.rice.kew.framework.support.krms;
017
018import org.kuali.rice.kew.engine.RouteContext;
019import org.kuali.rice.krms.api.engine.Engine;
020import org.kuali.rice.krms.api.engine.EngineResults;
021
022/**
023 * Serves as an interface to execution of a rules engine during execution of the workflow engine.  Applications that
024 * wish to integrate with KRMS from the workflow engine should implement an executor and make it available to the
025 * workflow engine in one of two ways:
026 *
027 * <ol>
028 *     <li>Register an extension with KEW (by ingesting a file containing a &lt;ruleAttribute&gt; mapping a name to the
029 *     implementation class for the RulesEngineExecutor.  This name can then be referenced within the route node definition.</li>
030 *     <li>Simply reference the fully-qualified class name of the RulesEngineExecutor implementation class inside of
031 *     the route node definition</li>
032 * </ol>
033 *
034 * <p>In the first case, the route node definition would look similar to the following:</p>
035 *
036 * <pre>
037 * {@code
038 * <requests name="MyRulesBasedNode">
039 *   <rulesEngine executor="MyRulesEngineExecutor"/>
040 * </requests>
041 * }
042 * </pre>
043 *
044 * <p>The above assumes that an extension/rule attribute has been defined with the name of "MyRulesEngineExecutor".</p>
045 *
046 * <p>Alternatively, the fully-qualified class name can be specified directly as follows:</p>
047 *
048 * <pre>
049 * {@code
050 * <requests name="MyRulesBasedNode">
051 *   <rulesEngine executorClass="MyRulesEngineExecutor"/>
052 * </requests>
053 * }
054 * </pre>
055 *
056 * <p>TODO - this interface should really be part of the framework module, but depends on RouteContext which is currently
057 * part of the impl module.</p>
058 *
059 * @author Kuali Rice Team (rice.collab@kuali.org)
060 */
061public interface RulesEngineExecutor {
062
063    EngineResults execute(RouteContext routeContext, Engine engine);
064
065}