/**

   Copyright 2010 OpenEngSB Division, Vienna University of Technology

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

 */
package org.openengsb.core.workflow;

import java.util.Collection;

import org.drools.RuleBase;
import org.openengsb.core.workflow.internal.RuleBaseException;
import org.openengsb.core.workflow.model.RuleBaseElementId;
import org.openengsb.core.workflow.model.RuleBaseElementType;

public interface RuleManager {

    RuleBase getRulebase();

    void add(RuleBaseElementId name, String code) throws RuleBaseException;

    String get(RuleBaseElementId name);

    void update(RuleBaseElementId name, String newCode) throws RuleBaseException;

    void delete(RuleBaseElementId name) throws RuleBaseException;

    Collection<RuleBaseElementId> list(RuleBaseElementType type);

    Collection<RuleBaseElementId> list(RuleBaseElementType type, String packageName);

}
@@ -947,233 +947,992 @@
     
-RuleBase getRulebase();%0A%0A    void add(RuleBaseElementId name, String code) throws RuleBaseException;%0A%0A    String get(RuleBaseElementId name);%0A%0A    void update(RuleBaseElementId name, String newCode) throws RuleBaseException;%0A
+/**%0A     * provides a reference to the rulebase. This reference remains valid as%0A     * long as the bundle is active. the rulebase is modified %22on-the-fly%22.%0A     *%0A     * @return reference to the rulebase%0A     */%0A    RuleBase getRulebase();%0A%0A    /**%0A     *%0A     * adds a new element to the rulebase%0A     *%0A     * @throws RuleBaseException if adding the new element would cause the%0A     *         rulebase to be invalid (e.g. parse error).%0A     */%0A    void add(RuleBaseElementId name, String code) throws RuleBaseException;%0A%0A    String get(RuleBaseElementId name);%0A%0A    /**%0A     * updates an existing element%0A     *%0A     * @throws RuleBaseException if the update would cause the rulebase to be%0A     *         invalid (e.g. parse error).%0A     */%0A    void update(RuleBaseElementId name, String newCode) throws RuleBaseException;%0A%0A    /**%0A     *%0A     * @throws RuleBaseException if the deleting the element would cause the%0A     *         rulebase to be invalid (e.g. parse error).%0A     */
 %0A   

add some javadoc to rulemanager