Rule flow example
by Raja Sekhar
Hi
Can you any one provide me with rule flow samples
Regards,
--
Raja Sekhar Amirapu
------------------------------------------------------
"If any anyone can do it, i can do it. If no one else can do it, i must do
it"
11 years
Does a drools fact have a handle?
by Yoncho Yonchev
Hello, in order to distinguish my fact instances I need them to have some sort of number/id. Before implementing it I realized that the KieSession is not working with my business instance references, but with FactHandles, so it occurs to me that there might be some standard id that is defined and populated by the Drools in runtime.
So here is my question - Can a fact be identified by some sort of identifier after KieSession execution? May be if we get the FactHandles from it, or if we use the KieBase for that?
Thanks in advance!
Yoncho Yonchev.
11 years
How to configure Sequential Mode with Spring for Stateless session
by mattmadhavan
Hello,
Can some one let me know how I can set sequential mode when I have a
StatelessKnowledge Session configured using Spring?
I have hundreds of Facts and they are identical instances and I do not need
inference since I am only computing values based on each row and not
changing any facts.
I am injecting a StatelessKnowledge Session using Spring and I cannot find a
way to configure Sequential Mode either via Spring or programmatically since
I have Stateless Session Injected and I see no API for doing so!
Thanks in advance!
Matt
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-configure-Sequential-Mode-with-S...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years
OutOfMemoryError using 6.0.1
by john poole
I've converted some NurseRostering rules, which worked in Drools 5.50, to
OptaPlanner 6.0.1. While it works far better for the time it runs, it uses
up whatever memory I can give it (9GB) and then eventually crashes the GUI.
with:
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: GC
overhead limit exceeded
Is there a way to limit how much memory OptaPlanner uses? Or is it likely
that I'm just adding fact to the WorkingMemory in a way that wasn't a
problem in 5.5 but is a problem in 6.0?
--
View this message in context: http://drools.46999.n3.nabble.com/OutOfMemoryError-using-6-0-1-tp4028183....
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years
kieContainer version as LATEST for Drools 6
by Rupesh M G
Hi,
Will Drools 6 supports loading a kieContainer like this?
KieContainer kContainer = ks.newKieContainer(ks.newReleaseId("org.drools", "named-kiesession", "LATEST"));
The docs say it will. But I didn't get it working.
The mailing list also didn't give a clear reply on YES / NO.
The unit test samples are showing only updateToVersion(ReleaseId on a <specific version>).
Regards,
Rupesh
DISCLAIMER: "The information in this e-mail and any attachment is intended only for the person to whom it is addressed and may contain confidential and/or privileged material. If you have received this e-mail in error, kindly contact the sender and destroy all copies of the original communication. IBS makes no warranty, express or implied, nor guarantees the accuracy, adequacy or completeness of the information contained in this email or any attachment and is not liable for any errors, defects, omissions, viruses or for resultant loss or damage, if any, direct or indirect."
11 years
Question about 'query'
by ismaximum
Hi
I started to like 'query' and I think it's very useful in terms of reusing a
logic. Now my question is, is it really a good idea to use 'query' as a
reusable function to get a list of objects in memory or extract a value from
WM?
For example, I have defined a query to return the earliest date of all
object X available in WM so in different rules I can get that date and use
it. or another one to return a list of objects based on a criteria.
What is the impact on performance? Does a query get executed each time it's
invoked? or just once?
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/Question-about-query-tp4028158.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years
Help with event not found over window query
by daveor
Hi there,
I'm a drools newbie and I wonder if someone could help me. I'm using drools
6.0.1 and I'm trying to write a rule that fires when:
1) a certain event is seen and
2) a second event is not seen within a certain period of time (1 minute in
the examples below) after the first event is seen
I have tried the following LHS patterns:
rule "Something" dialect "mvel"
when
$e1: Event($location: properties["location"] && ...)
not Event(...., this after $e1)
then
//do stuff
end
rule "Something" dialect "mvel"
when
$e1: Event($location: properties["location"] && ...)
not Event(...., this after[0, 1m] $e1)
then
//do stuff
end
rule "Something" dialect "mvel"
when
$e1: Event($location: properties["location"] && ...)
List (size == 0) from collect (Event(..., this after $e1) over
window:time(1m))
then
//do stuff
end
rule "Something" dialect "mvel"
when
$e1: Event($location: properties["location"] && ...)
List (size == 0) from collect (Event(...) over window:time(1m))
then
//do stuff
end
The unwanted behaviours are as follows:
In the first case, the rule fires immediately after the first event is
inserted.
In the second case, the rule fails to fire if the second event is seen (as
expected) but the rule does not fire if the second event is not seen within
1 minute.
In the third and fourth cases, the rule fires immediately after the first
event is inserted.
Event is a java class with a hash map of properties, defined with the
following metadata:
declare Event
@role(event)
end
I would really appreciate if someone could help me out here.
Thanks and let me know if you need any more info.
Dave
--
View this message in context: http://drools.46999.n3.nabble.com/Help-with-event-not-found-over-window-q...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years
How to initialze a query parameter or set an empty list
by ismaximum
Hi all
So I have this query:
query listPrimaryBenefits(List primaries)
RuleInsuranceSubtype($subtypeId := id, riderFlag != "Y") and
primaries := List() from collect (InsuranceCover(benefitTypeId ==
$subtypeId, topup == Boolean.FALSE))
end
outside the query and within my rule I have this checking:
rule "Test rule"
when
listPrimaryBenefits($primaries;)
eval($priamries == null || primaries.isEmpty())
then
assert XXXX
Now, if there is a RuleInsuranceSubtype in WM with given condition,
everuthing is fine and $primaries is empty and being checked in eval
statement BUT if there is no RuleInsuranceSubtype in WM with riderFlag as N
(which is a valid scenario) then the whole query returns false and as the
result in the rule, my eval statement won't even get executed and its 'when'
returns false.
How can I prevent this? I tried to put OR but don't know how to set
$primaries to an empty or null value.
Does anybody know how to do this or have a better solution?
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-initialze-a-query-parameter-or-s...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years
Drools with Microsoft SQL Server
by Hong Ju
Hi,
Has anyone had an experience to configure Drools to use Microsoft SQL server? We have been using H2, but we want to switch to SQL. This is my persistence unit:
<persistence-unit name="stewardcareH2" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/processInstanceDS</jta-data-source>
<class>org.drools.persistence.info.SessionInfo</class>
<class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
<class>org.drools.persistence.info.WorkItemInfo</class>
<class>org.steward.care.fact.Account</class>
<class>org.steward.care.fact.ObservationGroup</class>
<class>org.steward.care.fact.ObservationParent</class>
<class>org.steward.care.fact.Observation</class>
<class>org.steward.care.fact.ClinicalRuleMatch</class>
<class>org.steward.care.fact.Comorbidity</class>
<class>org.steward.care.fact.OutboundNotice</class>
<class>org.steward.care.fact.Medication</class>
<class>org.steward.care.fact.data.CodedElement</class>
<class>org.steward.care.fact.data.StructuredValue</class>
<class>org.steward.care.fact.data.TriggerMatch</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect" />
<property name="hibernate.max_fetch_depth" value="3" />
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.connection.autocommit" value="true" />
<!-- <property name="hibernate.transaction.manager_lookup_class" value= "org.hibernate.transaction.BTMTransactionManagerLookup"/> -->
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.BitronixJtaPlatform"/>
</properties>
</persistence-unit>
This is how I configure a data pooling:
PoolingDataSource pds = new PoolingDataSource();
// The name must match what's in the persistence.xml!
pds.setUniqueName("jdbc/processInstanceDS");
//
pds.setClassName("com.microsoft.sqlserver.jdbc.SQLServerXADataSource");
// doesn't really matter
pds.setMaxPoolSize(3);
pds.getDriverProperties().put("user", "myuser");
pds.getDriverProperties().put("password", "mypassword");
pds.getDriverProperties().put("serverName", "localhost");
pds.getDriverProperties().put("databaseName", "CAREDatabase");
pds.getDriverProperties().put("URL", "jdbc:sqlserver://localhost;databaseName=CAREDatabase;IntegratedSecurity=true");
// pds.getDriverProperties().put("selectMethod", "cursor");
pds.init();
But I get this error:
bitronix.tm.resource.ResourceConfigurationException: cannot create JDBC datasource named jdbc/processInstanceDS
at bitronix.tm.resource.jdbc.PoolingDataSource.init(PoolingDataSource.java:92)
at org.steward.care.core.CAREKnowledgeEngine.InitializePoolingDataSource(CAREKnowledgeEngine.java:762)
at org.steward.care.core.CAREKnowledgeEngine.initializePersistedKnowledgeSession(CAREKnowledgeEngine.java:720)
at org.steward.care.core.CAREKnowledgeEngine.initializeKnowledgeEngine(CAREKnowledgeEngine.java:662)
at org.steward.care.CAREManager.main(CAREManager.java:50)
Caused by: bitronix.tm.recovery.RecoveryException: failed recovering resource jdbc/processInstanceDS
at bitronix.tm.recovery.IncrementalRecoverer.recover(IncrementalRecoverer.java:100)
at bitronix.tm.resource.ResourceRegistrar.register(ResourceRegistrar.java:87)
at bitronix.tm.resource.jdbc.PoolingDataSource.buildXAPool(PoolingDataSource.java:104)
at bitronix.tm.resource.jdbc.PoolingDataSource.init(PoolingDataSource.java:88)
... 4 more
Caused by: javax.transaction.xa.XAException: The function RECOVER: failed. The status is: -3. Error: "*** SQLJDBC_XA DTC_ERROR Context: xa_recover, state=1, StatusCode:-3 (0xFFFFFFFD) ***"
at com.microsoft.sqlserver.jdbc.SQLServerXAResource.DTC_XA_Interface(SQLServerXAResource.java:550)
at com.microsoft.sqlserver.jdbc.SQLServerXAResource.recover(SQLServerXAResource.java:728)
at bitronix.tm.recovery.RecoveryHelper.recover(RecoveryHelper.java:103)
at bitronix.tm.recovery.RecoveryHelper.recover(RecoveryHelper.java:61)
at bitronix.tm.recovery.IncrementalRecoverer.recover(IncrementalRecoverer.java:63)
... 7 more
If anyone has done this and provides an example, that will be great. Thank you!!!
Hong Lily Ju
Software Engineer
hong.ju(a)steward.org<mailto:derrick.smith@steward.org>
Steward Heath Care
[Description: cid:image001.png@01CD0DC1.C0D81BD0]
Office: 781-375-3034
Cell: 781-801-9313
Hong Lily Ju
Software Engineer
hong.ju(a)steward.org<mailto:derrick.smith@steward.org>
Steward Heath Care
[Description: cid:image001.png@01CD0DC1.C0D81BD0]
Office: 781-375-3034
Cell: 781-801-9313
11 years