No problem.
 
I'd suggest you look into KnowledgeBase's newStatefulKnowledgeSession or
newStatelessKnowledgeSession (depending upon your use-case).
 
Once you have these you can insert your POJO (Fact) objects and receive
the appropriate results (Actions).
 
I get the feeling you have not read the excellent documentation; this
would definitely assist you.
 
With kind regards,
 
Mike


________________________________

        From: [email protected]
[mailto:[email protected]] On Behalf Of Sanjib Karmakar
        Sent: 30 June 2010 13:39
        To: Rules Dev List
        Cc: Rules Dev List; [email protected]
        Subject: Re: [rules-dev] Request help for source code of
accessing excel file using Drools 5.0
        
        

        Hi Michael 
        
        Thanks you very much for your quick reply. 
        I am sorry I could not understand the proper classification of
the forum. 
        I have already sent the request to the drools-user forum. 
        
        In fact what I wanted to mean that - 
        I am using the 'TeamAllocationExample.xls' - which is the
default example I found searching in net. 
        Here LHS and RHS portions are given - I would like to know how
could I execute the rule and get the result what is given under 'ACTION'
column? 
        
        A code snippet could help me to go forward. 
        
        Thanks again for your time and cooperation. 
        
        Regards
        Sanjib Karmakar
        SkyTech Solutions Pvt. Ltd 
        
        
        
"Anstis, Michael (M.)" <[email protected]> 
Sent by: [email protected] 

06/30/2010 04:35 PM 
Please respond to
Rules Dev List <[email protected]>


To
"Rules Dev List" <[email protected]> 
cc
Subject
Re: [rules-dev] Request help for source code of accessing excel
file using Drools 5.0

        




        Firstly, this would be best targeted at the drools-user forum,
as the
        dev mailing list is the preserve of drools development itself.
        
        Secondly, can you advise why you need to access the rules rather
than
        the results inferred by the rules themselves when operating on
facts?
        
        Once you have your KnowledgeBase you can retireve Rule objects
using the
        API, however they appear to have limited use.
        
        Can you explain your use-case more?
        
        -----Original Message-----
        From: [email protected]
        [mailto:[email protected]] On Behalf Of Sanjib
Karmakar
        Sent: 30 June 2010 09:04
        To: [email protected]
        Subject: [rules-dev] Request help for source code of accessing
excel
        file using Drools 5.0
        
        
        Hi 
        
        I am new in drools and in my project I would like to access
rules in
        excel
        file using drools 5.0
        Please provide me the source code for how to access the rules in
excel
        file.
        
        I have done the following code
        
        KnowledgeBuilder kBuilder =
        KnowledgeBuilderFactory.newKnowledgeBuilder(); 
        DecisionTableConfiguration dtconf =
        KnowledgeBuilderFactory.newDecisionTableConfiguration(); 
        dtconf.setInputType( DecisionTableInputType.XLS ); 
        dtconf.setWorksheetName("Tables"); 
        
kBuilder.add(ResourceFactory.newFileResource("TeamAllocationExample.xls"
        ),
        ResourceType.DTABLE, dtconf);
                                         
        KnowledgeBuilderErrors errors = kBuilder.getErrors();
        if (errors.size() > 0) 
         {
           for (KnowledgeBuilderError error: errors) {
           System.out.println(error);
         }
         throw new IllegalArgumentException("Could not parse
knowledge.");
        }
        
        KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
        kbase.addKnowledgePackages(kBuilder.getKnowledgePackages());
        return kbase; 
        
        How could I use the POJO for accessing the rule?
        
        Please help me.
        
        Thanks in advance
        Sanjib
        
        -- 
        View this message in context:
        
http://drools-java-rules-engine.46999.n3.nabble.com/Request-help-for-sou
        
rce-code-of-accessing-excel-file-using-Drools-5-0-tp932651p932651.html
        Sent from the Drools - Dev mailing list archive at Nabble.com.
        _______________________________________________
        rules-dev mailing list
        [email protected]
        https://lists.jboss.org/mailman/listinfo/rules-dev
        
        _______________________________________________
        rules-dev mailing list
        [email protected]
        https://lists.jboss.org/mailman/listinfo/rules-dev
        
        

_______________________________________________
rules-dev mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-dev

Reply via email to