Package org.drools.eclipse

Examples of org.drools.eclipse.DRLInfo


                ClassLoader newLoader = DroolsBuilder.class.getClassLoader();
                if ( resource.getProject().getNature( "org.eclipse.jdt.core.javanature" ) != null ) {
                    IJavaProject project = JavaCore.create( resource.getProject() );
                    newLoader = ProjectClassLoader.getProjectClassLoader( project );
                }
                DRLInfo drlInfo = DroolsEclipsePlugin.getDefault().parseResource(drlEditor, true, true);
                if (drlInfo == null) {
                    throw new Exception( "Could not find DRL info" );
                }
                if (drlInfo.getBuilderErrors().length > 0) {
                    throw new Exception( drlInfo.getBuilderErrors().length + " build errors" );
                }
                if (drlInfo.getParserErrors().size() > 0) {
                    throw new Exception( drlInfo.getParserErrors().size() + " parser errors" );
                }

                Package pkg = drlInfo.getPackage();
                RuleBaseConfiguration config = new RuleBaseConfiguration();
                config.setClassLoader(newLoader);
                ruleBase = (ReteooRuleBase) RuleBaseFactory.newRuleBase(RuleBase.RETEOO, config);
                if (pkg != null) {
                    ruleBase.addPackage(pkg);
View Full Code Here


    }
   
    private DroolsBuildMarker[] parseDRLFile(IFile file, String content) {
        List markers = new ArrayList();
        try {
            DRLInfo drlInfo =
                DroolsEclipsePlugin.getDefault().parseResource(file, true);
            //parser errors
            markParseErrors(markers, drlInfo.getParserErrors());
            markOtherErrors(markers, drlInfo.getBuilderErrors());
        } catch (DroolsParserException e) {
            // we have an error thrown from DrlParser
            Throwable cause = e.getCause();
            if (cause instanceof RecognitionException ) {
                RecognitionException recogErr = (RecognitionException) cause;
View Full Code Here

    private DroolsBuildMarker[] parseXLSFile(IFile file) {
        List markers = new ArrayList();
        try {
            SpreadsheetCompiler converter = new SpreadsheetCompiler();
            String drl = converter.compile(file.getContents(), InputType.XLS);
            DRLInfo drlInfo =
                DroolsEclipsePlugin.getDefault().parseXLSResource(drl, file);
            // parser errors
            markParseErrors(markers, drlInfo.getParserErrors());
            markOtherErrors(markers, drlInfo.getBuilderErrors());
        } catch (DroolsParserException e) {
            // we have an error thrown from DrlParser
            Throwable cause = e.getCause();
            if (cause instanceof RecognitionException ) {
                RecognitionException recogErr = (RecognitionException) cause;
View Full Code Here

    private DroolsBuildMarker[] parseCSVFile(IFile file) {
        List markers = new ArrayList();
        try {
            SpreadsheetCompiler converter = new SpreadsheetCompiler();
            String drl = converter.compile(file.getContents(), InputType.CSV);
            DRLInfo drlInfo =
                DroolsEclipsePlugin.getDefault().parseXLSResource(drl, file);
            // parser errors
            markParseErrors(markers, drlInfo.getParserErrors());
            markOtherErrors(markers, drlInfo.getBuilderErrors());
        } catch (DroolsParserException e) {
            // we have an error thrown from DrlParser
            Throwable cause = e.getCause();
            if (cause instanceof RecognitionException ) {
                RecognitionException recogErr = (RecognitionException) cause;
View Full Code Here

            RuleModel model = BRXMLPersistence.getInstance().unmarshal(brl);
            String drl = BRDRLPersistence.getInstance().marshal(model);

            // TODO pass this through DSL converter in case brl is based on dsl

            DRLInfo drlInfo =
                DroolsEclipsePlugin.getDefault().parseBRLResource(drl, file);
            // parser errors
            markParseErrors(markers, drlInfo.getParserErrors());
            markOtherErrors(markers, drlInfo.getBuilderErrors());
        } catch (DroolsParserException e) {
            // we have an error thrown from DrlParser
            Throwable cause = e.getCause();
            if (cause instanceof RecognitionException ) {
                RecognitionException recogErr = (RecognitionException) cause;
View Full Code Here

            TypeSafeGuidedDecisionTable dt = GuidedDTXMLPersistence.getInstance().unmarshal(gdst);
            String drl = GuidedDTDRLPersistence.getInstance().marshal(dt);

            // TODO pass this through DSL converter in case brl is based on dsl

            DRLInfo drlInfo =
                DroolsEclipsePlugin.getDefault().parseGDSTResource(drl, file);
            // parser errors
            markParseErrors(markers, drlInfo.getParserErrors());
            markOtherErrors(markers, drlInfo.getBuilderErrors());
        } catch (DroolsParserException e) {
            // we have an error thrown from DrlParser
            Throwable cause = e.getCause();
            if (cause instanceof RecognitionException ) {
                RecognitionException recogErr = (RecognitionException) cause;
View Full Code Here

TOP

Related Classes of org.drools.eclipse.DRLInfo

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.