Business Logic in Java
by sdinoo
I have a claim object that I want to subject to a Rule
there is a Java class that contains the complex business logic
Rule Class DurBusinessRules has the following method
public DurRuleResponse executeHardCodedTDAlertRule(DurClaim incomingClaim)
DurRuleResponse is an response object that contains the contributing claims
I want to be able to send just the incoming claim to the Rule
and in the rule I want to print just the values from the DurRuleResponse
object
something like
when
executeHardCodedRule(incoming claim)
then
print each contributing claim from the DurRuleResponse
end
Can someone help?
--
View this message in context: http://drools.46999.n3.nabble.com/Business-Logic-in-Java-tp2979079p297907...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 6 months
Re-insert modified instance of same fact and Truth maintenance
by Abhay B. Chaware
Could be a basic question, but thought I should get clarified.
I insert a fact say, a Computer object with some attributes ( hdd=10GB ) set, in working memory. Then I have a rule that checks if a Computer with 10GB hdd is inserted .. if yes, then it does a logicalInsert of an Alert object with computerId = this computer's id.
Now I would like to re-insert the same fact with HDD changed to '20gb' and would like drools to automatically retract the Alert for this computerId .. how do I achieve this ?
-abhay
13 years, 6 months
Throws NPE when comparing one property to another of the same bean class
by Miles Wen
That's almost all the details in the mail subject; When I am running this
rule in drools 5.1.0:
package com.sample
import com.sample.Msg;
import java.util.Date;
rule "Hello World"
when
m1:Msg()
m:Msg(dbl > lo || m1.in == in)
then
end
The java bean named 'Msg' definition:
package com.sample;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
public class Msg {
private Long lo = 5l;
private double dbl = 5.5;
private Date date = new Date();
private int in = 4;
private boolean bool;
private Set<String> set = new HashSet<String>();
... // getter and setters ignored
then it throws exception :
java.lang.NullPointerException
at org.drools.reteoo.LeftTuple.get(LeftTuple.java:399)
at org.drools.reteoo.LeftTuple.get(LeftTuple.java:434)
at
org.drools.rule.VariableRestriction$DoubleVariableContextEntry.updateFromTuple(VariableRestriction.java:563)
at
org.drools.rule.AbstractCompositeConstraint$MultiFieldConstraintContextEntry.updateFromTuple(AbstractCompositeConstraint.java:306)
at
org.drools.common.SingleBetaConstraints.updateFromTuple(SingleBetaConstraints.java:123)
at org.drools.reteoo.JoinNode.assertLeftTuple(JoinNode.java:77)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:189)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.createAndPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:138)
at
org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:148)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:450)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:378)
at
org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:190)
at
org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:145)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1174)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1123)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:917)
at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:251)
at com.sample.DroolsTest.main(DroolsTest.java:43)
I think I am doing nothing wrong with the code, is this a bug or something?
Or just comparing properties in the same bean class is illegal?
13 years, 6 months
CfP: edBPM 2011 Workshop deadline ends May 27th
by Adrian Paschke
Apologies for cross-posting...
---------------------------------------------------------------------
Call for Papers
5th International Workshop on Event-Driven Business Process Management,
edBPM 2011 to be held alongside the Busines Process Management Conference
BPM 2011 on August 29th 2011 in Clermont-Ferrand, France
http://icep-edbpm11.fzi.de
Submission Deadline ends May 27, 2011
=====================================================================
TOPICS
Authors are invited to submit novel contributions in the above mentioned
problem domain. Specifically, the relevant topics include, but are not
limited to:
- Event-driven BPM: Concepts
e.g. role of event processing in BPM, business events: types and
representation, vent stream processing in business processes, process event
processing in CEP, data- and event-driven business processes, event and
process interaction patterns
- Design-time CEP and BPM
e.g. modelling modelling events in human-oriented tasks,
semantics/ontologies for event-driven BPM, BPMN and event processing,
interaction modelling of process model and event processing network.
- Run-time CEP and BPM
e.g. event pattern detection, BPEL and event processing, reasoning about
unknown/ similar events
- Applications/ Use use cases for event-driven BPM
e.g. event-driven monitoring/ BAM , event-driven SLA monitoring,
context-aware BPM
The Workshop is planned as a full-day event, including a keynote, paper
presentations, lightning talks, demos, posters, and a moderated, open
discussion with the clear goal of agreeing upon a research roadmap for
event-driven Business Process Management research, by taking into account
new challenges, described earlier.
Additional information
http://icep-edbpm11.fzi.de
--------------------------------------------------------
13 years, 6 months
viewing working memory
by Hezi Stern
I am working with stateless session (Drools 5.1.1) and I wish to view the
objects in the working memory (debug purposes)
I understand that in stateless session the audit does not work (not working
for me, on breakpoint I get the message "the selected working memory is
empty" ).
How can I view in breakpoint (or print in runtime) the working memory?
Regards,
Hezi
13 years, 6 months
Rule of rules
by Abhay B. Chaware
Is it possible to write rule of rules with Drools ? e.g. I write two complex rules in drools and then I want a third rule that can be defined to process facts
1. which passed both rule 1 and rule 2 OR
2. which passed rule 1 but not rule 2 OR
3. which passed rule 2 but not Rule 1 OR
4. which did not pass rule 1 and rule 2 and so on ..
Kind of a new 'layer' on top of drools .. ?
I can think of a crud way, that is to flag the fact object when it passed rule 1 and rule 2 and check the flag in rule 3 .. but am looking for a more sophisticated way using drools features ..
-ahbay
13 years, 6 months
Re: [rules-users] Need Help on Guided Web Editor or Rule Template in Guvnour
by mahmood lebbai
Thanks Mike.
I'm currently using 5.2.0 M2.
Regards,
Mahmood
________________________________
From: mahmood lebbai <mahmoodlebbai(a)yahoo.com>
To: "rules-users(a)lists.jboss.org" <rules-users(a)lists.jboss.org>
Sent: Monday, 23 May 2011 12:45 PM
Subject: Need Help on Guided Web Editor or Rule Template in Guvnour
Following are the issues which I had identified in DROOLS Rule template in Guvnour
1. When the particular field attribute is of type String and defined in the condition with the template key , then while entering template data we need to explicit put the double quotes while entering template data.
2. When the particular field attribute is of type String and defined in the condition with the template key but the enumeration has been defined for the column , there is no way to place the double quotes for the field attribute.
3. In THEN Part , if the particular attribute is defined with the enumeration , template key option is not showing up other than plain text. ( Need to have an option to choose from Load Template data ).
4. If the attribute of type boolean and checkbox has been displayed and by default its set to false. We should have an option to remove this ... ( this might cause pattern evaluation in condition and avoid removing the pattern option in Guided decision table or rule template)
5. Template Key option to be provided / enhanced for condition or action entered through DSLR and Need an option to choose the data using Load Template data.
Regards,
Mahmood
13 years, 6 months
Need Help on Guided Web Editor or Rule Template in Guvnour
by mahmood lebbai
Following are the issues which I had identified in DROOLS Rule template in Guvnour
1. When the particular field attribute is of type String and defined in the condition with the template key , then while entering template data we need to explicit put the double quotes while entering template data.
2. When the particular field attribute is of type String and defined in the condition with the template key but the enumeration has been defined for the column , there is no way to place the double quotes for the field attribute.
3. In THEN Part , if the particular attribute is defined with the enumeration , template key option is not showing up other than plain text. ( Need to have an option to choose from Load Template data ).
4. If the attribute of type boolean and checkbox has been displayed and by default its set to false. We should have an option to remove this ... ( this might cause pattern evaluation in condition and avoid removing the pattern option in Guided decision table or rule template)
5. Template Key option to be provided / enhanced for condition or action entered through DSLR and Need an option to choose the data using Load Template data.
Regards,
Mahmood
13 years, 6 months
org.drools.reteoo.ReteooRuleBase not getting released
by dkrishna
Hi,
I am using Drools 5.1.1 and Spring-Drools configuration to load excels on
startup and inject stateful session into Java service. I noticed
org.drools.reteoo.ReteooRuleBase not getting released when I redeploy the
app. Other suspect that I notoced is
org.drools.rule.builder.dialect.java.parser.JavaLexer. After redeploy (stop,
uninstall and install) previous deploy ReteooRuleBase is still out there
along with new instance.
Is there a known memory leak in 5.1.1 or do I need to cofigure Spring
differently ? I am attaching config code below.
Env:
Drools 5.1.1
WAS 6.1
JDK 5
<drools:kbase id="kbase1">
<drools:resources>
<drools:resource type="DTABLE"
source="file:/Rules/ruleset1.xls">
<drools:decisiontable-conf input-type='XLS' worksheet-name="Sheet1"/>
</drools:resource>
<drools:resource type="DTABLE"
source="file:/Rules/ruleset2.xls">
<drools:decisiontable-conf input-type='XLS' worksheet-name="Sheet1"/>
</drools:resource>
</drools:resources>
<drools:configuration>
<drools:mbeans enabled="true" />
<drools:event-processing-mode mode="STREAM" />
</drools:configuration>
</drools:kbase>
<drools:ksession kbase="kbase1" type="stateful" id="ksession1"/>
<bean id="rulesService" class = "com.RulesServiceImpl">
<constructor-arg ref="ksession1"/>
</bean>
--
View this message in context: http://drools.46999.n3.nabble.com/org-drools-reteoo-ReteooRuleBase-not-ge...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 6 months