[rules-users] OutOfMemoryError using 6.0.1

2014-02-18 Thread 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.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] How to initialze a query parameter or set an empty list

2014-02-18 Thread 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 


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-set-an-empty-list-tp4028180.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] kieContainer version as LATEST for Drools 6

2014-02-18 Thread Mark Proctor
We want it to be quick. I hope 4 to  weeks. We’ll do one beta, one CR and then 
final.

Also it might be called 7.0. We are being asked to differentiate community 
versions, with our product version - by increasing the community version number.

Mark


On 18 Feb 2014, at 08:50, Rupesh M G  wrote:

> Thanks Mark. What is the tentative release date for 6.1.0.Final?
>  
> Regards,
> Rupesh
>  
> From: rules-users-boun...@lists.jboss.org 
> [mailto:rules-users-boun...@lists.jboss.org] On Behalf OfMark Proctor
> Sent: 17 February 2014 19:57
> To: Rules Users List
> Subject: Re: [rules-users] kieContainer version as LATEST for Drools 6
>  
> There were some bugs, these have been fixed in master.
>  
> Mark
>  
>  
> On 17 Feb 2014, at 13:56, Rupesh M G  wrote:
> 
> 
> 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 
> ).
>  
>  
> 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."
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>  
> 
> 
> 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."
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

[rules-users] java.lang.NullPointerException in simple example

2014-02-18 Thread ahgiovanini
Hi guys! 

I'm new in the world of jboss and drools and I'm making some simple examples
that existing on
https://github.com/droolsjbpm/drools/tree/master/drools-examples-api

Now, I'm studing the CashFlow example and in my project when I run it, I
receive a error message saying: 
Exception in thread "main" java.lang.NullPointerException
at com.sample.CashFlowMain.main(CashFlowMain.java:30)"

I don't know the why this message, because I set the acp at lines 20 and 21.

Someone would help me please?

Thanks


package com.sample;

import org.kie.api.KieServices;
import org.kie.api.runtime.KieContainer;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.rule.FactHandle;

import java.text.SimpleDateFormat;
import java.util.Date;

public class CashFlowMain {

public static void main(String[] args) throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat("-MM-dd");

KieContainer kc =
KieServices.Factory.get().getKieClasspathContainer();
KieSession ksession = kc.newKieSession("CashFlowKS");

AccountPeriod acp = new AccountPeriod();
acp.setStart(date("2013-01-01"));  // set acp - line 20
acp.setEnd(date("2013-03-31"));// set acp - line 21

Account ac = new Account(1, 0);

CashFlow cf1 = new CashFlow(date( "2013-01-12"), 100,
CashFlowType.CREDIT, 1 );
CashFlow cf2 = new CashFlow(date( "2013-02-2"), 200,
CashFlowType.DEBIT, 1 );
CashFlow cf3 = new CashFlow(date( "2013-05-18"), 50,
CashFlowType.CREDIT, 1 );
CashFlow cf4 = new CashFlow(date( "2013-03-07"), 75,
CashFlowType.CREDIT, 1 );

FactHandle fh = ksession.insert(acp);
ksession.insert( ac );

ksession.insert( cf1 );
ksession.insert( cf2 );
ksession.insert( cf3 );
ksession.insert( cf4 );

ksession.fireAllRules();

acp.setStart(date( "2013-04-01"));
acp.setEnd(date( "2013-06-31"));
ksession.update(fh, acp);


ksession.fireAllRules();
}

public static Date date(String str) throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat("-MM-dd");

return sdf.parse( str );
}


}





--
View this message in context: 
http://drools.46999.n3.nabble.com/java-lang-NullPointerException-in-simple-example-tp4028177.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] 5.6.0.cr1 Guvnor Release

2014-02-18 Thread gboro54
Final works just fine...Thanks!


anjana.ackroyd wrote
> http://downloads.jboss.org/drools/release/
> I dont see a CR1 why not use Final?
> 
> 
> On Tue, Feb 18, 2014 at 9:26 AM, gboro54 <

> gboro54@

> > wrote:
> 
>> Is there a built Guvnor artifact for expert 5.6.0.cr1? Using the 5.5.0
>> version of Guvnor against the 5.6.1 runtime does not work(as I would
>> expected). This is only a temporary until we get the knew kie-workbench
>> up
>> and running with Drools 6.
>>
>>
>>
>> --
>> View this message in context:
>> http://drools.46999.n3.nabble.com/5-6-0-cr1-Guvnor-Release-tp4028172.html
>> Sent from the Drools: User forum mailing list archive at Nabble.com.
>> ___
>> rules-users mailing list
>> 

> rules-users@.jboss

>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
> 
> ___
> rules-users mailing list

