<?xml version="1.0"?>
<ruleset xmlns="http://windup.jboss.org/schema/jboss-ruleset" id="Kie5To6Upgrade" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd">
    <metadata>
        <description>
             This ruleset provides help for migrating to a unified KIE (Knowledge Is Everything) API in the
             upgrade from version 5 to 6.
        </description>
        <dependencies>
            <addon id="org.jboss.windup.rules,windup-rules-javaee,2.4.0.Final" />
            <addon id="org.jboss.windup.rules,windup-rules-java,2.4.0.Final" />
        </dependencies>
        <sourceTechnology id="drools" versionRange="[5]" />
        <sourceTechnology id="jbpm" versionRange="[5]" />
        <targetTechnology id="drools" versionRange="[6,)" />
        <targetTechnology id="jbpm" versionRange="[6,)" />
        <tag>drools</tag>
        <tag>jbpm</tag>
    </metadata>

    <rules>
        <rule id="kie-api-01000">
            <when>
                <javaclass references="org.drools.KnowledgeBase">
                    <location>IMPORT</location>
                </javaclass>
            </when>
            <perform>
                <hint title="org.drools.KnowledgeBase is deprecated" effort="0">
                    <message>Replace with : org.kie.api.KieBase</message>
                    <quickfix name="knowledgebase" type="REPLACE">
                        <replacement>org.kie.api.KieBase</replacement>
                        <search>org.drools.KnowledgeBase</search>
                    </quickfix>
                </hint>
            </perform>
        </rule>
        <rule id="kie-api-01001">
            <when>
                <javaclass references="org.drools.event.AgendaEventListener">
                    <location>IMPORT</location>
                </javaclass>
            </when>
            <perform>
                <hint title="org.drools.event.AgendaEventListener is deprecated" effort="0">
                    <message>Replace with : org.kie.api.event.rule.AgendaEventListener</message>
                    <quickfix name="AgendaEventListener-qf1" type="REPLACE">
                        <replacement>org.kie.api.event.rule.AgendaEventListener</replacement>
                        <search>org.drools.event.AgendaEventListener</search>
                    </quickfix>
                </hint>
            </perform>
        </rule>
        <rule id="kie-api-01002">
            <when>
                <javaclass references="org.drools.event.rule.AgendaEventListener">
                    <location>IMPORT</location>
                </javaclass>
            </when>
            <perform>
                <hint title="AgendaEventListener is deprecated" effort="0">
                    <message>Replace with : org.kie.api.event.rule.AgendaEventListener</message>
                    <quickfix name="AgendaEventListener-qf2" type="REPLACE">
                        <replacement>org.kie.api.event.rule.AgendaEventListener</replacement>
                        <search>org.drools.event.rule.AgendaEventListener</search>
                    </quickfix>
                </hint>
            </perform>
        </rule>
        <rule id="kie-api-01003">
            <when>
                <javaclass references="org.drools.event.DefaultAgendaEventListener">
                    <location>IMPORT</location>
                </javaclass>
            </when>
            <perform>
                <hint title="org.drools.event.DefaultAgendaEventListener is deprecated" effort="0">
                    <message>Replace with : org.kie.drools.core.event.DefaultAgendaEventListener</message>
                    <quickfix name="DefaultAgendaEventListener-qf1" type="REPLACE">
                        <replacement>org.kie.drools.core.event.DefaultAgendaEventListener</replacement>
                        <search>org.drools.event.DefaultAgendaEventListener</search>
                    </quickfix>
                </hint>
            </perform>
        </rule>
        <rule id="kie-api-01004">
            <when>
                <javaclass references="org.drools.event.rule.DefaultAgendaEventListener">
                    <location>IMPORT</location>
                </javaclass>
            </when>
            <perform>
                <hint title="org.drools.event.rule.DefaultAgendaEventListener is deprecated" effort="0">
                    <message>Replace with : org.kie.api.event.rule.DefaultAgendaEventListener</message>
                    <quickfix name="DefaultAgendaEventListener-qf2" type="REPLACE">
                        <replacement>org.kie.api.event.rule.DefaultAgendaEventListener</replacement>
                        <search>org.drools.event.rule.DefaultAgendaEventListener</search>
                    </quickfix>
                </hint>
            </perform>
        </rule>
        <rule id="kie-api-01005">
            <when>
                <javaclass references="org.drools.event.process.ProcessEventListener">
                    <location>IMPORT</location>
                </javaclass>
            </when>
            <perform>
                <hint title="org.drools.event.process.ProcessEventListener is deprecated" effort="0">
                    <message>Replace with : org.kie.api.event.process.ProcessEventListener</message>
                    <quickfix name="ProcessEventListener-qf" type="REPLACE">
                        <replacement>org.kie.api.event.process.ProcessEventListener</replacement>
                        <search>org.drools.event.process.ProcessEventListener</search>
                    </quickfix>
                </hint>
            </perform>
        </rule>
        <rule id="kie-api-01006">
            <when>
                <javaclass references="org.drools.event.process.DefaultProcessEventListener">
                    <location>IMPORT</location>
                </javaclass>
            </when>
            <perform>
                <hint title="org.drools.event.process.DefaultProcessEventListener is deprecated" effort="0">
                    <message>Replace with : org.kie.api.event.process.DefaultProcessEventListener</message>
                    <quickfix name="DefaultProcessEventListener-qf" type="REPLACE">
                        <replacement>org.kie.api.event.process.DefaultProcessEventListener</replacement>
                        <search>org.drools.event.process.DefaultProcessEventListener</search>
                    </quickfix>
                </hint>
            </perform>
        </rule>
        <rule id="kie-api-01007">
            <when>
                <javaclass references="org.drools.logger.KnowledgeRuntimeLogger">
                    <location>IMPORT</location>
                </javaclass>
            </when>
            <perform>
                <hint title="org.drools.logger.KnowledgeRuntimeLogger is deprecated" effort="0">
                    <message>Replace with : org.kie.api.logger.KieRuntimeLogger</message>
                    <quickfix name="KnowledgeRuntimeLogger-qf" type="REPLACE">
                        <replacement>org.kie.api.logger.KieRuntimeLogger</replacement>
                        <search>org.drools.logger.KnowledgeRuntimeLogger</search>
                    </quickfix>
                </hint>
            </perform>
        </rule>
        <rule id="kie-api-01008">
            <when>
                <javaclass references="org.drools.logger.KnowledgeRuntimeLoggerFactory">
                    <location>IMPORT</location>
                </javaclass>
            </when>
            <perform>
                <hint title="org.drools.logger.KnowledgeRuntimeLoggerFactory is deprecated" effort="0">
                    <message>Replace with : org.kie.api.logger.KieLoggers</message>
                    <quickfix name="Kielogger" type="REPLACE">
                        <replacement>org.kie.api.logger.KieLoggers</replacement>
                        <search>org.drools.logger.KnowledgeRuntimeLoggerFactory</search>
                    </quickfix>
                </hint>
            </perform>
        </rule>
        <rule id="kie-api-01009">
            <when>
                <javaclass references="org.drools.runtime.StatefulKnowledgeSession">
                    <location>IMPORT</location>
                </javaclass>
            </when>
            <perform>
                <hint title="org.drools.runtime.StatefulKnowledgeSession is deprecated" effort="0">
                    <message>Replace with : org.kie.api.runtime.KieSession</message>
                    <quickfix name="StatefulKnowledgeSession-qf" type="REPLACE">
                        <replacement>org.kie.api.runtime.KieSession</replacement>
                        <search>org.drools.runtime.StatefulKnowledgeSession</search>
                    </quickfix>
                </hint>
            </perform>
        </rule>
        <rule id="kie-api-01010">
            <when>
                <javaclass references="org.drools.runtime.StatelessKnowledgeSession">
                    <location>IMPORT</location>
                </javaclass>
            </when>
            <perform>
                <hint title="org.drools.runtime.StatelessKnowledgeSession is deprecated" effort="0">
                    <message>Replace with : org.kie.api.runtime.KieSession</message>
                    <quickfix name="StatelessKnowledgeSession-qf" type="REPLACE">
                        <replacement>org.kie.api.runtime.KieSession</replacement>
                        <search>org.drools.runtime.StatelessKnowledgeSession</search>
                    </quickfix>
                </hint>
            </perform>
        </rule>
        <rule id="kie-api-01011">
            <when>
                <javaclass references="org.drools.builder.KnowledgeBuilderFactory">
                    <location>IMPORT</location>
                </javaclass>
            </when>
            <perform>
                <hint title="org.drools.builder.KnowledgeBuilderFactory is deprecated" effort="0">
                    <message>Replace with : org.kie.internal.builder.KnowledgeBuilderFactory</message>
                    <quickfix name="KnowledgeBuilderFactory-qf" type="REPLACE">
                        <replacement>org.kie.internal.builder.KnowledgeBuilderFactory</replacement>
                        <search>org.drools.builder.KnowledgeBuilderFactory</search>
                    </quickfix>
                </hint>
            </perform>
        </rule>
        <rule id="kie-api-01012">
            <when>
                <javaclass references="org.drools.io.ResourceFactory">
                    <location>IMPORT</location>
                </javaclass>
            </when>
            <perform>
                <hint title="org.drools.io.ResourceFactory is deprecated" effort="0">
                    <message>Replace with : org.kie.internal.io.ResourceFactory</message>
                    <quickfix name="ResourceFactory-qf" type="REPLACE">
                        <replacement>org.kie.internal.io.ResourceFactory</replacement>
                        <search>org.drools.io.ResourceFactory </search>
                    </quickfix>
                </hint>
            </perform>
        </rule>
        <rule id="kie-api-01013">
            <when>
                <javaclass references="org.drools.io.ResourceType">
                    <location>IMPORT</location>
                </javaclass>
            </when>
            <perform>
                <hint title="org.drools.io.ResourceType is deprecated" effort="0">
                    <message>Replace with : org.kie.internal.io.ResourceType</message>
                    <quickfix name="ResourceType-qf" type="REPLACE">
                        <replacement>org.kie.internal.io.ResourceType</replacement>
                        <search>org.drools.io.ResourceType</search>
                    </quickfix>
                </hint>
            </perform>
        </rule>
        <rule id="kie-api-01014">
            <when>
                <javaclass references="org.drools.runtime.Environment">
                    <location>IMPORT</location>
                </javaclass>
            </when>
            <perform>
                <hint title="org.drools.runtime.Environment is deprecated" effort="0">
                    <message>Replace with : org.kie.api.runtime.Environment</message>
                    <quickfix name="Environment-qf" type="REPLACE">
                        <replacement>org.kie.api.runtime.Environment</replacement>
                        <search>org.drools.runtime.Environment</search>
                    </quickfix>
                </hint>
            </perform>
        </rule>
        <rule id="kie-api-01015">
            <when>
                <javaclass references="org.drools.runtime.EnvironmentName">
                    <location>IMPORT</location>
                </javaclass>
            </when>
            <perform>
                <hint title="org.drools.runtime.EnvironmentName is deprecated" effort="0">
                    <message>Replace with : org.kie.api.runtime.EnvironmentName</message>
                    <quickfix name="EnvironmentName-qf" type="REPLACE">
                        <replacement>org.kie.api.runtime.EnvironmentName</replacement>
                        <search>org.drools.runtime.EnvironmentName</search>
                    </quickfix>
                </hint>
            </perform>
        </rule>
        <rule id="kie-api-01016">
            <when>
                <javaclass references="org.drools.runtime.KnowledgeSessionConfiguration">
                    <location>IMPORT</location>
                </javaclass>
            </when>
            <perform>
                <hint title="org.drools.runtime.KnowledgeSessionConfiguration is deprecated" effort="0">
                    <message>Replace with : org.kie.api.runtime.KieSessionConfiguration</message>
                    <quickfix name="KnowledgeSessionConfiguration-qf" type="REPLACE">
                        <replacement>org.kie.api.runtime.KieSessionConfiguration</replacement>
                        <search>org.drools.runtime.KnowledgeSessionConfiguration</search>
                    </quickfix>
                </hint>
            </perform>
        </rule>
    </rules>
</ruleset>
