[rules-users] [guvnor] How to use a rule in a java application
Mario Viertel
Mario.Viertel at medav.de
Wed Apr 20 11:22:32 EDT 2011
Hi Mike,
thanks for the information. No, I didn't know the Expert documentation.
Regards,
Mario
Am 20.04.2011 14:09, schrieb Michael Anstis:
> Hi,
>
> Guvnor is an authoring and repository environment not a runtime environment.
>
> Please read about KnowledgeBuilder and its related "addResource" methods
> together with the ResourceType.PKG. You can also look at using
> KnowledgeAgent but for now an understanding of KnowledgeBuilder will
> suffice. I also recommend you read about rule invocation, as your example of
> how you expect operation "rules.execute" suggests you have not read the
> "Expert" documentation.
>
> With kind regards,
>
> Mike
>
> On 20 April 2011 12:39, Mario Viertel<Mario.Viertel at medav.de> wrote:
>
>> Hi all,
>>
>> I am new in Guvnor and have a lot of questions.
>> I have created a decision table with the Guvnor web app. I have also
>> created some test. All seems to be fine.
>>
>> Now I want to use the rules in a web application. Unfortunately Guvnor
>> doesn't provide a web service interface so I must develop an own web
>> service to deal with the rules. But thats not so easy ...
>>
>> In the Guvnor documentation I can see how to create KnowledgeBases and
>> builders and how to fire rules. But I cannot see how to receive rule
>> results.
>>
>> Example:
>>
>> The decision table looks similar like this:
>>
>> rule 1 "under age"
>> if person.age< 18 then "under age"
>>
>> rule 2 "pensioner female"
>> if person.age> 64 and person.gender == "female" then "pensioner"
>>
>> rule 3 "pensioner male"
>> if person.age> 67 and person.gender == "male" then "pensioner"
>>
>> rule 4 "full age"
>> * then "full age"
>>
>>
>> In my java application I create a person object:
>>
>> Person p = new Person();
>> p.setBirthday(...);
>> p.setGender(...);
>>
>> Now I miss a method in the Guvnor api to exectute the rules and receive
>> the result like this:
>>
>> Person result = (Person) rules.execute(p);
>>
>> Can somebody explain how to execute a rule and receive the result.
>>
>> Thanks in Advance
>> Mario Viertel
>> Germany
>> _______________________________________________
>> 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
--
Mit freundlichen Gruessen
Mario Viertel
RMS - Radio Monitoring and Surveillance Solutions
BIS - Business and Intelligence Solutions
Tel: +49 9131 583 510
Fax: +49 9131 583 11
Mail: mario.viertel at medav.de
Skype: mavi-medav
Betriebsstaette Ilmenau
Homburger Platz 3
98693 Ilmenau
_____________________________________________________
MEDAV GmbH
Graefenberger Str. 32-34
D-91080 Uttenreuth
Geschaeftsfuehrer Dr.-Ing. Hans-Joachim Kolb
Handelsregister Fuerth HRB 2311
Bankverbindung
Stadt- und Kreissparkasse Erlangen
BLZ 763 500 00, KtNr. 10 - 000 344
Internet http://www.medav.de
Angaben gemaess EHUG vom 10.11.2006
More information about the rules-users
mailing list