> rules-users@.jboss

> https://lists.jboss.org/mailman/listinfo/rules-users





--
View this message in context: 
http://drools.46999.n3.nabble.com/5-6-0-cr1-Guvnor-Release-tp4028172p4028176.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] 5.6.0.cr1 Guvnor Release

2014-02-18 Thread Anjana Ackroyd
http://downloads.jboss.org/drools/release/
I dont see a CR1 why not use Final?


On Tue, Feb 18, 2014 at 9:26 AM, gboro54  wrote:

> Is there a built Guvnor artifact for expert 5.6.0.cr1? Using the 5.5.0
> version of Guvnor against the 5.6.1 runtime does not work(as I would
> expected). This is only a temporary until we get the knew kie-workbench up
> and running with Drools 6.
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/5-6-0-cr1-Guvnor-Release-tp4028172.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

[rules-users] Drools with Microsoft SQL Server

2014-02-18 Thread 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:

  org.hibernate.ejb.HibernatePersistence
  jdbc/processInstanceDS
org.drools.persistence.info.SessionInfo
org.jbpm.persistence.processinstance.ProcessInstanceInfo
  org.drools.persistence.info.WorkItemInfo
  org.steward.care.fact.Account
  org.steward.care.fact.ObservationGroup
  org.steward.care.fact.ObservationParent
  org.steward.care.fact.Observation
  org.steward.care.fact.ClinicalRuleMatch
  org.steward.care.fact.Comorbidity
  org.steward.care.fact.OutboundNotice
  org.steward.care.fact.Medication
  org.steward.care.fact.data.CodedElement
  org.steward.care.fact.data.StructuredValue
  org.steward.care.fact.data.TriggerMatch
  
 
 
 
 
 
 
 
  
   

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 (0xFFFD) ***"
   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...@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...@steward.org
Steward Heath Care

[Description: cid:image001.png@01CD0DC1.C0D81BD0]

Office: 781-375-3034
Cell: 781-801-9313

<>___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] Help with event not found over window query

2014-02-18 Thread Wolfgang Laun
On 18/02/2014, daveor  wrote:
> Thanks for your email below. I needed to refactor my code somewhat to get
> this technique to work but it solved the problem that I had.

You're welcome. - That happens.

>
> I was previously using fireAllRules() but I refactored the code to use
> fireUntilHalt() instead, which required some additional work to make a
> couple of other supporting features behave properly. I know you don't
> strictly need to do this, but it needed to be done anyway and it made sense
> to do it now.
>

[snip]

> I would have thought it was quite a common scenario where someone wanted to
> implement business logic such as:
>
> - Something happens
> - It is expected that something else will happen within a certain time
> period of the first thing happening
> - If the second thing doesn't happen within the time period, generate an
> alert

Yes, it is, and you are in good company. - A thorough study of the
temporal operators or reading Hawking's A Short History of Time helps,
either one ;-)

>
> I ran into trouble because my various rules (from my original email)
> wouldn't fire an alert as expected when I fed in simulated events.
>
> I'm curious as to why you think it's interesting that the four rules below
> fail to meet my expectation? I suppose it's the fact that I'm a drools
> newbie and the issue here is probably just my inexperience mapping business
> logic into drools rules.

The word is "illuminative" rather than "interesting". Take this one:

$e1: Event($location: properties["location"] && ...)
not Event(, this after $e1)

The $e1 Event is here, Time is Now. It's most certainly true that
nothing is here after Now! - And the next one:

$e1: Event($location: properties["location"] && ...)
not Event(, this after[0, 1m] $e1)

Again, Event $e1 is here, Time is Now, and nothing is here after Now.
The operator does not instruct the Engine to wait!

Cheers
Wolfgang






>
> daveor
>
> On 15 Feb 2014, at 09:49, laune [via Drools] wrote:
>
>> It would be interesting to discuss why each of these four rules fails to
>> meet you expectation. Mostly it's due to the engine not evaluating
>> exactly one minute after the "certain event" arrives.
>>
>> The following rule fires 1 minute after the evaluation of the arrival
>> of an Event according to constraints and when no second Event
>> (according to constraints not shown) has arrived since then.
>>
>> rule "Something Else" dialect "mvel"
>> timer ( int: 1m )
>> when
>> $e1: Event($location: properties["location"] && ...)
>> not Event(..., this after $e1)
>> then
>>...
>> end
>>
>> -W
>>
>> On 14/02/2014, daveor <[hidden email]> wrote:
>>
>> > 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-query-tp4028129.html
>> > Sent from the Drools: User forum mailing list archive at Nabble.com.
>> > ___
>> > rules-users mail

