Ordering rules execution: ruleflow-group or salience?
by AleBu
Hi all,
I have some complex rule execution scenario which consists of several steps
where different groups of rules must be executed. These steps are: 'Init
Data', 'Validate Integrity', 'Stop Execution if any integrity errors found'
and 'Validate Business Logic'. Originally I implemented it by assigning
specific salience to specify an order of rules, like 'Init Data' rules has
biggest salience, and 'Validate Business Logic' rules has the smallest.
I am wondering, is designing separate rule flow (very simple) is a valid
approach and wouldyoy recomend it? It should look like:
'Start' -> 'Init Data' -> 'Validate Integrity' -> 'Stop Execution if any
integrity errors found' -> 'Validate Business Logic' -> 'End'.
Also, I tried to do it by specifing 'ruleflow-group' for each rule and
creating rule-flow, but got an error 'Unknown process ID' while executing.
The code was very simple - 1st I added rule-flow file as resource to
KnowledgeBuilders DRF resource with:
Resource flowFileRes = ResourceFactory.newFileResource( flowFile );
knowledgeBuilder.add( flowFileRes, ResourceType.DRF );
knowledgeBuilder.hasErrors() is false at this point, so I assume that
process was added sucessfully.
Then I am executed:
session.startProcess( MAIN_FLOW_ID );
session.fireAllRules();
MAIN_FLOW_ID constist of package defined in rule-flow file and rule-flow-ID
from the same file (<package>.<flow-ID>).
But fireAllRules() claims that no such process can be found (Unknown process
ID).
Documentation is very weak and it is the only information I found about
executing processes, so perhaps I miss something, but mailing list seems
like the only place to find more info.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Ordering-rules-execut...
Sent from the Drools - User mailing list archive at Nabble.com.
13 years, 12 months
Too many ACTIVATION "candidates"
by rouvas@di.uoa.gr
Hello List,
Issue: Too many ACTIVATION "candidates"
Sorry for the terminology, I'm sure it is not correct.
Background Information:
- Drools.5.0.1
- using StatefulKnowledgeSession
- logging through KnowledgeRuntimeLoggerFactory.newConsoleLogger()
- after each session creation, rules are inserted from a DRL file,
facts are inserted and ksession.fireAllRules() is executed
- str[contains] and str[bidicontains] are custom operators implemented by me
If I understand Drools modus operandi correctly, as each fact is inserted
the list of candidate "nodes" to fire are constructed. Upon
fireAllRules(), a selection mechanism selects a candidate "node" to fire
and things start
rolling.
In my case, the rule at the end results in too many candidate "nodes"
created during facts insertion mode. If the rule ever gets to fire, only
one will remain since the not codition in the LHS and the logicalInserts
in the RHS exclude two firings of the rule (I hope).
fact1 has about 90 entries.
fact2 has about 25 entries.
fact3 has about 350 entries.
fact4 has about 150 entries.
fact5 has about 250 entries.
So I'm guessing that 90*25*350*150*250=29.531.250.000, i.e. 29 billion
candidate "nodes" would be created. Of course, I'm having OME long before
that!
If my analysis is correct, is any way that I could either:
a) detect that kind of combinatorial explosion during runtime (maybe a
kind of dry-run) and act accordingly
or
b) set any kind of upper limit for candidate "nodes" creation and stop
further execution thus avoiding to bring down the server along the way...
rule "r21767.2"
dialect "mvel"
when
gnId : GoodNumbers()
v1 : fact1( c21658 == "R" )
v2 : fact2( c21727 == "R" )
v3 : fact3( c21723 == "R" )
v4 : fact4( c21616 == "R" )
v5 : fact5( c21731 == "R" )
v6 : GoodsItems( gnId.goodNo==goodNo ,
goodsDescr str[bidicontains] v5.c21733 ||
goodsDescr str[bidicontains] v5.c21732 ||
goodsDescr str[bidicontains] v4.c21617 ||
goodsDescr str[bidicontains] v4.c21619 ||
goodsDescr str[bidicontains] v3.c21724 ||
goodsDescr str[bidicontains] v2.c21726 ||
goodsDescr str[bidicontains] v1.c21656 ||
goodsDescr str[bidicontains] v1.c21657 ||
goodsUnDangCode str[contains] v1.c21659 ||
goodsUnDangCode str[contains] v2.c21728 ||
goodsUnDangCode str[contains] v4.c21618 ||
goodsUnDangCode str[contains] v5.c21735 ||
combinedNome str[bidicontains] v1.c21655 ||
combinedNome str[bidicontains] v2.c21729 ||
combinedNome str[bidicontains] v4.c21615 ||
combinedNome str[bidicontains] v5.c21734
)
not mm : Marker ( mm.entityId==v6.entityID, mm.markAs=="19")
then
modify ( v6 ) {
setMarkAs("1")
}
Marker m1 = new Marker();
m1.setEntityId(v6.entityID);
m1.setMarkAs("19");
insertLogical(m1);
end
Thank you very much for your time,
-Stathis
13 years, 12 months
Can we return values from rules to java ?
by Shobhit1 T
Hi,
I want to know which of the fired rules was matched. Is there a way to
find that out or return a value from drl to java file that can indicate
which rule was matched?
Thanks
Shobhit
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
13 years, 12 months
need to manipulate ArrayList in rules Reg:
by Murali Venugopal
Hi,
I'm inserting an Object calld ClassA into the working memory. Which has got it's students in an ArrayList
Like this...
public class ClassA {
private String RoomNo;
private ArrayList<Student> students;
...
}
public class Student {
private String name;
private String rollNo;
...
}
Now, i've to write a rule to find a particular student with his role number and fetch his name to make some decisions.
I don't know to write a rule to access an Object's data member of type ArrayList and find a match. Please help.
Thanks in advance.
_ _ _ _ |.
| | ||_|| (_||| \/
Whoever wants to be happy, let him be so: of tomorrow there's no knowing
Get your world in your inbox!
Mail, widgets, documents, spreadsheets, organizer and much more with your Sifymail WIYI id!
Log on to http://www.sify.com
********** DISCLAIMER **********
Information contained and transmitted by this E-MAIL is proprietary to
Sify Limited and is intended for use only by the individual or entity to
which it is addressed, and may contain information that is privileged,
confidential or exempt from disclosure under applicable law. If this is a
forwarded message, the content of this E-MAIL may not have been sent with
the authority of the Company. If you are not the intended recipient, an
agent of the intended recipient or a person responsible for delivering the
information to the named recipient, you are notified that any use,
distribution, transmission, printing, copying or dissemination of this
information in any way or in any manner is strictly prohibited. If you have
received this communication in error, please delete this mail & notify us
immediately at admin(a)sifycorp.com
13 years, 12 months
Re: [rules-users] Guvnor and oryx designer problems (melc)
by Mahler, Björn
>Can someone please tell me a version of the oryx designer that works
>correctly with guvnor version 5.1 or 5.2.0-snapshot?
>Did anyone else have problems when trying to view on guvnor oryx designer a
>bpmn diagram created in eclipse?? Any solution??
Hi there,
i've the same or similar problem. In guvnor I cannot access uploaded bpmn2 diagrams... if I upload a classic rule-flow diagram I'm able to see it in guvnor.. but the link to the oryx-editor with bpmn2 ones wouldn't work...
I also have no clue, whether to define rule-flow groups in the oryx-designer... any suggestions on that?
Ciao
Björn
Diese E-Mail kann vertrauliche und/oder rechtlich geschützte Informationen enthalten.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information.
If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail.
Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
13 years, 12 months
URGENT : Drools - Guvnor Integration doubt
by sunkara007
Hi Team,
I am evaluating Drools - Guvnor to use it in BPM suits.
can you explain how the domain objects will be configured in Guvnor to use
it as part of writing Rules ?
If I need to create a Jar using all Domain Objects and upload to Guvnor,
then if any change in those objects in application, how those changes will
be reflected in Guvnor ?
I need Guvnor to be tightly coupled with application, if any change in
application objects, automatically it should reflect in Guvnor.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/URGENT-Drools-Guvnor-...
Sent from the Drools - User mailing list archive at Nabble.com.
13 years, 12 months
URGENT : Drools - Guvnor Integration doubt
by sunkara007
Hi Team,
I am evaluating Drools - Guvnor to use it in BPM suits.
can you explain how the domain objects will be configured in Guvnor to use
it as part of writing Rules ?
If I need to create a Jar using all Domain Objects and upload to Guvnor,
then if any change in those objects in application, how those changes will
be reflected in Guvnor ?
I need Guvnor to be tightly coupled with application, if any change in
application objects, automatically it should reflect in Guvnor.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/URGENT-Drools-Guvnor-...
Sent from the Drools - User mailing list archive at Nabble.com.
13 years, 12 months