Thank you!

How I can download a jar with model created in Guvnor? I have tried to build the package, also looked thru webdav interface - cannot find a jar for facts declared in drl.

Thanks!
-Oleg


On Tue, Jan 27, 2009 at 8:38 AM, <rules-dev-request@lists.jboss.org> wrote:
Send rules-dev mailing list submissions to
       rules-dev@lists.jboss.org

To subscribe or unsubscribe via the World Wide Web, visit
       https://lists.jboss.org/mailman/listinfo/rules-dev
or, via email, send a message with subject or body 'help' to
       rules-dev-request@lists.jboss.org

You can reach the person managing the list at
       rules-dev-owner@lists.jboss.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of rules-dev digest..."


Today's Topics:

  1. Re: [rules-users] Drools 5.0 M5 (ekkehard)
  2. Re: use of declared facts (Michal Bali)
  3. Re: use of declared facts (Edson Tirelli)
  4. Re: use of declared facts (Michal Bali)


----------------------------------------------------------------------

Message: 1
Date: Tue, 27 Jan 2009 08:03:01 +0100
From: ekkehard <ekkehard@gentz-software.de>
Subject: [rules-dev] Re: [rules-users] Drools 5.0 M5
To: Rules Users List <rules-users@lists.jboss.org>
Cc: Rules Dev List <rules-dev@lists.jboss.org>
Message-ID: <497EB1A5.1090905@gentz-software.de>
Content-Type: text/plain; charset="iso-8859-1"

Mark Proctor schrieb:
> http://blog.athico.com/2009/01/drools-50-m5-new-and-noteworthy-release.html
>
> http://www.jboss.org/drools/downloads.html
>
> The next release should be the candidate release, all modules now seem
> to be working, we are now just working on cleaning things up and
> improving and updating documentation.
>
> Mark
>
> _______________________________________________
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
Hi Mark,

Drools 5 seems to be a really great product. Maybe 18 months ago I
evaluated rules engines and business process engines and made my
decision to use jbpm together with Drools.

Now - in 3 weeks or so its time to really integrate processes and rules
into my application (ERP solution for small and medium-sized-companies)
- my server is ready (OSGI - EJB3) and my UI (Eclipse Riena based). Core
parts of the OSGI client-server app will be Open Source.

Last months I always noticed the problem for business people to
understand the differences between business processes and rules, because
from the point-of-view of business use-cases they are integrated. why
are there two tools / frameworks to manage the same thing ?

For me the main reason to use both was persistence of long running
processes and manual tasks in the past only available in business
process engine.

Now I read the documentation of Drools 5 and noticed that all is
availabe in ONE product: Drools 5. Thats really great news - I hope I
understood all well and I'll give it a try to do it with Drools only.
This gives me a better feeling than my previous decision.

Thanks for all your work.

ekke

--

ekkehard gentz
software-architect
homepage: http://www.gentz-software.de
opensource: http://ekkehard.org
blog (en): http://ekkes-corner.org
blog (de): http://ekkes-ecke.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20090127/64d6d492/attachment-0001.html

------------------------------

Message: 2
Date: Tue, 27 Jan 2009 09:34:55 +0000
From: Michal Bali <michalbali@gmail.com>
Subject: Re: [rules-dev] use of declared facts
To: Rules Dev List <rules-dev@lists.jboss.org>
Message-ID:
       <58f4ed90901270134s29ee99f2p5357152eae05f260@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Look at this unit test for some examples:
http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java

       // Retrieve the generated fact type
       FactType cheeseFact = ruleBase.getFactType(
"org.drools.generatedbeans.Cheese" );

       // Create a new Fact instance
       Object cheese = cheeseFact.newInstance();

       // Set a field value using the more verbose method chain...
       // should we add short cuts?
       //        cheeseFact.getField( "type" ).getFieldAccessor().setValue(
cheese,
       //
"stilton" );

       cheeseFact.set( cheese,
                       "type",
                       "stilton" );
       assertEquals( "stilton",
                     cheeseFact.get( cheese,
                                     "type" ) );


On Tue, Jan 27, 2009 at 2:02 AM, Oleg Zenzin <zenzin@intalio.com> wrote:

> There's now possibility to declare facts in the drl, like:
>
> declare Person
>  name: String
>  age: int
> end
>
> My question is how do I instantiate this fact object during runtime? Do I
> still need to have class Person compiled and existing somewhere in
> classpath, or there's a helper class which I can use "fake the fact",
> something like:
>
>   FakeFact person = FakeFact("Person");
>   person.setField("name", "Oleg");
>   person.setField("age", "42");
>   session.insert(person);
>
> Or there's another nicer way?
>
> Thank you,
> -Oleg Zenzin
>
> _______________________________________________
> rules-dev mailing list
> rules-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20090127/2b1899d6/attachment-0001.html

------------------------------

Message: 3
Date: Tue, 27 Jan 2009 09:31:32 -0500
From: Edson Tirelli <tirelli@post.com>
Subject: Re: [rules-dev] use of declared facts
To: Rules Dev List <rules-dev@lists.jboss.org>
Message-ID:
       <e6dd5ba30901270631j5c6fda5bje89a90f1fa1e3ebd@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

  Michal is correct from the point of view of the application. That is
required because the actual classes are generated at compile time and not
visible to the application classpath.

  Although, that is not the only way. Inside your rules, they are visible
and you instantiate them the same way as you instantiate any other java
Pojo:

rule xyz
when
    // sometihng
then
    Person p = new Person();
    p.setName( "Bob" );
    insert( p );
end

   Also, if you use Guvnor to define your model, Guvnor is capable of