[rules-users] 5.6.0.cr1 Guvnor Release

2014-02-18 Thread gboro54
Is there a built Guvnor artifact for expert 5.6.0.cr1? Using the 5.5.0
version of Guvnor against the 5.6.1 runtime does not work(as I would
expected). This is only a temporary until we get the knew kie-workbench up
and running with Drools 6. 



--
View this message in context: 
http://drools.46999.n3.nabble.com/5-6-0-cr1-Guvnor-Release-tp4028172.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Help with event not found over window query

2014-02-18 Thread daveor
Thanks for your email below. I needed to refactor my code somewhat to get this 
technique to work but it solved the problem that I had. 

I was previously using fireAllRules() but I refactored the code to use 
fireUntilHalt() instead, which required some additional work to make a couple 
of other supporting features behave properly. I know you don't strictly need to 
do this, but it needed to be done anyway and it made sense to do it now.

I would have thought it was quite a common scenario where someone wanted to 
implement business logic such as:

- Something happens
- It is expected that something else will happen within a certain time period 
of the first thing happening
- If the second thing doesn't happen within the time period, generate an alert

I ran into trouble because my various rules (from my original email) wouldn't 
fire an alert as expected when I fed in simulated events. 

I'm curious as to why you think it's interesting that the four rules below fail 
to meet my expectation? I suppose it's the fact that I'm a drools newbie and 
the issue here is probably just my inexperience mapping business logic into 
drools rules. 

daveor

On 15 Feb 2014, at 09:49, laune [via Drools] wrote:

> It would be interesting to discuss why each of these four rules fails to 
> meet you expectation. Mostly it's due to the engine not evaluating 
> exactly one minute after the "certain event" arrives. 
> 
> The following rule fires 1 minute after the evaluation of the arrival 
> of an Event according to constraints and when no second Event 
> (according to constraints not shown) has arrived since then. 
> 
> rule "Something Else" dialect "mvel" 
> timer ( int: 1m ) 
> when 
> $e1: Event($location: properties["location"] && ...) 
> not Event(..., this after $e1) 
> then 
>... 
> end 
> 
> -W 
> 
> On 14/02/2014, daveor <[hidden email]> wrote:
> 
> > 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-query-tp4028129.html
> > Sent from the Drools: User forum mailing list archive at Nabble.com. 
> > ___ 
> > rules-users mailing list 
> > [hidden email] 
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> ___ 
> rules-users mailing list 
> [hidden email] 
> https://lists.jboss.org/mailman/listinfo/rules-users
> 
> 
> If you reply to this email, your message will be added to the discussion 
> below:
> http://drools.46999.n3.nabble.com/Help-with-event-not-found-over-window-query-tp4028129p4028131.html
> To unsubscribe from Help with event not found over window query, click here.
> NAML





--
View this message in context: 
http://drools.46999.n3.nabble.com/Help-with-event-not-found-over-window-query-tp4028129p4028171.html
Sent from the Drools: User forum mailing list archive at Nabble.com.___
rules-users mailing list
rules-users@lis

Re: [rules-users] "in" syntax breaking the Rete Tree

2014-02-18 Thread droolster
Also, when I add this condition:

rule "ABC" 
when 
A ( $p : p ) 
B ( c < $p, c in (3,4), c > d  ) 
then 
System.out.println ("Hello"); 
end 

The Rete Tree looks like this: (is that correct?)

 



--
View this message in context: 
http://drools.46999.n3.nabble.com/in-operator-breaking-the-Rete-Tree-tp4028148p4028170.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] "in" syntax breaking the Rete Tree

2014-02-18 Thread droolster
I can't give you my exact code as it is company-sensitive code. But you can
test this against any POJO with a few int and Integer fields.

I'm trying to promote Drools Expert in my organisation so I would appreciate
your help. It's not causing a problem with rule evaluation. That is working
fine. But it doesn't look good when things which should be working are not.



--
View this message in context: 
http://drools.46999.n3.nabble.com/in-operator-breaking-the-Rete-Tree-tp4028148p4028169.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] "in" syntax breaking the Rete Tree

2014-02-18 Thread droolster
This even occurs in 5.6.0 - I went back to the old version thinking it maybe
the plugin for 6.0.0.Final. It's not, it's the same problem.

Both these rule definitions cause a problem in the Rete Tree viewer tab:

rule "ABC"
when
A ( $p : p )
B ( c < $p, c == 3 || c == 4  )
then
System.out.println ("Hello");
end

rule "ABC - 2nd version"
when
A ( $p : p )
B ( c < $p, c in (3, 4)  )
then
System.out.println ("Hello");
end

