Is it a valid use of \n in DSL
by Faisal Shafique
Hi,
I want to know if following is a valid use of '\n' i.e new line character in a DSL to put different patterns on different lines in resulting DRL?
[when]There is an instance of RulesContext=$rc:RulesContext()\n$ce:CaseEligibility()\n$cp:CertificationPeriod(startDate <= $rc.calculationDate, endDate >= $rc.calculationDate, caseId == $rc.caseId)
which results in following DRL
when
$rc:RulesContext()
$ce:CaseEligibility()
$cp:CertificationPeriod(startDate <= $rc.calculationDate, endDate >= $rc.calculationDate, caseId == $rc.caseId)
DSL parser expands this correctly but the question is whether this is a supported behavior or just works because of the way parsing works and hence may change in future?
Thanks,
Faisal Shafique
13 years, 8 months
Case study involving use of Drools in commercial SaaS healthcare application
by Nathan Bell
In some previous posts to the rules-users mailing list Mark Proctor has
asked for real world examples:
>>We often get complaints about not enough real world examples in
Drools.
>>We have a large community now, so surely a few of you must be able to
write up examples based on your work? So please, please, please, please
take the >>time to help us here.
>>Thanks
>>Mark
>>If you are doing anything interesting with drools and jbpm (was drools
>>flow) why not submit a paper on them at the Building Business
Capability event.
>>http://www.buildingbusinesscapability.com/
>>Mark
I will be presenting a case study entitled "Speed Saves Lives:
Leveraging a massively parallel expert system for patient surveillance"
about the use of Drools and GigaSpaces at the 2011 Business Rules Forum
Conference October 30 - November 3.
Abstract:
Pharmacy OneSource is a SaaS provider of applications for hospital
pharmacy and infection prevention professionals. This case study will
discuss the steps taken to develop a next-generation patient
surveillance platform that allows clinicians to accurately detect risk
factors, and perform interventions. The platform leverages the
GigaSpaces implementation of Tuple-space and the Drools rule engine to
create a massively parallel expert system. This architecture allows for
customizable handling of millions of HL7 messages per day, evaluation of
thousands of clinician created business rules, and reasoning over
hundreds of thousands of patient data facts to provide near-real-time
surveillance.
The presentation will attempt to cover challenges, design decisions, and
technology choices, ROI for the project and the platform, both
internally and externally, as well as lessons learned from adopting
business rules in the development process.
Thank You,
Nathan Bell
Software Architect
Pharmacy OneSource, Inc.
http://www.pharmacyonesource.com
13 years, 8 months
How does SpreadSheetCompiler work?
by Jay
Hi, All!
I got a question with SpreadSheetCompiler now.
The story is:
I have two Decision Tables,which are SOP.xls and quotation.xls. When I try
to write a class,named as XLSConverter.java to compile them to drl rule
files,
I found a strange thing--
1.The RuleSet of SOP.xls is 'com.my.booking.as.drools', after compiling
SOP.xls, the 'package' value of compiled drl file from SOP.xls is
'com.my.booking.as.drools';
And if I change RuleSet of it to 'com.sample', after compiling, package
value is also 'com.sample', which is normal;
2.But while RuleSet of quotation.xls is 'com.sample', after compiling
quotation.xls, the package value of compiled drl file from quotation.xls is
'rule_table';
And no matter what I change RuleSet of it to, after compiling it, its
package value is still 'rule_table'.
Could anybody please help me to explain why is that?
Any help is appreciated!
Yours sincerely,
Jay
--
View this message in context: http://drools.46999.n3.nabble.com/How-does-SpreadSheetCompiler-work-tp284...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 8 months
Drools Decision Table
by Riyaz Saiyed
Hi,
I'm doing a POC on drools decision table. We need to develope pricing
engine for few of our products. I created xls with list of products and
their price as per drools format. When I load xls and run the rules, the
price were picked up correctly against mathing product, customer and
quantity criteria.
Now I want to save the executed rule so the if there is any modification
in quantity (increase/decrease), I can calculate the price again based
on earlier executed rule and not from xls.
I think to achieve the, I need to store the "rule" against every order
for each product.
Can any one suggest me, how I can get the string representation of the
executed rule so that I can create .drl file from that string and run
the same rule again for any order modification.
I've looked at SpreadsheetCompiler and was able to get the string of all
the rules as a result of compile method.
Note - I can not read xls again for order modification because, if in
between the price in xls has changed, the engine should still pick the
old price.
Thanks,
Riyaz
13 years, 8 months
how to run pkg from java
by MichaelBini
Hi ,
I Build few classes using Eclipse and then import it into "JBoss BRMS"
then I created few rule and and using "knowledge base" I created binary
package.
I try to open the pkg using Eclipse with this code :
Collection<KnowledgePackage> kpkgs = new ArrayList<KnowledgePackage>();
ObjectInputStream in = new ObjectInputStream(new FileInputStream(
"c:/com.jspeed.brms.fire.pkg"));
Object o = in.readObject();
System.out.println("Read: pkg ok ");
in.close();
KnowledgePackage kp = (KnowledgePackage) o;
kpkgs.add(kp);
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kpkgs);
and I am getting error -
java.io.ObjectInputStream cannot be cast to
org.drools.common.DroolsObjectInput
What am I doing wrong ?
My imports :
import java.io.FileInputStream;
import java.io.ObjectInputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.drools.KnowledgeBase;
import org.drools.KnowledgeBaseFactory;
import org.drools.definition.KnowledgePackage;
import org.drools.runtime.StatefulKnowledgeSession;
import org.drools.runtime.rule.FactHandle;
--
View this message in context: http://drools.46999.n3.nabble.com/how-to-run-pkg-from-java-tp2848164p2848...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 8 months
How to add java logics in the LHS of a rule ?
by carnelk
Hi,
I have to rule below.
This rule finds the minimal date of a 'B object' that is still AFTER the
startDate of $aObject.
I would like it to find the minimal date of B that is at least 7 days after
the startDate of $aObject
(and perhaps no more then 14 days after).
For that I would need to add some java logics instead of line <9> to
manipulate the date with java,
wouldn't I?
Does anyone have any creative solution for that ???
1 rule "first measurement < 7 days> after the treatment"
2 salience 9
3 when
4 $aObject : A ( )
5 $minDate : Number()
6 from accumulate ( B (
7 # I would like to change the following line to
manipulate $aObject.startDate
8 # to be '$aObject.startDate + 7 days'
9 date > $aObject.startDate,
10 $bpDate : date),
11 min($bpDate.getTime()) )
12
13 then
14 # do something ....
15 end
Much thanks,
Carmel.
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-add-java-logics-in-the-LHS-of-a-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 8 months
Drools rules
by annukaila
Hi
iam new to drools rules my problem is
iam receiving message in xml format so using drools have to route it my
drools rules work when the xml message is the format as below
<?xml version="1.0" encoding="UTF-8"?>
<IATA>
<messageaudit senderId="125" receiverId="FFCategory"
dateTimeOfMessage="19:00"
messageVersion="FSU/13/RCS" airwaybill="125-1234565" />
<fsurcs AwbNumber="125-1234565" origin="HYD" destination="KUL"
totalPieces="T40" totalWeight="K200"
statusCodeConsignmentRecieveDFromShipperOrAgent="RCS"
dayAndMonthOfReceipt="02June" actualTimeOfGivenStatusEvent="19:00"
airportCodeOfReceipt="HYD"
totalOrPartNumberOfPices="T40" weightOfTotalOrPartOfPieces="K200"
nameOfAgentOfShipper="Shipper" osi="RcsMessage"/>
</IATA>
but if the xml is the format as below
<?xml version="1.0" encoding="UTF-8"?>
<IATA>
<messageaudit>
<senderId>125</senderId>
<receiverId>FFCategory</receiverId>
<dateTimeOfMessage>19:00</dateTimeOfMessage>
<messageVersion>FSU/13/RCS</messageVersion>
<airwaybill>125-1234565</airwaybill>
</messageaudit>
<fsurcs>
<AwbNumber>125-1234565</AwbNumber>
<origin>HYD</origin>
<destination>KUL</destination>
<totalPieces>T40</totalPieces>
<totalWeight>K200</totalWeight>
<statusCodeConsignmentRecieveDFromShipperOrAgent>RCS</statusCodeConsignmentRecieveDFromShipperOrAgent>
<dayAndMonthOfReceipt>02June</dayAndMonthOfReceipt>
<actualTimeOfGivenStatusEvent>19:00</actualTimeOfGivenStatusEvent>
<airportCodeOfReceipt>HYD</airportCodeOfReceipt>
<totalOrPartNumberOfPices>T40</totalOrPartNumberOfPices>
<weightOfTotalOrPartOfPieces>K200</weightOfTotalOrPartOfPieces>
<nameOfAgentOfShipper>Shipper</nameOfAgentOfShipper>
<osi>RcsMessage</osi>
</fsurcs>
</IATA>
it is not routing the message means not recognizing the drools and my drools
file is as follows
package com.jboss.soa.esb.routing.cbr
#list any import classes here.
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.message.format.MessageType;
expander XPathLanguage.dsl
#declare any global variables here
global java.util.List destinations;
rule "Blue Routing Rule using XPATH"
when
xpathEquals "/IATA/messageaudit/@messageVersion" "FSU/13/RCS"
then
Log : "Blue Team";
Destination : "blue";
end
rule "Red Routing Rule using XPATH"
when
xpathEquals "/IATA/messageaudit/@messageVersion" "FSU/13/MAN"
then
Log : "Red Team";
Destination : "red";
end
rule "Green Routing Rule using XPATH"
when
xpathEquals "/IATA/messageaudit/@messageVersion" "FSU/13/DEP"
then
Log : "Green Team";
Destination : "green";
end
please help me hoe to rectify this its very urgent for me and please dnt
mind if i did any mistakes
thanku
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-rules-tp2854688p2854688.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 8 months
Drools Rule verifier background
by Steffen Heublein
Hello,
I am currently using the Rule Verifier and am quite happy so far. Yet I
am interested in its (scientific) background background, but I am unsure
where to start. Are there any papers on the topic or anything else I
could relate to? There certainly is, but I don't really know what topic
I should look for to find what I want. My special interest so far is the
solving of the rule conditions and how the system finds out how e.g. two
rule conditions are equivalent.
Cheers, and thanks so far,
Steffen
13 years, 8 months