<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>You could just create a Java POJO fact, containing a hashmap, and set that hashmap to be a reference to your Redis hash map. It ought to work as long as you don't intend to have any rules which depend on reacting to changes to values within the hashmap.</div><div><br></div><div>However, without a properly defined fact model, it's somewhat questionable whether you're going to get any real benefit from using Drools in the first place.</div><div><br></div><div>If you're just trying to avoid writing code for doing the marshalling, then I would recommend checking out Apache Commons BeanUtils. There is a populate() method which will copy values from a Map to a bean.</div><div><br></div><div><a href="http://commons.apache.org/proper/commons-beanutils//api/org/apache/commons/beanutils/BeanUtils.html#populate(java.lang.Object,%20java.util.Map)">http://commons.apache.org/proper/commons-beanutils//api/org/apache/commons/beanutils/BeanUtils.html#populate(java.lang.Object, java.util.Map)</a></div><div><br></div><div>Using that, you can have a well-defined fact model, and convert your Redis HashMap to it with minimal code.</div><div><br></div><div>Steve</div><div><br></div><div><br></div><br><div><div>On 4 Jun 2013, at 03:42, pprasad <<a href="mailto:pradeep_prasad@hotmail.com">pradeep_prasad@hotmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<div dir="ltr">Thanks for your prompt reply. I am working on a fraud system for a bank and they have around 3 millions records.<div><br></div><div>All my data is loaded to redis and I can access the key using jedis. How do I insert redis hashmap to fact in one go. I do not want to iterate for every key and insert fact individually.</div><div><br></div><div>Is there a way to get the instance of redis hashmap in java and insert that hashmap as a fact.<br><br><div> </div>
<div>Thanks and Regards</div>
<div>Pradeep Prasad</div><br><br><div><hr id="stopSpelling">Date: Sun, 2 Jun 2013 22:08:32 -0700<br>From: <a href="x-msg://82/user/SendEmail.jtp?type=node&node=4024102&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a><br>To: <a href="x-msg://82/user/SendEmail.jtp?type=node&node=4024102&i=1" target="_top" rel="nofollow" link="external">[hidden email]</a><br>Subject: Re: [rules-users] StatefulKnowledgeSession and multi-threaded processing<br><br>
        <div dir="ltr">You can do it as per my knowledge. Only thing is you will access in drl from java code. I dont think it will be an issue. but what the reason for sending hashmap as fact, You should have a different way of sending facts. As per my observation no rule needs so much of data to make a decision. It should have name value parameters to make the decision. <div>
<br></div><div>Hope this helps.</div><div><br></div><div>thanks</div><div>kamal.</div></div><div class="ecxgmail_extra"><br><br><div class="ecxgmail_quote">On Sun, Jun 2, 2013 at 9:59 PM, pprasad [via Drools] <span dir="ltr"><<a href="http:/user/SendEmail.jtp?type=node&node=4024076&i=0" rel="nofollow" target="_blank" link="external">[hidden email]</a>></span> wrote:<br>
<blockquote style="border-left:2px solid #CCCCCC;padding:0 1em" class="ecxgmail_quote">
        Hi,
<br><br>Is it possible to insert redis hashmap as it is as fact into rule engine. I am using Jedis from java to access jedis and drool rule engine.
<br>Also, Is there a way to access redis hashmap from drl file.
<br><br>Thanks,
<br>Pradeep
        
        
        
        <br>
        <br>
        <hr noshade="" size="1">
        <div style="color:#444;font:12px tahoma,geneva,helvetica,arial,sans-serif;">
                <div style="font-weight:bold;">If you reply to this email, your message will be added to the discussion below:</div>
                <a href="http://drools.46999.n3.nabble.com/StatefulKnowledgeSession-and-multi-threaded-processing-tp3599689p4024075.html" target="_blank" rel="nofollow" link="external">http://drools.46999.n3.nabble.com/StatefulKnowledgeSession-and-multi-threaded-processing-tp3599689p4024075.html</a>
        </div>
        <div style="color:#666;font:11px tahoma,geneva,helvetica,arial,sans-serif;line-height:1.5em;">
                
                To unsubscribe from StatefulKnowledgeSession and multi-threaded processing, <a href="http:/" target="_blank" rel="nofollow" link="external">click here</a>.<br>
                <a href="http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble:email.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble:email.naml-instant_emails%21nabble:email.naml-send_instant_email%21nabble:email.naml" rel="nofollow" style="font:9px serif;" target="_blank" link="external">NAML</a>
        </div></blockquote></div><br></div>
        
        
        
        <br>
        <br>
        <hr noshade="noshade" size="1">
        <div style="color:#444;font:12px tahoma,geneva,helvetica,arial,sans-serif;">
                <div style="font-weight:bold;">If you reply to this email, your message will be added to the discussion below:</div>
                <a href="http://drools.46999.n3.nabble.com/StatefulKnowledgeSession-and-multi-threaded-processing-tp3599689p4024076.html" target="_blank" rel="nofollow" link="external">http://drools.46999.n3.nabble.com/StatefulKnowledgeSession-and-multi-threaded-processing-tp3599689p4024076.html</a>
        </div>
        <div style="color:#666;font:11px tahoma,geneva,helvetica,arial,sans-serif;line-height:1.5em;">
                
                To unsubscribe from StatefulKnowledgeSession and multi-threaded processing, <a href="x-msg://82/" target="_blank" rel="nofollow" link="external">click here</a>.<br>
                <a href="http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble:email.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble:email.naml-instant_emails%21nabble:email.naml-send_instant_email%21nabble:email.naml" rel="nofollow" style="font:9px serif;" target="_blank" link="external">NAML</a>
        </div></div></div>                                            </div>
        
        
        
<br><hr align="left" width="300">
View this message in context: <a href="http://drools.46999.n3.nabble.com/StatefulKnowledgeSession-and-multi-threaded-processing-tp3599689p4024102.html">RE: [rules-users] StatefulKnowledgeSession and multi-threaded processing</a><br>
Sent from the <a href="http://drools.46999.n3.nabble.com/Drools-User-forum-f47000.html">Drools: User forum mailing list archive</a> at <a href="http://Nabble.com">Nabble.com</a>.<br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/rules-users</blockquote></div><br></body></html>