It causes a problem with one of the AlphaBaseVertex - it is NULL and the
Rete Tree render fails with a NULL pointer exeception. You can still see the
tree after but that node (alphbasevertex) has no properties when looking at
the property tab for it. The rules evaluate ok. But the corresponding
information is not in the Rete Tree diagram.



--
View this message in context: 
http://drools.46999.n3.nabble.com/in-operator-breaking-the-Rete-Tree-tp4028148p4028168.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] collect

2014-02-18 Thread Wolfgang Laun
On 18/02/2014, Raja Sekhar  wrote:
> 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.

What do you mean by "fails"? The rule should fire in any case.

This is not enough code for a check: Java code inserting the facts,
Java code defining the facts, complete text of the rule is required,
and Drools version.

-W

>  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"
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] collect

2014-02-18 Thread 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"
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] Attribute comparison thru decision table

2014-02-18 Thread bala.ganesh
Thanks Wolfgang. This really clarifies my doubt

-Bala

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun
Sent: Tuesday, February 18, 2014 5:13 PM
To: Rules Users List
Subject: Re: [rules-users] Attribute comparison thru decision table

If you look at the decision table examples in the Drools documentation you'll 
see that decision tables don't fit the pattern you have posted.

But you can rules to do what you want, and you'll need one rule for each 
comparison if a distinct action is to be performed for each inequality.

-W

On 18/02/2014, bala.gan...@accenture.com  wrote:
> 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
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




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


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Attribute comparison thru decision table

2014-02-18 Thread Wolfgang Laun
If you look at the decision table examples in the Drools documentation
you'll see that decision tables don't fit the pattern you have posted.

But you can rules to do what you want, and you'll need one rule for
each comparison if a distinct action is to be performed for each
inequality.

-W

On 18/02/2014, bala.gan...@accenture.com  wrote:
> 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
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Attribute comparison thru decision table

2014-02-18 Thread bala.ganesh
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
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

[rules-users] insertlogical

2014-02-18 Thread 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"
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] kieContainer version as LATEST for Drools 6

2014-02-18 Thread Rupesh M G
Thanks Mark. What is the tentative release date for 6.1.0.Final?

Regards,
Rupesh

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Mark Proctor
Sent: 17 February 2014 19:57
To: Rules Users List
Subject: Re: [rules-users] kieContainer version as LATEST for Drools 6

There were some bugs, these have been fixed in master.

Mark


On 17 Feb 2014, at 13:56, Rupesh M G 
mailto:rupesh.gopinat...@ibsplc.com>> wrote:


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 ).


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."
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



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."
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] Save "Business Processes" failure after rename in Drools Workbench (kie-6.1.0))

2014-02-18 Thread jorgehortelano
Yes, the action you have suggested works fine to avoid the isseu, thanks 
for your answer. I am glad to read that you already have fixed the bug.
You and your team are doing a great job!


El 17/02/2014 19:04, Tihomir Surdilovic [via Drools] escribió:
> Hi, thanks for pointing this out. It is indeed a bug I just fixed. For
> business processes it is required to close the editor after a rename and
> have the users reopen it under the renamed asset name.
>
> Hope this helps.
> Tiho
> On 2/17/14 6:42 AM, jorgehortelano wrote:
>
> > 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-rename-in-Drools-Workbench-kie-6-1-0-tp4028146.html
> > Sent from the Drools: User forum mailing list archive at Nabble.com.
> > ___
> > rules-users mailing list
> > [hidden email] 
> > https://lists.jboss.org/mailman/listinfo/rules-users
>
> ___
> rules-users mailing list
> [hidden email] 
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> 
> If you reply to this email, your message will be added to the 
> discussion below:
> http://drools.46999.n3.nabble.com/Save-Business-Processes-failure-after-rename-in-Drools-Workbench-kie-6-1-0-tp4028146p4028153.html
>  
>
> To unsubscribe from Save "Business Processes" failure after rename in 
> Drools Workbench (kie-6.1.0)), click here 
> .
> NAML 
> 
>  
>





--
View this message in context: 
http://drools.46999.n3.nabble.com/Save-Business-Processes-failure-after-rename-in-Drools-Workbench-kie-6-1-0-tp4028146p4028160.html
Sent from the Drools: User forum mailing list archive at Nabble.com.___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] "in" syntax breaking the Rete Tree

2014-02-18 Thread droolster
It's created in the normal way.

X x_obj = new X();
kSession.insert(x_obj);

I am using drools 6.0.1.Final.

I do not get a stack trace from Eclipse. But the null pointer exception is
displayed on screen when I click on the Rete Tree tab.





--
View this message in context: 
http://drools.46999.n3.nabble.com/in-operator-breaking-the-Rete-Tree-tp4028148p4028159.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users