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."
12 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.
12 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.
12 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.
12 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
12 years
collect
by Raja Sekhar
Hi,
I am new to drools
The following collect statement is working i wanted group by hild
References(id: hlid);
$prds : Products(products!=null)
$matchingrecords : List() from collect ( Product(hlId==id) from
$prds.products )
when the list contains 1,1,2,2 it works when the list contains 1,1,2,1
the condition fails.
I trying to group by hlId
please help
--
Raja Sekhar Amirapu
------------------------------------------------------
"If any anyone can do it, i can do it. If no one else can do it, i must do
it"
12 years
Attribute comparison thru decision table
by bala.ganesh@accenture.com
Hi,
I have a requirement to compare attributes in two objects(Object1 Vs. Object2) and store the values based on business rule in object 3.
Example rules:
If (Obj1.atrr1 != Obj2.atrr1)
Then Obj3.attr1 = Obj2.atrr1
If (Obj1.atrr2 != Obj2.atrr2)
Then Obj3.attr2 = Obj1.atrr2
If (Obj1.atrr3 - Obj2.atrr3 > 10)
Then Obj3.attr3 = Obj1.atrr3
We are planning to use decision table for this to avoid a separate GUI development.
Would like to know whether writing rule for each attribute is the only solution or is there any simpler approach?
Thanks in advance,
-Bala
________________________________
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy. .
______________________________________________________________________________________
www.accenture.com
12 years
insertlogical
by Raja Sekhar
Hi ,
i wrote some java code in then clause of the rule to sum the elements of
two list.
Now i want to pass the updated sums back to the caller. i tried with
insertlogical
its not working. Can you some one suggest on how i do this.
--
Raja Sekhar Amirapu
------------------------------------------------------
"If any anyone can do it, i can do it. If no one else can do it, i must do
it"
12 years
Save "Business Processes" failure after rename in Drools Workbench (kie-6.1.0))
by jorgehortelano
I am working with Kie-Workbench 6.1.0 at the last few days. recently I
started to create a Business Processes in the project explorer and I have
experimented a non expected behaviour (at least, not expected to me). I can
create tasks, events ... as expected using Oryx editor, and I can save it
correctly. But when I rename the project I have experimented that no more
changes are correctly saved:
How to reproduce this:
1- Create a new project in drools kie workbench.
2- Create Business Processes there. i.e. FirstName
3- Add some flow, tasks,...
4- Save it.
5- Rename it. I.e. SecondName. (At the top left corner of the editor you can
still see the old name, but at the catalina.out you can see a message like
this: 'USER:admin RENAMING asset [FirstName.bpmn2] to [SecondName]').
6- Add new tasks and flows.
7- Save it again.
"Save successfully" message showed in green at the top right corner of the
editor.
But when you reopen the project again, all changes of step 6 are lost. Is
this an issue?
I am using version 6.1.0 in Tomcat7 and the client is Firefox (27.0.1).
--
View this message in context: http://drools.46999.n3.nabble.com/Save-Business-Processes-failure-after-r...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years