Re: [rules-users] Inserting Different Objects Of Same Class !

2012-11-27 Thread abhinay_agarwal
So i can consider that there is no other way out :(

Neways, Thanks for the quick replies !
You guys rock !



--
View this message in context: 
http://drools.46999.n3.nabble.com/Inserting-Different-Objects-Of-Same-Class-tp4020971p4020976.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] Inserting Different Objects Of Same Class !

2012-11-27 Thread Wolfgang Laun
Yet another way would be to insert each List into a different entry point
so that you might write

   List( ... ) from entry-point ListA

AFAIK, you don't have a way of matching any List, though.

-W



On 27/11/2012, Esteban Aliverti esteban.alive...@gmail.com wrote:
 Well, there could be another way using one global for each of your lists
 (the lists should be inserted as fact just like you are doing) and then
 doing something like List( this == globalListA), but I never tried
 something like that.
 I think Wolfgang's recommendation (which is the same you have proposed) is
 the most elegant solution.

 Best Regards,


 

 Esteban Aliverti
 - Blog @ http://ilesteban.wordpress.com


 On Tue, Nov 27, 2012 at 10:28 AM, abhinay_agarwal 
 abhinay_agar...@infosys.com wrote:

 So i can consider that there is no other way out :(

 Neways, Thanks for the quick replies !
 You guys rock !



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Inserting-Different-Objects-Of-Same-Class-tp4020971p4020976.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


Re: [rules-users] Inserting Different Objects Of Same Class !

2012-11-27 Thread Wolfgang Laun
Entry points are partitions of Working Memory. See the Fusion
manual and Drools' javadoc.

List?  listA = ...
WorkingMemoryEntryPoint epListA =
kSession.getWorkingMemoryEntryPoint( listA );
epListA.insert( listA );

rule matchListA
when
List(...) from entry-point listA
then

That's about all there is to it.
-W

On 27/11/2012, abhinay_agarwal abhinay_agar...@infosys.com wrote:
 entry point ??

 can yu throw me some light on entry points ?



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Inserting-Different-Objects-Of-Same-Class-tp4020971p4020980.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 Planner: Planning variable gets assigned value out of valueRange

2012-11-27 Thread mr_moe
Hey,

I have a planning entity, which has one planning variable called startDate.
This variable has a defined discrete value range which is a list of numbers
of the type long. Every number represents a timestamp, which is in between
the number firstPossibleStartDate and lastPossibleStartDate.

During the planning process, the number 0 is sometimes assigned to the
planning variable which is definitely not part of the valueRange. I’ve
printed the list to the console, but all values in the list are fine.

Because every planning entity has its own valueRange, the range is defined
in the entity itself.

At the moment I’ve implemented my own mover, but the problem occurs also
with pre-configured mover.

During my research I’ve stumbled upon the following note in the Planner
Documentation: 
ValueRange from planning entity is currently not yet supported by the new
MoveSelectors.
Does this has something to do with my problem?

Enclosed you will find the code of the planning entity.

@PlanningEntity
public class DroolTask {
private ListLong startDateList;
private int id;
private String name;
private long duration;
private long firstPossibleStartDate;
private long lastPossibleStartDate;
private String nextTask = ;
private String previousTask = ;

// Planning variables: changes during planning, between score 
calculations.
private long startDate;

@PlanningVariable
@ValueRange(type = ValueRangeType.FROM_PLANNING_ENTITY_PROPERTY,
planningEntityProperty = startDateList)
public long getStartDate(){
return startDate;
}

public void setStartDate(long startDate){
this.startDate = startDate;
}


public ListLong getStartDateList(){
return this.startDateList;
}

public void setStartDateList(){
startDateList = getPossibleStartDate();
}

public ListLong getPossibleStartDate(){
startDateList = new ArrayListLong();
for(long i = firstPossibleStartDate; i=lastPossibleStartDate; 
i = i +
60){
startDateList.add(i);
}
return startDateList;
}

public Long getFirstPossibleStartDate(){
return firstPossibleStartDate;
}

public void setFirstPossibleStartDate(long firstPossibleStartDate){
this.firstPossibleStartDate = firstPossibleStartDate;
}

public Long getLastPossibleStartDate(){
return lastPossibleStartDate;
}

public void setLastPossibleStartDate(long lastPossibleEndDate){
this.lastPossibleStartDate = lastPossibleEndDate;
}

[...]


public DroolTask clone(){
DroolTask clone = new DroolTask();

clone.name = name;
clone.duration = duration;
clone.firstPossibleStartDate = firstPossibleStartDate;
clone.lastPossibleStartDate = lastPossibleStartDate;
clone.startDate = startDate;
clone.nextTask = nextTask;
clone.previousTask = previousTask;
clone.startDateList = startDateList;

return clone;
}

[...]
}

It would be great, if someone could give me a hint.
Many thanks,

Moe



--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-Planner-Planning-variable-gets-assigned-value-out-of-valueRange-tp4020984.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] Question about drools-spring in a multi-treaded container (like tomcat).

2012-11-27 Thread Gurvinder Narula1
Hello all,

I've been reading up about drool-spring integration and have put together a 
simple project that wires together a KnowledgeBase and KnowledgeSession as 
follows :


drools:resource id=GroupUnit type=DRL

source=file:/Users/drools/drools-spring-test/src/Rules/drls/GroupUnit.drl /

drools:resource id=GradeUnit type=DRL

source=file:/Users/drools/drools-spring-test/src/Rules/drls/GradeUnit.drl /

drools:resource id=EvaluateUnit type=DRL

source=file:/Users/drools/drools-spring-test/src/Rules/drls/EvaluateUnit.drl 
/

drools:grid-node id=node1 /

drools:kbase id=kbase1 node=node1

drools:resources

drools:resource ref=GroupUnit /

drools:resource ref=GradeUnit /

drools:resource ref=EvaluateUnit /

/drools:resources

/drools:kbase

drools:ksession id=ksession type=stateful kbase=kbase1

node=node1 /

Then in my Controller call, I 'AutoWire' in the StatefulKnowledgeSession as 
follows :


@Controller

@RequestMapping( value = foo )

final class FooController{



   @Autowired

   StatefulKnowledgeSession ksession;



   @RequestMapping(  method = RequestMethod.GET )

   @ResponseBody

   public String evaluateUnit() {



Unit unit = new Unit(030, 502, C, 9484, 45, new String[] {},

null);



  if (ksession != null) {

  ksession.fireAllRules();

  ksession.insert(unit);

  ksession.fireAllRules();

  return UnitCategory + unit.getUnitCategory() + /UnitCategory;

  }

  else

  return message stateful session is null/message;

   }


The main question that I have is that – is this solution thread-safe ? From 
what I understand of spring is that beans configured without any additional 
qualifiers are inherently singletons. And when deployed in a multi-theaded 
container like tomcat, Spring assumes that the beans being severed up a 
thread-safe. So from I have read is that KnowledeSessions are inherently not 
thread safe. So putting the 2 together, I leaning towards the assessment that 
this above solution is NOT thread safe and that if I do want it to be thread 
safe I should set the StatefulKnowledgeSession to 'prototype' and not leave it 
as a singleton.

Please let me know if I'm missing anything in my assessment here !

Thanks in advance,
Gurvinder




This message is intended only for the individual or entity to which it is 
addressed. It may contain privileged, confidential information which is exempt 
from disclosure under applicable laws. If you are not the intended recipient, 
please note that you are strictly prohibited from disseminating or distributing 
this information (other than to the intended recipient) or copying this 
information. If you have received this communication in error, please notify us 
immediately by e-mail or by telephone at the above number. Thank you.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Drools response time

2012-11-27 Thread elMateo
Dear all,

I need to develop an Expert System for a new project and I want to use
Drools, butI have some restrictions.

The most important restriction: response time of the application must be
less than one second. Also, the application access to one data base to
retrieve some information and send it to the expert systetm.

With this information, can anyone tell me, approximately, the response time
of  Drools? It is very important to can use Drools in this project. And we
like very much to use it. (We use in other projects without these
restrictions).

Thank in advance.

Best regards, Jesús.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools response time

2012-11-27 Thread Mauricio Salatino
Hi Jesus,
Well do you want us to include the response time for your Database?
The Drools Rule engine will keep all your facts inside the main memory
(RAM) so it will be fast, but if you need to retrieve data from your
database, you will need to take that into account. Depending on how you are
doing that and how much data do you want to bring will be the response
times.

Cheers


On Tue, Nov 27, 2012 at 3:06 PM, elMateo soyelma...@gmail.com wrote:

 Dear all,

 I need to develop an Expert System for a new project and I want to use
 Drools, butI have some restrictions.

 The most important restriction: response time of the application must be
 less than one second. Also, the application access to one data base to
 retrieve some information and send it to the expert systetm.

 With this information, can anyone tell me, approximately, the response
 time of  Drools? It is very important to can use Drools in this project.
 And we like very much to use it. (We use in other projects without these
 restrictions).

 Thank in advance.

 Best regards, Jesús.

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




-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] Drools response time

2012-11-27 Thread Lukáš Petrovický
Mauricio Salatino píše v Út 27. 11. 2012 v 15:11 +:
 Well do you want us to include the response time for your Database? 
 The Drools Rule engine will keep all your facts inside the main memory
 (RAM) so it will be fast, but if you need to retrieve data from your
 database, you will need to take that into account. Depending on how
 you are doing that and how much data do you want to bring will be the
 response times. 

Going low-level, your standard Oracle JRE / OpenJDK doesn't guarantee
response time. If it is a hard requirement to have timely responses,
you'll have to buy a real-time JRE from some commercial vendor.

Regards!

-- 
Lukáš Petrovický
QE Lead, JBoss Enterprise BRMS
Phone: +420 532 294 123
irc: lpetrovi, triceo

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


Re: [rules-users] Drools response time

2012-11-27 Thread elMateo
Thank for your response, Mauricio and Lukas!

BR, Jesús.


On Tue, Nov 27, 2012 at 4:17 PM, Lukáš Petrovický lpetr...@redhat.comwrote:

 Mauricio Salatino píše v Út 27. 11. 2012 v 15:11 +:
  Well do you want us to include the response time for your Database?
  The Drools Rule engine will keep all your facts inside the main memory
  (RAM) so it will be fast, but if you need to retrieve data from your
  database, you will need to take that into account. Depending on how
  you are doing that and how much data do you want to bring will be the
  response times.

 Going low-level, your standard Oracle JRE / OpenJDK doesn't guarantee
 response time. If it is a hard requirement to have timely responses,
 you'll have to buy a real-time JRE from some commercial vendor.

 Regards!

 --
 Lukáš Petrovický
 QE Lead, JBoss Enterprise BRMS
 Phone: +420 532 294 123
 irc: lpetrovi, triceo

 ___
 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


Re: [rules-users] Question about drools-spring in a multi-treaded container (like tomcat).

2012-11-27 Thread Mattias Nilsson Grip
Hi Gurvinder,

knowledge sessions are not thread-safe so I believe your assumptions are 
correct. To be on the safe side you should change the ksession bean to have 
scope prototype.

Regards,
Mattias

- Original Message -
 From: Gurvinder Narula1 gnaru...@la-z-boy.com
 To: rules-users@lists.jboss.org
 Sent: Tuesday, 27 November, 2012 3:08:18 PM
 Subject: [rules-users] Question about drools-spring in a multi-treaded 
 container (like tomcat).
 
 Hello all,
 
 I've been reading up about drool-spring integration and have put
 together a simple project that wires together a KnowledgeBase and
 KnowledgeSession as follows :
 
 
  drools:resource id = GroupUnit type = DRL
 source =
 file:/Users/drools/drools-spring-test/src/Rules/drls/GroupUnit.drl
 /
 
  drools:resource id = GradeUnit type = DRL
 source = 
 file:/Users/drools/drools-spring-test/src/Rules/drls/GradeUnit.drl
  /
 
  drools:resource id = EvaluateUnit type = DRL
 source =  file:/Users/drools/drools-spring-test/src/Rules/drls/
 EvaluateUnit .drl  /
 
  drools:grid-node id = node1 /
  drools:kbase id = kbase1 node = node1 
  drools:resources 
  drools:resource ref = GroupUnit /
  drools:resource ref = GradeUnit /
  drools:resource ref = EvaluateUnit /
 / drools:resources 
 / drools:kbase 
 
  drools:ksession id = ksession type = stateful kbase = kbase1
 node = node1 /
 
...
 
 The main question that I have is that – is this solution thread-safe
 ? From what I understand of spring is that beans configured without
 any additional qualifiers are inherently singletons. And when
 deployed in a multi-theaded container like tomcat, Spring assumes
 that the beans being severed up a thread-safe. So from I have read
 is that KnowledeSessions are inherently not thread safe. So putting
 the 2 together, I leaning towards the assessment that this above
 solution is NOT thread safe and that if I do want it to be thread
 safe I should set the StatefulKnowledgeSession to 'prototype' and
 not leave it as a singleton.
 
 Please let me know if I'm missing anything in my assessment here !
 
 Thanks in advance,
 Gurvinder
 
 This message is intended only for the individual or entity to which
 it is addressed. It may contain privileged, confidential information
 which is exempt from disclosure under applicable laws. If you are
 not the intended recipient, please note that you are strictly
 prohibited from disseminating or distributing this information
 (other than to the intended recipient) or copying this information.
 If you have received this communication in error, please notify us
 immediately by e-mail or by telephone at the above number. Thank
 you.
 ___
 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


Re: [rules-users] Inserting Different Objects Of Same Class !

2012-11-27 Thread Greg Barton
Are the values in the list ever tested? (With rules conditionally firing if the 
contents of a list changes.)  In the rules you've provided so far they are not. 
 If this is the case then there's no need to match them in the conditions and 
the use of globals is just fine.  The only reason to match a list in the rule 
conditions is if changing the list could result in that rule firing.



 From: abhinay_agarwal abhinay_agar...@infosys.com
To: rules-users@lists.jboss.org 
Sent: Tuesday, November 27, 2012 4:36 AM
Subject: Re: [rules-users] Inserting Different Objects Of Same Class !
 
I was initially using two lists making them global, and it was working for
me, but then i read 

Globals are not designed to share data between rules and they should never
be used for that purpose. Rules always reason and react to the working
memory state, so if you want to pass data from rule to rule, assert the data
as facts into the working memory.

So, thought might be somewhere, an issue can arise and changed the global
facts.

Thanks,
AA



--
View this message in context: 
http://drools.46999.n3.nabble.com/Inserting-Different-Objects-Of-Same-Class-tp4020971p4020981.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


Re: [rules-users] rules-users Digest, Vol 72, Issue 55

2012-11-27 Thread Gurvinder Narula1
Hi Mattias,


Thanks for the clarification. Appreciate the quick response.

Gurvinder



On 11/27/12 12:00 PM, rules-users-requ...@lists.jboss.org
rules-users-requ...@lists.jboss.org wrote:

Send rules-users mailing list submissions to
   rules-users@lists.jboss.org

To subscribe or unsubscribe via the World Wide Web, visit
   https://lists.jboss.org/mailman/listinfo/rules-users
or, via email, send a message with subject or body 'help' to
   rules-users-requ...@lists.jboss.org

You can reach the person managing the list at
   rules-users-ow...@lists.jboss.org

When replying, please edit your Subject line so it is more specific
than Re: Contents of rules-users digest...


Today's Topics:

   1. Drools response time (elMateo)
   2. Re: Drools response time (Mauricio Salatino)
   3. Re: Drools response time (Luk?? Petrovick?)
   4. Re: Drools response time (elMateo)
   5. Re: Question about drools-spring in a multi-treaded container
  (like tomcat). (Mattias Nilsson Grip)
   6. Re: Inserting Different Objects Of Same Class ! (Greg Barton)


--

Message: 1
Date: Tue, 27 Nov 2012 16:06:58 +0100
From: elMateo soyelma...@gmail.com
Subject: [rules-users] Drools response time
To: Rules Users List rules-users@lists.jboss.org
Message-ID:
   CAKx6_9aEY2GEYoY0LmWUcW2DyyPYmX_sAAFr=ou_u4dxub4...@mail.gmail.com
Content-Type: text/plain; charset=iso-8859-1

Dear all,

I need to develop an Expert System for a new project and I want to use
Drools, butI have some restrictions.

The most important restriction: response time of the application must be
less than one second. Also, the application access to one data base to
retrieve some information and send it to the expert systetm.

With this information, can anyone tell me, approximately, the response
time
of  Drools? It is very important to can use Drools in this project. And we
like very much to use it. (We use in other projects without these
restrictions).

Thank in advance.

Best regards, Jes?s.
-- next part --
An HTML attachment was scrubbed...
URL:
http://lists.jboss.org/pipermail/rules-users/attachments/20121127/7bb4a857
/attachment-0001.html

--

Message: 2
Date: Tue, 27 Nov 2012 15:11:12 +
From: Mauricio Salatino sala...@gmail.com
Subject: Re: [rules-users] Drools response time
To: Rules Users List rules-users@lists.jboss.org
Message-ID:
   canzbnyvqkmbthv7txmuov2ajvq3bnqfpayd3c-+yxs-jffa...@mail.gmail.com
Content-Type: text/plain; charset=iso-8859-1

Hi Jesus,
Well do you want us to include the response time for your Database?
The Drools Rule engine will keep all your facts inside the main memory
(RAM) so it will be fast, but if you need to retrieve data from your
database, you will need to take that into account. Depending on how you
are
doing that and how much data do you want to bring will be the response
times.

Cheers


On Tue, Nov 27, 2012 at 3:06 PM, elMateo soyelma...@gmail.com wrote:

 Dear all,

 I need to develop an Expert System for a new project and I want to use
 Drools, butI have some restrictions.

 The most important restriction: response time of the application must be
 less than one second. Also, the application access to one data base to
 retrieve some information and send it to the expert systetm.

 With this information, can anyone tell me, approximately, the response
 time of  Drools? It is very important to can use Drools in this project.
 And we like very much to use it. (We use in other projects without these
 restrictions).

 Thank in advance.

 Best regards, Jes?s.

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




--
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

 - Salatino Salaboy Mauricio -
-- next part --
An HTML attachment was scrubbed...
URL:
http://lists.jboss.org/pipermail/rules-users/attachments/20121127/beb25222
/attachment-0001.html

--

Message: 3
Date: Tue, 27 Nov 2012 16:17:02 +0100
From: Luk?? Petrovick? lpetr...@redhat.com
Subject: Re: [rules-users] Drools response time
To: rules-users@lists.jboss.org
Message-ID: 1354029422.7785.3.camel@steam
Content-Type: text/plain; charset=UTF-8

Mauricio Salatino p??e v ?t 27. 11. 2012 v 15:11 +:
 Well do you want us to include the response time for your Database?
 The Drools Rule engine will keep all your facts inside the main memory
 (RAM) so it will be fast, but if you need to retrieve data from your
 database, you will need to take that into account. Depending on how
 you are doing that and how much data do you want to bring will be the
 response times.

Going low-level, your standard Oracle JRE / OpenJDK doesn't guarantee
response time. If it is a hard requirement to have timely

Re: [rules-users] Inserting Different Objects Of Same Class !

2012-11-27 Thread abhinay_agarwal
Tnxx Laune, i ll have a look to it !!

Tnxx Greg, things are more clear now !



--
View this message in context: 
http://drools.46999.n3.nabble.com/Inserting-Different-Objects-Of-Same-Class-tp4020971p4020993.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