Package org.drools.xml

Examples of org.drools.xml.XmlProcessReader


        RuleFlowProcess process = null;

        try {
            InputStreamReader reader = new InputStreamReader( is );
            PackageBuilderConfiguration configuration = new PackageBuilderConfiguration();
            XmlProcessReader xmlReader = new XmlProcessReader( configuration.getSemanticModules() );

            try {
                process = (RuleFlowProcess) xmlReader.read( reader );

            } catch ( Exception e ) {
                reader.close();
                throw new Exception( "Unable to read rule flow XML." );
            }
View Full Code Here


        }
    }

    public void addProcessFromFile(final Reader reader, final Resource resource) throws Exception {
        PackageBuilderConfiguration configuration = packageBuilder.getPackageBuilderConfiguration();
        XmlProcessReader xmlReader = new XmlProcessReader( configuration.getSemanticModules() );
       
        final ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
        final ClassLoader newLoader = this.getClass().getClassLoader();
        try {
            Thread.currentThread().setContextClassLoader( newLoader );
            String portRuleFlow = System.getProperty( "drools.ruleflow.port", "false" );
            Reader portedReader = null;
            if ( portRuleFlow.equalsIgnoreCase( "true" ) ) {
                portedReader = portToCurrentVersion( reader );
            } else {
                portedReader = reader;
            }
            Process process = xmlReader.read(portedReader);
            buildProcess( process, resource );
        } finally {
            Thread.currentThread().setContextClassLoader( oldLoader );
        }
        reader.close();
View Full Code Here

TOP

Related Classes of org.drools.xml.XmlProcessReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.