Package org.drools.xml

Examples of org.drools.xml.XmlProcessReader


        }
    }

    public void addProcessFromFile(final Reader reader, final String url) 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, url );
        } finally {
            Thread.currentThread().setContextClassLoader( oldLoader );
        }
        reader.close();
View Full Code Here


        }
       
        System.out.println(xml);
        System.out.println("-------------------");
       
        XmlProcessReader reader = new XmlProcessReader(
            new PackageBuilderConfiguration().getSemanticModules());
        process = (RuleFlowProcess) reader.read(new StringReader(xml));
        if (process == null) {
            throw new IllegalArgumentException("Failed to reload process!");
        }
       
        assertEquals(15, process.getNodes().length);
View Full Code Here

            throw new IllegalArgumentException("Failed to persist full nodes!");
        }
       
        System.out.println(xml);
       
        XmlProcessReader reader = new XmlProcessReader(
            new PackageBuilderConfiguration().getSemanticModules());
        process = (RuleFlowProcess) reader.read(new StringReader(xml));
        if (process == null) {
            throw new IllegalArgumentException("Failed to reload process!");
        }
       
        assertEquals(15, process.getNodes().length);
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);
            if ( process != null ) {
                // it is possible an xml file could not be parsed, so we need to stop null pointers
                buildProcess( process, resource );
            } else {
                // @TODO could we maybe add something a bit more informative about what is wrong with the 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);
            if ( process != null ) {
                // it is possible an xml file could not be parsed, so we need to stop null pointers
                buildProcess( process, resource );
            } else {
                // @TODO could we maybe add something a bit more informative about what is wrong with the 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);
            if ( process != null ) {
                // it is possible an xml file could not be parsed, so we need to stop null pointers
                buildProcess( process, resource );
            } else {
                // @TODO could we maybe add something a bit more informative about what is wrong with the XML ?
View Full Code Here

        }
       
        System.out.println(xml);
        System.out.println("-------------------");
       
        XmlProcessReader reader = new XmlProcessReader(
            new PackageBuilderConfiguration().getSemanticModules());
        process = (RuleFlowProcess) reader.read(new StringReader(xml));
        if (process == null) {
            throw new IllegalArgumentException("Failed to reload process!");
        }
       
        assertEquals(15, process.getNodes().length);
View Full Code Here

            throw new IllegalArgumentException("Failed to persist full nodes!");
        }
       
        System.out.println(xml);
       
        XmlProcessReader reader = new XmlProcessReader(
            new PackageBuilderConfiguration().getSemanticModules());
        process = (RuleFlowProcess) reader.read(new StringReader(xml));
        if (process == null) {
            throw new IllegalArgumentException("Failed to reload process!");
        }
       
        assertEquals(15, process.getNodes().length);
View Full Code Here

        }
       
        System.out.println(xml);
        System.out.println("-------------------");
       
        XmlProcessReader reader = new XmlProcessReader(
            new PackageBuilderConfiguration().getSemanticModules());
        process = (RuleFlowProcess) reader.read(new StringReader(xml));
        if (process == null) {
            throw new IllegalArgumentException("Failed to reload process!");
        }
       
        assertEquals(15, process.getNodes().length);
View Full Code Here

            throw new IllegalArgumentException("Failed to persist full nodes!");
        }
       
        System.out.println(xml);
       
        XmlProcessReader reader = new XmlProcessReader(
            new PackageBuilderConfiguration().getSemanticModules());
        process = (RuleFlowProcess) reader.read(new StringReader(xml));
        if (process == null) {
            throw new IllegalArgumentException("Failed to reload process!");
        }
       
        assertEquals(15, process.getNodes().length);
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.