Package org.drools.compiler.lang.dsl

Examples of org.drools.compiler.lang.dsl.DefaultExpander.expand()


        try {
            if (expander == null) {
                expander = new DefaultExpander();
            }
            reader = resource.getReader();
            String str = expander.expand(reader);
            if (expander.hasErrors()) {
                for (ExpanderException error : expander.getErrors()) {
                    error.setResource(resource);
                    addBuilderResult(error);
                }
View Full Code Here


        try {
            if (expander == null) {
                expander = new DefaultExpander();
            }
            reader = resource.getReader();
            String str = expander.expand(reader);
            if (expander.hasErrors()) {
                for (ExpanderException error : expander.getErrors()) {
                    error.setResource(resource);
                    this.results.add(error);
                }
View Full Code Here

        try {
            if ( expander == null ) {
                expander = new DefaultExpander();
            }
            reader = resource.getReader();
            String str = expander.expand( reader );
            if ( expander.hasErrors() ) {
                for (ExpanderException error : expander.getErrors()) {
                    error.setResource( resource );
                    this.results.add( error );
                }
View Full Code Here

                }
                DSLMappingFile mapping = new DSLTokenizedMappingFile();
                mapping.parseAndLoad(reader);
                reader.close();
                expander.addDSLMapping(mapping.getMapping());
                expander.expand(content);
                // if translation succeeds, change to drl viewer
                drlRuleViewer.setInput(getEditorInput());
                drlRuleViewer.setSelectedRange(selection);
            } catch (Throwable t) {
                t.printStackTrace();
View Full Code Here

        try {
            if (expander == null) {
                expander = new DefaultExpander();
            }
            reader = resource.getReader();
            String str = expander.expand(reader);
            if (expander.hasErrors()) {
                for (ExpanderException error : expander.getErrors()) {
                    error.setResource(resource);
                    addBuilderResult(error);
                }
View Full Code Here

        try {
            if ( expander == null ) {
                expander = new DefaultExpander();
            }
            reader = resource.getReader();
            String str = expander.expand( reader );
            if ( expander.hasErrors() ) {
                this.results.addAll( expander.getErrors() );
            }

            pkg = parser.parse( str );
View Full Code Here

        DefaultExpander ex = new DefaultExpander();
        ex.addDSLMapping( file.getMapping() );
        String source = "rule 'q'" + NL + "agenda-group 'x'" + NL + "when" + NL + "    __  " + NL +
                "then" + NL + "    bar 42" + NL + "\tgoober" + NL + "end";
        ex.expand( source );
        assertTrue( ex.hasErrors() );
        assertEquals( 2,
                      ex.getErrors().size() );
        ExpanderException err = (ExpanderException) ex.getErrors().get( 0 );
        assertEquals( 4,
View Full Code Here

        DefaultExpander ex = new DefaultExpander();
        ex.addDSLMapping( file.getMapping() );
        String source = "rule 'q'" + NL + "agenda-group 'x'" + NL + "when" + NL + "    __  " + NL +
                "then" + NL + "    bar 42" + NL + "\tgoober" + NL + "end";
        ex.expand( source );
        assertTrue( ex.hasErrors() );
        assertEquals( 2,
                      ex.getErrors().size() );
        ExpanderException err = (ExpanderException) ex.getErrors().get( 0 );
        assertEquals( 4,
View Full Code Here

        //                        "when\n"+
        //                            "When the credit rating is OK\n"+
        //                        "then\n"+
        //                        "end\n";

        String drl = ex.expand( source );

        String expected = "rule \"TestNewDslSetup\"\n" +
                          "dialect \"mvel\"\n" +
                          "when\n" +
                          "applicant:Applicant(credit==AA)\n" +
View Full Code Here

                file.getErrors().size() );

        DefaultExpander ex = new DefaultExpander();
        ex.addDSLMapping( file.getMapping() );

        String drl = ex.expand( source );
        assertFalse( ex.hasErrors() );

        assertEquals( expected, drl );
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.