Quoting from the original post:
"Our customer want that we use drools to administrate some objects. The
objects should be administrated with guvnor. Every object has one id, name
and description."
Perhaps a case of mistaken terminology?
-W
2011/7/6 Michael Anstis <michael.anstis(a)gmail.com>
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(a)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(a)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...
>> Sent from the Drools: User forum mailing list archive at
Nabble.com.
>> _______________________________________________
>> rules-users mailing list
>> rules-users(a)lists.jboss.org
>>
https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/rules-users
>
>
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users