generating a jar file for you with the generated classes. This way you can
download the jar and add it to the classpath of your application and use it
as any POJOs too.

   []s
   Edson


2009/1/27 Michal Bali <michalbali@gmail.com>

> Look at this unit test for some examples:
>
> http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java
>
>         // Retrieve the generated fact type
>         FactType cheeseFact = ruleBase.getFactType(
> "org.drools.generatedbeans.Cheese" );
>
>         // Create a new Fact instance
>         Object cheese = cheeseFact.newInstance();
>
>         // Set a field value using the more verbose method chain...
>         // should we add short cuts?
>         //        cheeseFact.getField( "type"
> ).getFieldAccessor().setValue( cheese,
>         //
> "stilton" );
>
>         cheeseFact.set( cheese,
>                         "type",
>                         "stilton" );
>         assertEquals( "stilton",
>                       cheeseFact.get( cheese,
>                                       "type" ) );
>
>
> On Tue, Jan 27, 2009 at 2:02 AM, Oleg Zenzin <zenzin@intalio.com> wrote:
>
>> There's now possibility to declare facts in the drl, like:
>>
>> declare Person
>>  name: String
>>  age: int
>> end
>>
>> My question is how do I instantiate this fact object during runtime? Do I
>> still need to have class Person compiled and existing somewhere in
>> classpath, or there's a helper class which I can use "fake the fact",
>> something like:
>>
>>   FakeFact person = FakeFact("Person");
>>   person.setField("name", "Oleg");
>>   person.setField("age", "42");
>>   session.insert(person);
>>
>> Or there's another nicer way?
>>
>> Thank you,
>> -Oleg Zenzin
>>
>> _______________________________________________
>> rules-dev mailing list
>> rules-dev@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-dev
>>
>>
>
> _______________________________________________
> rules-dev mailing list
> rules-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
>


--
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20090127/1f702615/attachment-0001.html

------------------------------

Message: 4
Date: Tue, 27 Jan 2009 15:38:47 +0000
From: Michal Bali <michalbali@gmail.com>
Subject: Re: [rules-dev] use of declared facts
To: Rules Dev List <rules-dev@lists.jboss.org>
Message-ID:
       <58f4ed90901270738i36997aa6t38e5b800c2180cd8@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Thanks Edson,
BTW, I've tried to instantiate an internal fact in a rule with MVEL dialect
but it didn't worked. I've tried this in M4. I' haven't tried it yet in M5.

Is this a known issue or should I create a new JIRA with test case?

Best Regards,
Michal


On Tue, Jan 27, 2009 at 2:31 PM, Edson Tirelli <tirelli@post.com> wrote:

>
>    Michal is correct from the point of view of the application. That is
> required because the actual classes are generated at compile time and not
> visible to the application classpath.
>
>    Although, that is not the only way. Inside your rules, they are visible
> and you instantiate them the same way as you instantiate any other java
> Pojo:
>
> rule xyz
> when
>      // sometihng
> then
>      Person p = new Person();
>      p.setName( "Bob" );
>      insert( p );
> end
>
>     Also, if you use Guvnor to define your model, Guvnor is capable of
> generating a jar file for you with the generated classes. This way you can
> download the jar and add it to the classpath of your application and use it
> as any POJOs too.
>
>     []s
>     Edson
>
>
> 2009/1/27 Michal Bali <michalbali@gmail.com>
>
> Look at this unit test for some examples:
>>
>> http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java
>>
>>         // Retrieve the generated fact type
>>         FactType cheeseFact = ruleBase.getFactType(
>> "org.drools.generatedbeans.Cheese" );
>>
>>         // Create a new Fact instance
>>         Object cheese = cheeseFact.newInstance();
>>
>>         // Set a field value using the more verbose method chain...
>>         // should we add short cuts?
>>         //        cheeseFact.getField( "type"
>> ).getFieldAccessor().setValue( cheese,
>>         //
>> "stilton" );
>>
>>         cheeseFact.set( cheese,
>>                         "type",
>>                         "stilton" );
>>         assertEquals( "stilton",
>>                       cheeseFact.get( cheese,
>>                                       "type" ) );
>>
>>
>> On Tue, Jan 27, 2009 at 2:02 AM, Oleg Zenzin <zenzin@intalio.com> wrote:
>>
>>> There's now possibility to declare facts in the drl, like:
>>>
>>> declare Person
>>>  name: String
>>>  age: int
>>> end
>>>
>>> My question is how do I instantiate this fact object during runtime? Do I
>>> still need to have class Person compiled and existing somewhere in
>>> classpath, or there's a helper class which I can use "fake the fact",
>>> something like:
>>>
>>>   FakeFact person = FakeFact("Person");
>>>   person.setField("name", "Oleg");
>>>   person.setField("age", "42");
>>>   session.insert(person);
>>>
>>> Or there's another nicer way?
>>>
>>> Thank you,
>>> -Oleg Zenzin
>>>
>>> _______________________________________________
>>> rules-dev mailing list
>>> rules-dev@lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/rules-dev
>>>
>>>
>>
>> _______________________________________________
>> rules-dev mailing list
>> rules-dev@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-dev
>>
>>
>
>
> --
>  Edson Tirelli
>  JBoss Drools Core Development
>  JBoss, a division of Red Hat @ www.jboss.com
>
> _______________________________________________
> rules-dev mailing list
> rules-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20090127/6abdfe4d/attachment.html

------------------------------

_______________________________________________
rules-dev mailing list
rules-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev


End of rules-dev Digest, Vol 25, Issue 19
*****************************************