[rules-users] Inserting a JRuby object via Spring JRubyScriptFactory in Drools

Premkumar Stephen prem18 at gmail.com
Fri Mar 20 10:58:11 EDT 2009


Thanks Mike for your comments. I did look at JBoss Rails and it was very
interesting.
Out here, we have a core Ruby application that cannot be ported (easily
enough) to JRuby. We are planning to introduce a rule engine into the mix.
The idea possibly is to inject the ruby object from the master application
via a queue (Stomp?). Another JRuby app (which encapsulates Drools), would
pick up the ruby object, use the Spring scaffolding as discussed in this
thread to present to the rule engine as a java object.
At the end of rule invocation, the JRuby app would post the object back to
the queue to return to the master application.

We could possibly use JBoss Rails for the JRuby app that we would have to
build.

Regards,
Prem


2009/3/20 Anstis, Michael (M.) <manstis1 at ford.com>

>  I read that JBoss AS supports JRuby classes running in the JVM...
>
>
> http://oddthesis.org/posts/2009-03-jboss-rails-1-0-0-beta4-in-time-for-the-weekend
>
> Whilst I haven't used it nor read about it in detail perhaps this is
> something that might be of interest.
>
> With kind regards,
>
> Mike
>
>  ------------------------------
> *From:* rules-users-bounces at lists.jboss.org [mailto:
> rules-users-bounces at lists.jboss.org] *On Behalf Of *Edson Tirelli
> *Sent:* 19 March 2009 16:06
> *To:* Rules Users List
> *Subject:* Re: [rules-users] Inserting a JRuby object via Spring
> JRubyScriptFactory in Drools
>
>
>    Drools always looks for getters/setters, never for the actual internal
> attribute.
>
>    As long as you have an instance of a given interface and your rules are
> written against the interface you should be fine in Drools 5.
>
>    Drools 4 used shadow facts, so, there would be more considerations to
> make on drools 4.
>
>    []s
>    Edson
>
> 2009/3/19 Premkumar Stephen <prem18 at gmail.com>
>
>> Hello Folks,
>> I have been looking at options of using ruby objects as fact objects in
>> Drool's working memory.
>>
>> One obvious way is using services.
>>
>> Another path that I have been researching about is to use Spring as
>> outlined here http://www.jroller.com/habuma/entry/spring_meet_ruby
>>
>> Now, in this example, if the Lime ruby object were like a POJO, (contains
>> fields), will I be able to insert this object into the workingMemory?  My
>> Lime interface would have getters and setters. Will the engine look for the
>> fields themselves in an object or can it work with just getters and setters
>> ( as would be declared in the Lime.java interface and defined in the Lime.rb
>> ruby class?
>>
>> Are there any drawbacks in doing it this way?
>>
>> Any comments/pointers will be appreciated.
>>
>> Thanks!!
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>
>
> --
>  Edson Tirelli
>  JBoss Drools Core Development
>  JBoss, a division of Red Hat @ www.jboss.com
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090320/0739da63/attachment.html 


More information about the rules-users mailing list