[rules-users] Drools - Guvnor problem

Michael Anstis michael.anstis at gmail.com
Wed Jul 6 07:28:53 EDT 2011


Guvnor provides for the means to author rules, not consume them.

There's no capabilities to insert your objects (other than when writing test
scenarios for your rules). This would be the realm of KnowledgeSessions and
*your* application.

If however you want your application (you do state "...in our web frontend")
to be able to retrieve either a list of objects or a single one depending on
whether the ID is provided then:-

(a) I'd have thought you could simply achieve this without using a Rule
Engine

(b) If you want to use a rule engine then: insert all YourObjects into
Working Memory and use Drools Queries to achieve your need with queries a
bit like these:-

query "all objects"
    $l : ArrayList( ) from collect( YourObject( ) )
end

query "an objects" (int $id )
    $l : YourObject( id == $id )
end

Have I missed your point?

2011/7/6 Wolfgang Laun <wolfgang.laun at gmail.com>

> I suspected something like that, but *matching *facts of type System from
> Working Memory and *inserting *recreated facts of the same type isn't
> going to get them nearer to the GUI?
>
> -W
>
>
>
> On 6 July 2011 13:10, _bart <dgrundler at doubleslash.de> wrote:
>
>> Ok I will describe it again:
>>
>> We want to administrate some objects in guvnor. Every object has one id,
>> one
>> name and one description. We have round about 100 objects.
>>
>> One use case is, that all objects (id, name and description) should be
>> displayed in a drop down box in our web frontend.
>> The next use case is, that it has to be possible to load one object (id,
>> name, decription) by id.
>>
>> My solution in pseudo code for the rule is:
>>
>> IF id IS SET search object and return it or return null if not exist.
>> IF ID IS NOT SET return all objects.
>>
>> So I need a rule for these requirements. The rule above returns the object
>> specified by id correctly (the id will be set with id $system.getId()).
>> Also the rule above returns all objects from the data table. But the id is
>> missing in every object.
>>
>> I hope it is clear now.
>> Maybe my approach is wrong?
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://drools.46999.n3.nabble.com/Drools-Guvnor-problem-tp3142574p3144308.html
>> Sent from the Drools: User forum mailing list archive at Nabble.com.
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
>
> _______________________________________________
> 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/20110706/6cd02369/attachment.html 


More information about the rules-users mailing list