How to use Drool Inference instead of SQL's
by JohnSood
Hi,
I am in process of development of an application that uses the DRools 4.0.7
and fires the rules based data returned by some SQL statements.
The problem is when we use SQL functions like MAX(), AVG(), SUM() etc. then
providing facts to the rule engine is easy and DIRECT as these functions
returns only one row generally.
The case when the user is firing the SQL queries without using SQL
functions, then more than one rows will be returned by the DB server, and in
this case how can we use the ReteOO used by Drools to provide the same
inference as provided by DB server using SQL function (like selecting max
value of a particular column from 'n' rows returned by DB server) ?
For example we want to get the most recent hit_date (a column in table
'table_1')
Case 1 :
SQL : select max(hit_date) from table_1
In this case the DB will return only one row and we can provide that row as
a fact to rule engine.
Case 2:
SQL : select hit_date from table_1
In this case 'n' numbers of rows will be returned, then how can we get the
max(hit_date) from all those rows using Drools from those n rows ?
Moreover the case is not fixed i.e. we are not limited to the use of MAX()
SQL function, this function may be of any type provided by SQL of any DB
Server.
Please respond.
Thanks,
John
--
View this message in context: http://www.nabble.com/How-to-use-Drool-Inference-instead-of-SQL%27s-tp227...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 8 months
build Drools packages
by Meny Kobel
Hi,
Could you please advice which is the best way to build Drools packages?
I need to read the rules from database and I have to build drools packages.
The content of the rules is very flexible :
1. I don't know the number of rules.
2. I don't know rule data: the type name, operation and value.
3. I do know the maximum number of types and operations the system support.
How should I build the packages:
Should I write component that will read the rules from database and will
transform it to drl file?
Any API I can use - Maybe BRMS API?
I'm a ware of "rule templates" but I need a better generic way...
Thanks,
Meny
15 years, 8 months
Guvnor and 'from' database
by Anu@work
I am trying to use drools to evaluate the following rule:
Given a telephone number, if the telephone number already exists in database
and has a balance > 0, set isAllowed = false.
Looking at forum posts I understand that this can be achieved using
hibernate and 'from' keyword. However, this is my current scenario - I
create a package snapshot for my rules in Guvnor and use the URL in Drools
execution server. Execution server runs only stateless sessions.
Where and how do I use hibernate named queries?
Thx,
Anu
--
View this message in context: http://www.nabble.com/Guvnor-and-%27from%27-database-tp22745198p22745198....
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 8 months
Drools Boot Camp (San Francisco June 2009 ) Now On
by Mark Proctor
http://blog.athico.com/2009/03/drools-boot-camp-san-francisco-june.html
(blog entry quoted below)
The Drools Boot Camp has the go ahead, a big thank you to Third Pillar
<http://thirdpillar.com/> for sponsoring the meeting room.
The Drools team meeting forms the basis of the week long event, but we
make it open to the public, free of charge, to participate as an
informal boot camp. You may attend as little or as much of the event as
you wish, there is no commitment, just please give us notification of
when you wish to attend as there are limited spaces ( mproctor at redhat
d0t com ).
We will provide some dedicated seminars, including a Drools 5.0 primar
on the first day for those that want to know what's new in Drools 5.0.
Location
The location is San Francisco, during the JavaOne period, at the Hilton
Hotel (750 Kearny Street)
<http://www1.hilton.com/en_US/hi/hotel/SFOFDHF-Hilton-San-Francisco-Financ...>.
Expedia have rooms from $103 per night, at the booking time for my team
and I.
<http://4.bp.blogspot.com/_Jrhwx8X9P7g/Sc7rltSh6yI/AAAAAAAAATk/JIDberPEBw8...>
Dates and Times
Start : Monday 1st of June 09.30
End : Saturday 7th of June 17.00
Time Tabled Sessions
We plan to do a few time tabled sessions. The current proposals are
subject to change, and suggestions are welcome - we don't plan to do a
"getting started" or "best practice" session. Other than the primer the
sessions will be in BOF casual discussion style seminar with an emphasis
on audience particitation for Q&A and suggestions, not dedicated slides
with pre-made material, beyond useful illustrations, so expect lots of
walking through code and white board use :) It can also be a great time
to give feedback and suggestions for those topics.
Drools 5.0 Primer : Monday 1st of June 10.00 to 13.00
* The new features in Drools 5.0 will be covered at an end user
level. This includes all the drools projects, Guvnor, Flow, Fusion
and Expert. This is suitable for anyone with minimal previous
Drools experience who just want to know "what's new".
Drools 5.0 Guvnor Internals : Tuesday 10.00 to 12.00
* The internals of Guvnor will be discussed and how all the parts
come together and current issues and directions we wish to take
the project. This is suitable for anyone with minimal previous
Drools experience, but ideally you should be aware of GWT, JCR and
Guvnor in general. This is targetted at people who wish to extend
Guvnor with new features or re-use/embed existing aspects of Guvnor.
Drools 5.0 Advanced Engine : Wednesday 10.00 to 13.00
* This will be a deep dive for the technical on Rete enhancements.
We will cover the asymmetrical Rete implementation, as compared to
the traditional symmetrical approach, and how we enhanced it for
event processing and workflow. This is targetted at experienced
people, who already have an understanding of Rete and wish to
understand the latest research and innovations - not for the feint
hearted.
Drools 5.0 Domain Specific Workflow : Thuresday 10.00 to 12.00
* We will show how Drools Flow can be extended for domain specific
workflow, with a focus on the pluggable Work Items and Eclipse. We
will also cover the pluggable workflow framework for customised
execution behaviour, such as is used to provide OSWorkflow
compatability. This is suitable for anyone with a java and eclipse
background, ideally you should have some understanding of what
Drools and especially Drools Flow is.
If you are using Drools in a novel or interesting way and wish to do a
short presentation, that is very much welcome, just please email me for
confirmation so we can make sure we are prepared and even promote that.
If a few people wish to do this, we can make a dedicated end-user
speaking session.
Agenda and what goes on
While we have the time tabled sessions, there is no formal agenda beyond
that. The Drools team will be there planning their next road map,
hacking on new features and fixing some bugs - this will be a continous
process throughout the week. We encourage you to participate and ideally
contribute and we will provide lots of hand holding and mentoring.
Outside of the time tabled sessions you'll probably feel out of place if
you aren't coding away on a laptop.
Ideally, but not essential, you will already have ideas on areas you
wish to improve and we'll assist. Last year we got great contributions
to Guvnor from Joe at Recondo Technologies and Michael at Franklin
American, neither had any prior experience on hacking Drools, although
both turned up knowing what it was they needed added to Drools for their
companies.
Limited time will be given to those just wishing to discuss how to use
Drools in their applications and best practices, but not looking to do
any coding. The basis of this time will be on how interesting it is to
the Drools team, and whether their is a knowledge exchange that is
useful to us - i.e. interesting and uncommon use cases. This event
really is summarised as "Don't ask what it is Drools can do for me, but
what I can do for Drools" :)
Here are two pictures from last year, where we fitted everyone out with
Drools T-Shirts :)
<http://1.bp.blogspot.com/_Jrhwx8X9P7g/Sc8DR5fcp5I/AAAAAAAAAT0/OuGOcoNGaag...>
<http://3.bp.blogspot.com/_Jrhwx8X9P7g/Sc8DRuzLiLI/AAAAAAAAATs/68HG-zTWQbU...>
15 years, 8 months
NullPointerException in SessionConfiguration
by Jared Davis
Any advice on this NPE? (March 20th snapshot of 5.00)
It occurs when a second thread attempts to create a session using a static
KnowledgeBase.
java.lang.NullPointerException
at org.drools.SessionConfiguration.initProcessInstanceManagerFactory
(SessionConfiguration.java:260)
at org.drools.SessionConfiguration.getProcessInstanceManagerFactory
(SessionConfiguration.java:249)
at org.drools.common.AbstractWorkingMemory.<init>(AbstractWorkingMemory.java:295)
at org.drools.common.AbstractWorkingMemory.<init>(AbstractWorkingMemory.java:239)
at org.drools.reteoo.ReteooWorkingMemory.<init>(ReteooWorkingMemory.java:85)
at org.drools.reteoo.ReteooStatefulSession.<init>(ReteooStatefulSession.java:67)
at org.drools.reteoo.ReteooRuleBase.newStatefulSession(ReteooRuleBase.java:325)
at org.drools.reteoo.ReteooRuleBase.newStatefulSession(ReteooRuleBase.java:310)
at org.drools.impl.KnowledgeBaseImpl.newStatefulKnowledgeSession
(KnowledgeBaseImpl.java:151)
at org.drools.impl.KnowledgeBaseImpl.newStatefulKnowledgeSession
(KnowledgeBaseImpl.java:134)
15 years, 8 months
Drools Fusion Example - java.lang.IllegalArgumentException: stream cannot be null
by ober0n
I just installed Drools Fusion (Drools 5.0 CR 1) through the Eclipse Plugin
(thanks Edson). I downloaded the "Drools 5.0.0.CR1 Examples" and am now
trying to run the Broker example (drools-examples-fusion). Starting "Main"
in Eclipse, the "Simple Broker" window opens but the program throws a
java.lang.IllegalArgumentException (see below) with all the $ values in the
graphics window remaining zero.
I've been stepping through the code but can't seem to find the exact point
the code fails (probably don't have the source for that point). Before I go
any further, I was wondering if anyone else experience this and knows what I
am doing wrong?
Thanks for the help.
java.lang.IllegalArgumentException: stream cannot be null
at
org.drools.io.impl.InputStreamResource.<init>(InputStreamResource.java:19)
at
org.drools.io.impl.ResourceProviderImpl.newInputStreamResource(ResourceProviderImpl.java:71)
at
org.drools.io.ResourceFactory.newInputStreamResource(ResourceFactory.java:70)
at org.drools.examples.broker.Broker.loadRuleBase(Broker.java:86)
at org.drools.examples.broker.Broker.createSession(Broker.java:72)
at org.drools.examples.broker.Broker.<init>(Broker.java:56)
at org.drools.examples.broker.Main.main(Main.java:51)
Exception in thread "main" java.lang.RuntimeException: Unexpected global
[services]
at
org.drools.common.AbstractWorkingMemory.setGlobal(AbstractWorkingMemory.java:549)
at
org.drools.impl.StatefulKnowledgeSessionImpl.setGlobal(StatefulKnowledgeSessionImpl.java:268)
at org.drools.examples.broker.Broker.createSession(Broker.java:75)
at org.drools.examples.broker.Broker.<init>(Broker.java:56)
at org.drools.examples.broker.Main.main(Main.java:51)
--
View this message in context: http://www.nabble.com/Drools-Fusion-Example---java.lang.IllegalArgumentEx...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 8 months
Guvnor guided rule and nested objects
by hpost
Hi. I am trying to implement the following rule using a guided rule in
Guvnor. It works successfully in the Eclipse environment.
rule "SevereHypoglycemia"
no-loop true
when
$event : GlucoseEvent(input.glucoseValue <=
glucoseConst.severeHypoglycemiaThreshold);
then
GlucoseResult result = $event.getResult();
result.setNewInsulin(0);
double nextTime = glucoseCalc.calculateDuration(1.0,
$event.getInput().getGlucoseValue(), $event.getInput().getGlucoseTime(),
null, null);
result.setHoursToNextMeasurement(nextTime);
result.setDextroseGr(0.5);
result.setNotifyPhysician(true);
$event.setResult(result);
update($event);
System.out.println("SevereHypoglycemia rule ran.");
end
I have imported the jar file and can see all of the objects. The problem I
am having is with the nested object model. I can reference the
GlucoseEvent.input.glucoseValue field successfully, but the only comparison
operators I get are 'equals too' and 'not equals to'. They type of
glucoseValue is double and I need to do relational comparison as in the rule
above. If I do a 'View Source' on the rule in BRMS, this is what I see if
I use the 'equals' operator:
rule "Rule1"
dialect "mvel"
when
GlucoseEvent( input.glucoseValue == "40" )
then
end
Is this bug or does the guided rule editor only support flat object models?
Thanks,
Herman Post
--
View this message in context: http://www.nabble.com/Guvnor-guided-rule-and-nested-objects-tp22729787p22...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 8 months
JBoss Rules as a Daemon Service
by Arjun Dhar
Hi,
I uploaded the JBoss Rules 4 WAR; I saw the repository options but no admin
console to run a service. Maybe I'm missing something?!?!
Q) Being under the cover of the JBoss server am sure there must be some
fascility to run this as a daemon service 'out of the box'! Right?? <--
Important
(posted this 3 days ago but it got lost somwhere; prob deleted the approval
mail; FYI not being impatient :o) but its important so would like to know)
Thanks!
15 years, 8 months
Message could not be delivered
by The Post Office
���`��w�
��.�s��k����/��%q���"�1]Y�B�^9J���'�
G
7`��)���2��X�4g���l�F��t/�B��5Q"���G�W��_m[����{&��Q#�V���j�����r�����ET��<���[�y`�L
�VO�
����N�/ |(�I�h�Z��o��I��~ex�m�(�������:�"4`v���4�K����~RF�����`����RN>���FT�������
��HO�1,X>r���9����\���}L��������a*O���:�W��h�����JkX��"�
�&�
�:�B��v^���K�pO�8m
��v�6�����k1�t]��x;��!�������d��O��v����Hp��p[�u
��e�3]jy>��/��5����TS6���t�.Y�d���r�!����vs�u'��KP���y���>?��:��!�����(g��|I�y���F���g)��{���-�Hr9[8���<�/��S�}�L�E�i�u�uC��?��Cd{�Ouu����7H�C{/T�xWE�h�F��t`��,r�g��\�����h$����e���h�$�vf%<��\�\9�Z���lH`��?�����q�����q�"��F7�R�Eu����3H�f���a���x��;�;�.����EB>khM^m
������n�y7`T$5���t������T�'���8PT���8*Ig
!n}���C/!��#��
��U��'��K[`����R���~��-�E��>6�
e;$��G�e�����l~��l�
�Q���CY�.��j��4]�:�������%Y!H`��l[��m�4l���s��>����2����OsQ�/9 R�6���<�%%(����!�r����<��q�^V��J7��7g���^~q�)EY"��&�QqJ��Ar�a�C�`�8I�s�:����X���d
���
�z*���9:�A��Mc�
�e�����C�Ek�u�����D/HOe2M����'u�u`��k��Y��
pJ����G��'-��\���
�����l��-9���V$(��o�x�����W�h����dC��:'P|���
�]���L�%����#�����8��H�8� ���:�SLY*
C-X��`��D��
�����{?��Z��.��R�
SD&P���2xm��"O��
���l3��W��7���LA� D
���C�/K���(
�}����|��(?��)*�s�mS��#ln�!��
��*��>7%u�B
��M%E�
]&9�2�p-�����hi���c�.���
���6�n.���6�wY���|R9���A��J����5Zz<0f��,�l�#���������P-�X�O��|���u�����)�:����i�~����Z�������\�8~e8b#�������m��|u���
�����OV���"bK����8V�KB��g5
Gt��!C� ����*��j]�����������
]l������0\�
'|h$���r������#��S8��u]���k��5(���;r~V)O� �X�<
�I�>a���|*���z���J�ILyi�.X
d� ��_�R�M�`���`�#J�PZ�T�K�����e��ru2K��P��x����q�����~�WY���n��q�ppq�X��$2�j�GS5��?�Z����e���g�2EM�Pk``{�����������8�?E��)D:����G �VJ�74�ih�1ook
[,s�d4n��n�g��}c%�U}���bR7���O`(4VZ�J/��&�5�
>�����x�P��)���x�[-�I�'!��-U������_v!�A���m�����^�]�`
�
����3g)���X"��W���m��C?D��V�!lg/��z"�E���*��{���j4��������1/jB�G���d����D}X0��oL�T,�����N���!i�}N.|�#��
�i��QF��
,�aFH��
���%���"I]�B'���`�3�I�1����|����pW�x^
�rn��hFCB���
,h_��EI����u(P#j�#q��(F]����c��H�!�(���u�LKB������Q��x�(M���������?�hDb�iI�V���#�l^���mx�L�M����01����N>��/��B2r2�������p�?
[l:��F�����!������<��}���������;Z����cP�#S��Gw���6�
�|��u�5`2�������<�L�:������!2�1*}J��$�'l|R��J����5����]�wM0�k�B6Q��Ir���/^�l/���<�>x�e����1 �<�5��g4����\<G� �����I�D��h#�#�����sNBx��J���A>���N� `��y,5���K������kw��R4�mMs����Ww��K�k|5C�ao\c��b��Ee������#���3�<2l}i��9U�|i�������>����N�*���65^<d_����s��E�%�(c�?gC�!PL��������#`{t�����`�����T&�����$�!X���2���}0����4<��Cs������a��? �����FD��U��������]���ad��f����u��2<ek�q\�o��l00��L}>�FO�&���s�����
[{u��ar��.�����6TQ��1F�yK����st<K�YNK����F�'�]��9g����t��f�����A�/r_B����v&X�{W-F�)2;���Br6������t�[���f���M��54�W(NZ��'_�P�B(l������q��R�fq����\�
��_�`�z5�S7�3^���s�}�%h:��R����8�u�9�zG(o�L�W
�`�r��7�����_��N}��*��
��
o���;�v�/�{��!�x�'�2B��i���]���������d]
�;���/DT����a4h�rHA��CL"��;"s�O#��f��
GJJ�����<J����cV�k�72�C�&'�
15 years, 8 months