Package org.drools.builder

Examples of org.drools.builder.DecisionTableConfiguration


            } else if ( ResourceType.DRF.equals( type )) {
                ((InternalResource) resource).setResourceType( type );
                addProcessFromXml( resource );
            } else if ( ResourceType.DTABLE.equals( type )) {
                ((InternalResource) resource).setResourceType( type );
                DecisionTableConfiguration dtableConfiguration = (DecisionTableConfiguration) configuration;

                String string = DecisionTableFactory.loadFromInputStream( resource.getInputStream(),
                                                                          dtableConfiguration );
                addPackageFromDrl( new StringReader( string ) );
            } else if ( ResourceType.PKG.equals( type )) {
View Full Code Here


       
        this.resource = resource;
        PackageDescr pkg = null;
        boolean hasErrors = false;

        DecisionTableConfiguration dtableConfiguration = (DecisionTableConfiguration) configuration;
        String string = DecisionTableFactory.loadFromInputStream( resource.getInputStream(),
                                                                  dtableConfiguration );
       
        final DrlParser parser = new DrlParser();
        pkg = parser.parse( new StringReader( string ) );
View Full Code Here

                ((InternalResource) resource).setResourceType( type );
                BPMN2ProcessFactory.configurePackageBuilder( this );
                addProcessFromXml( resource );
            } else if ( ResourceType.DTABLE.equals( type ) ) {
                ((InternalResource) resource).setResourceType( type );
                DecisionTableConfiguration dtableConfiguration = (DecisionTableConfiguration) configuration;

                String string = DecisionTableFactory.loadFromInputStream( resource.getInputStream(),
                                                                          dtableConfiguration );
                addPackageFromDrl( new StringReader( string ) );
            } else if ( ResourceType.PKG.equals( type ) ) {
View Full Code Here

        addPackage( decisionTableToPackageDescr(resource, configuration) );
        this.resource = null;
    }

    PackageDescr decisionTableToPackageDescr(Resource resource, ResourceConfiguration configuration) throws DroolsParserException, IOException {
        DecisionTableConfiguration dtableConfiguration = (DecisionTableConfiguration) configuration;
        String string = DecisionTableFactory.loadFromInputStream( resource.getInputStream(), dtableConfiguration );

        DrlParser parser = new DrlParser();
        PackageDescr pkg = parser.parse( new StringReader( string ) );
        this.results.addAll( parser.getErrors() );
View Full Code Here

                ((InternalResource) resource).setResourceType( type );
                BPMN2ProcessFactory.configurePackageBuilder( this );
                addProcessFromXml( resource );
            } else if ( ResourceType.DTABLE.equals( type ) ) {
                ((InternalResource) resource).setResourceType( type );
                DecisionTableConfiguration dtableConfiguration = (DecisionTableConfiguration) configuration;

                String string = DecisionTableFactory.loadFromInputStream( resource.getInputStream(),
                                                                          dtableConfiguration );
                addPackageFromDrl( new StringReader( string ) );
            } else if ( ResourceType.PKG.equals( type ) ) {
View Full Code Here

       
        this.resource = resource;
        PackageDescr pkg;
        boolean hasErrors = false;

        DecisionTableConfiguration dtableConfiguration = (DecisionTableConfiguration) configuration;
        String string = DecisionTableFactory.loadFromInputStream( resource.getInputStream(),
                                                                  dtableConfiguration );
       
        final DrlParser parser = new DrlParser();
        pkg = parser.parse( new StringReader( string ) );
View Full Code Here

    }

    public int executeExample() throws Exception {
        KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();

        DecisionTableConfiguration dtconf = KnowledgeBuilderFactory.newDecisionTableConfiguration();
        dtconf.setInputType( DecisionTableInputType.XLS );

        kbuilder.add( ResourceFactory.newClassPathResource( "/data/ExamplePolicyPricing.xls", getClass() ),
                              ResourceType.DTABLE,
                              dtconf );
View Full Code Here

public class SpreadsheetIntegrationTest extends TestCase {

    public void testExecute() throws Exception {
        KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();

        DecisionTableConfiguration dtconf = KnowledgeBuilderFactory.newDecisionTableConfiguration();
        dtconf.setInputType( DecisionTableInputType.XLS );

        kbuilder.add( ResourceFactory.newClassPathResource( "/data/IntegrationExampleTest.xls", getClass() ),
                              ResourceType.DTABLE,
                              dtconf );
View Full Code Here

    }

    public void testNamedWorksheet() throws Exception {
        KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();

        DecisionTableConfiguration dtconf = KnowledgeBuilderFactory.newDecisionTableConfiguration();
        dtconf.setInputType( DecisionTableInputType.XLS );
        dtconf.setWorksheetName( "Tables_2" );

        kbuilder.add( ResourceFactory.newClassPathResource( "/data/IntegrationExampleTest.xls", getClass() ),
                              ResourceType.DTABLE,
                              dtconf );
View Full Code Here

        } else if (fileName.endsWith(DroolsCompilerAntTask.XMLFILEEXTENSION)) {
            kbuilder.add(ResourceFactory.newReaderResource(fileReader),
                    ResourceType.XDRL);
        } else if (fileName.endsWith(DroolsCompilerAntTask.XLSFILEEXTENSION)) {

            DecisionTableConfiguration dtableconfiguration = KnowledgeBuilderFactory
                    .newDecisionTableConfiguration();
            dtableconfiguration.setInputType(DecisionTableInputType.XLS);

            kbuilder.add(ResourceFactory.newReaderResource(fileReader),
                    ResourceType.DTABLE, dtableconfiguration);

            // } else if
View Full Code Here

TOP

Related Classes of org.drools.builder.DecisionTableConfiguration

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.