[rules-users] question on adding manual workitem within flow editor

2009-07-27 Thread Pang, Yonghua
Hi,
I'm a newbie of Drools and I just met  a problem when learning Drools
Flow according to Drools online documents.

I create a workitem, Notification, exactly according to Chapter 8 in
Drools Flow Doc. I create MyWorkDefinitions.conf and
drools.rulebase.conf, and then put them in classpath. Also, I create one
image to be used by the item.

However, this new  workitem is not found in RuleFlow Editor. I'm not
sure if something else is needed. Can you guys please guide me to adding
new workitem and dragging/drawing it in RuleFlow Editor? 

FYI. Though the RuleFlow editor cannot work with the new workitem, the
XML style works. I mean, I could manually change the XML of .rf file to
use the new workitem. 
The work environment is JDK5, Drools5, Eclipse 3.4.5 and GEF 3.5.

The two conf files are also attached.


 drools.rulebase.conf  MyWorkDefinitions.conf 
Thanks,
Paul



drools.rulebase.conf
Description: drools.rulebase.conf


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


Re: [rules-users] question on adding manual workitem within flow editor

2009-07-27 Thread Alan . Gairey
You need to make sure that the folder that contains your .conf files is 
marked as a Source Folder within Eclipse - hopefully it should then work 
OK.

Alan
Tessella plc
26 The Quadrant, Abingdon Science Park, Abingdon, Oxfordshire, OX14 3YS
E: alan.gai...@tessella.com, T: +44 (0)1235 11, F: +44 (0)1235 553301
www.tessella.comRegistered in England No. 1466429
This message is commercial in confidence and may be privileged. It is 
intended for the addressee(s) only. Access to this message by anyone else 
is unauthorized and strictly prohibited. If you have received this message 
in error, please inform the sender immediately. Please note that messages 
sent or received by the Tessella e-mail system may be monitored and stored 
in an information retrieval system.




Pang, Yonghua yp...@statestreet.com 
Sent by: rules-users-boun...@lists.jboss.org
27/07/2009 08:15
Please respond to
Rules Users List rules-users@lists.jboss.org


To
rules-users@lists.jboss.org
cc

Subject
[rules-users] question on adding manual workitem within flow editor






Hi,
I’m a newbie of Drools and I just met  a problem when learning Drools Flow 
according to Drools online documents.
I create a workitem, Notification, exactly according to Chapter 8 in 
Drools Flow Doc. I create MyWorkDefinitions.conf and drools.rulebase.conf, 
and then put them in classpath. Also, I create one image to be used by the 
item.
However, this new  workitem is not found in RuleFlow Editor. I’m not sure 
if something else is needed. Can you guys please guide me to adding new 
workitem and dragging/drawing it in RuleFlow Editor? 
FYI. Though the RuleFlow editor cannot work with the new workitem, the XML 
style works. I mean, I could manually change the XML of .rf file to use 
the new workitem. 
The work environment is JDK5, Drools5, Eclipse 3.4.5 and GEF 3.5.
The two conf files are also attached.
drools.rulebase.conf MyWorkDefinitions.conf 
Thanks,
Paul___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users










drools.rulebase.conf
Description: Binary data


MyWorkDefinitions.conf
Description: Binary data
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] question on adding manual workitem within floweditor

2009-07-27 Thread Pang, Yonghua
Thanks for your quick response but actually I’ve set that folder as src folder 
to ensure the they are in classpath at runtime.

 

Paul  

 

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
alan.gai...@tessella.com
Sent: Monday, July 27, 2009 4:19 PM
To: Rules Users List
Subject: Re: [rules-users] question on adding manual workitem within floweditor

 


You need to make sure that the folder that contains your .conf files is marked 
as a Source Folder within Eclipse - hopefully it should then work OK.

Alan 

Tessella plc
26 The Quadrant, Abingdon Science Park, Abingdon, Oxfordshire, OX14 3YS
E: alan.gai...@tessella.com, T: +44 (0)1235 11, F: +44 (0)1235 553301
www.tessella.comRegistered in England No. 1466429 

This message is commercial in confidence and may be privileged. It is intended 
for the addressee(s) only. Access to this message by anyone else is 
unauthorized and strictly prohibited. If you have received this message in 
error, please inform the sender immediately. Please note that messages sent or 
received by the Tessella e-mail system may be monitored and stored in an 
information retrieval system. 





Pang, Yonghua yp...@statestreet.com 
Sent by: rules-users-boun...@lists.jboss.org 

27/07/2009 08:15 

Please respond to
Rules Users List rules-users@lists.jboss.org

To

rules-users@lists.jboss.org 

cc


Subject

[rules-users] question on adding manual workitem within flow editor

 






Hi, 

I’m a newbie of Drools and I just met  a problem when learning Drools Flow 
according to Drools online documents. 

I create a workitem, Notification, exactly according to Chapter 8 in Drools 
Flow Doc. I create MyWorkDefinitions.conf and drools.rulebase.conf, and then 
put them in classpath. Also, I create one image to be used by the item. 

However, this new  workitem is not found in RuleFlow Editor. I’m not sure if 
something else is needed. Can you guys please guide me to adding new workitem 
and dragging/drawing it in RuleFlow Editor? 

FYI. Though the RuleFlow editor cannot work with the new workitem, the XML 
style works. I mean, I could manually change the XML of .rf file to use the new 
workitem. 

The work environment is JDK5, Drools5, Eclipse 3.4.5 and GEF 3.5. 

The two conf files are also attached. 

drools.rulebase.conf MyWorkDefinitions.conf 

Thanks, 

Paul___
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 on adding manual workitem within floweditor

2009-07-27 Thread Alan . Gairey
Paul,

I don't know if the directory structure is significant, but I've attached 
a screenshot of how the files are configured within my project - with this 
structure, the work items appear in the RuleFlow editor. (I'm using 
Eclipse 3.5, but I'm pretty sure this should still work with earlier 
versions.)



Hope this helps,

Alan
Tessella plc
26 The Quadrant, Abingdon Science Park, Abingdon, Oxfordshire, OX14 3YS
E: alan.gai...@tessella.com, T: +44 (0)1235 11, F: +44 (0)1235 553301
www.tessella.comRegistered in England No. 1466429
This message is commercial in confidence and may be privileged. It is 
intended for the addressee(s) only. Access to this message by anyone else 
is unauthorized and strictly prohibited. If you have received this message 
in error, please inform the sender immediately. Please note that messages 
sent or received by the Tessella e-mail system may be monitored and stored 
in an information retrieval system.




Pang, Yonghua yp...@statestreet.com 
Sent by: rules-users-boun...@lists.jboss.org
27/07/2009 09:41
Please respond to
Rules Users List rules-users@lists.jboss.org


To
Rules Users List rules-users@lists.jboss.org
cc

Subject
Re: [rules-users] question on adding manual workitem within floweditor






Thanks for your quick response but actually I’ve set that folder as src 
folder to ensure the they are in classpath at runtime.
 
Paul  
 
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
alan.gai...@tessella.com
Sent: Monday, July 27, 2009 4:19 PM
To: Rules Users List
Subject: Re: [rules-users] question on adding manual workitem within 
floweditor
 

You need to make sure that the folder that contains your .conf files is 
marked as a Source Folder within Eclipse - hopefully it should then work 
OK.

Alan 
Tessella plc
26 The Quadrant, Abingdon Science Park, Abingdon, Oxfordshire, OX14 3YS
E: alan.gai...@tessella.com, T: +44 (0)1235 11, F: +44 (0)1235 553301
www.tessella.comRegistered in England No. 1466429 
This message is commercial in confidence and may be privileged. It is 
intended for the addressee(s) only. Access to this message by anyone else 
is unauthorized and strictly prohibited. If you have received this message 
in error, please inform the sender immediately. Please note that messages 
sent or received by the Tessella e-mail system may be monitored and stored 
in an information retrieval system. 



Pang, Yonghua yp...@statestreet.com 
Sent by: rules-users-boun...@lists.jboss.org 
27/07/2009 08:15 


Please respond to
Rules Users List rules-users@lists.jboss.org



To
rules-users@lists.jboss.org 
cc

Subject
[rules-users] question on adding manual workitem within flow editor
 








Hi, 
I’m a newbie of Drools and I just met  a problem when learning Drools Flow 
according to Drools online documents. 
I create a workitem, Notification, exactly according to Chapter 8 in 
Drools Flow Doc. I create MyWorkDefinitions.conf and drools.rulebase.conf, 
and then put them in classpath. Also, I create one image to be used by the 
item. 
However, this new  workitem is not found in RuleFlow Editor. I’m not sure 
if something else is needed. Can you guys please guide me to adding new 
workitem and dragging/drawing it in RuleFlow Editor? 
FYI. Though the RuleFlow editor cannot work with the new workitem, the XML 
style works. I mean, I could manually change the XML of .rf file to use 
the new workitem. 
The work environment is JDK5, Drools5, Eclipse 3.4.5 and GEF 3.5. 
The two conf files are also attached. 
drools.rulebase.conf MyWorkDefinitions.conf 
Thanks, 
Paul___
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








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


Re: [rules-users] question on adding manual workitemwithin floweditor

2009-07-27 Thread Pang, Yonghua
Hi Alan,

Thanks so much. It works! By mistake I put my .conf files directly in src 
folder rather than in META-INF. I the correct folder structure is  a must.

 

Regards, 
Paul

 

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
alan.gai...@tessella.com
Sent: Monday, July 27, 2009 4:49 PM
To: Rules Users List
Subject: Re: [rules-users] question on adding manual workitemwithin floweditor

 


Paul, 

I don't know if the directory structure is significant, but I've attached a 
screenshot of how the files are configured within my project - with this 
structure, the work items appear in the RuleFlow editor. (I'm using Eclipse 
3.5, but I'm pretty sure this should still work with earlier versions.) 

 

Hope this helps, 

Alan 

Tessella plc
26 The Quadrant, Abingdon Science Park, Abingdon, Oxfordshire, OX14 3YS
E: alan.gai...@tessella.com, T: +44 (0)1235 11, F: +44 (0)1235 553301
www.tessella.comRegistered in England No. 1466429 

This message is commercial in confidence and may be privileged. It is intended 
for the addressee(s) only. Access to this message by anyone else is 
unauthorized and strictly prohibited. If you have received this message in 
error, please inform the sender immediately. Please note that messages sent or 
received by the Tessella e-mail system may be monitored and stored in an 
information retrieval system. 





Pang, Yonghua yp...@statestreet.com 
Sent by: rules-users-boun...@lists.jboss.org 

27/07/2009 09:41 

Please respond to
Rules Users List rules-users@lists.jboss.org

To

Rules Users List rules-users@lists.jboss.org 

cc


Subject

Re: [rules-users] question on adding manual workitem withinfloweditor

 






Thanks for your quick response but actually I’ve set that folder as src folder 
to ensure the they are in classpath at runtime. 
  
Paul   
  
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
alan.gai...@tessella.com
Sent: Monday, July 27, 2009 4:19 PM
To: Rules Users List
Subject: Re: [rules-users] question on adding manual workitem within floweditor 
  

You need to make sure that the folder that contains your .conf files is marked 
as a Source Folder within Eclipse - hopefully it should then work OK.

Alan 

Tessella plc
26 The Quadrant, Abingdon Science Park, Abingdon, Oxfordshire, OX14 3YS
E: alan.gai...@tessella.com, T: +44 (0)1235 11, F: +44 (0)1235 553301
www.tessella.comRegistered in England No. 1466429 

This message is commercial in confidence and may be privileged. It is intended 
for the addressee(s) only. Access to this message by anyone else is 
unauthorized and strictly prohibited. If you have received this message in 
error, please inform the sender immediately. Please note that messages sent or 
received by the Tessella e-mail system may be monitored and stored in an 
information retrieval system. 

 

Pang, Yonghua yp...@statestreet.com 
Sent by: rules-users-boun...@lists.jboss.org 

27/07/2009 08:15 

 

Please respond to
Rules Users List rules-users@lists.jboss.org

 

To

rules-users@lists.jboss.org 

cc


Subject

[rules-users] question on adding manual workitem within flow editor


  

 






Hi, 

I’m a newbie of Drools and I just met  a problem when learning Drools Flow 
according to Drools online documents. 

I create a workitem, Notification, exactly according to Chapter 8 in Drools 
Flow Doc. I create MyWorkDefinitions.conf and drools.rulebase.conf, and then 
put them in classpath. Also, I create one image to be used by the item. 

However, this new  workitem is not found in RuleFlow Editor. I’m not sure if 
something else is needed. Can you guys please guide me to adding new workitem 
and dragging/drawing it in RuleFlow Editor? 

FYI. Though the RuleFlow editor cannot work with the new workitem, the XML 
style works. I mean, I could manually change the XML of .rf file to use the new 
workitem. 

The work environment is JDK5, Drools5, Eclipse 3.4.5 and GEF 3.5. 

The two conf files are also attached. 

drools.rulebase.conf MyWorkDefinitions.conf 

Thanks, 

Paul___
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








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


Re: [rules-users] Problem when using multiple rule files (Drools 5)

2009-07-27 Thread Wolfgang Laun
Could it be that the fact where the NPE happens during its insert contains a
field of some wrapper type (e.g.)Integer that's null and needs to be
converted to a simple type (e.g. int)?

But the same NPE should happen when you insert the same fact with rules
coming from a single file - but you'll know whether you have changed the
facts.

-W

On Sat, Jul 25, 2009 at 5:33 PM, Olaf Raether o.raet...@epro.de wrote:


 Mmmh,

 i still get an NPE but from a different function within
 ClassFieldReader.java

 with the 4.07 Api calls it was

 at org.drools.base.ClassFieldReader.isNullValue(ClassFieldReader.java:183)

 now its

 java.lang.NullPointerException
at
 org.drools.base.ClassFieldReader.getIndex(ClassFieldReader.java:78)
at

 org.drools.util.LeftTupleIndexHashTable.init(LeftTupleIndexHashTable.java:48)
at

 org.drools.util.LeftTupleIndexHashTable.init(LeftTupleIndexHashTable.java:35)
at

 org.drools.common.DoubleBetaConstraints.createBetaMemory(DoubleBetaConstraints.java:231)
at org.drools.reteoo.BetaNode.createMemory(BetaNode.java:340)
.

 i have no idea how to solve this at the moment.




 --
 View this message in context:
 http://www.nabble.com/Problem-when-using-multiple-rule-files-%28Drools-5%29-tp24623347p24658903.html
 Sent from the drools - user 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 Guvnor Remote API

2009-07-27 Thread Steve Ronderos
Does anyone know if there is a Remoting API in Guvnor? I see mention of it 
in some wiki pages, and in the web.xml in the Guvnor source. 

I'm trying to see if I can remotely trigger a build for a specific 
package, with a selector for the build, then create a snapshot for the 
same package.

If anyone has any information about the API please let me know.

Thanks,

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


Re: [rules-users] Drools Guvnor Remote API

2009-07-27 Thread David Sinclair
Steve,

I know there has been talk of a remoting API, but I am not sure where it is
at. JackRabbit has a RMI implementation that I use as part of my build
procedure to keep guvnor models in sync with the object model. You have to
export the repository as an RMI object, then connect to it like so

ClientRepositoryFactory factory = new ClientRepositoryFactory();
Repository repository = factory.getRepository(rmiURL);

Session session = repository.login(new SimpleCredentials(username,
password.toCharArray()));

rulesRepository = new RulesRepository(session);

dave

2009/7/27 Steve Ronderos steve.ronde...@ni.com


 Does anyone know if there is a Remoting API in Guvnor? I see mention of it
 in some wiki pages, and in the web.xml in the Guvnor source.

 I'm trying to see if I can remotely trigger a build for a specific package,
 with a selector for the build, then create a snapshot for the same package.

 If anyone has any information about the API please let me know.

 Thanks,

 Steve Ronderos
 ___
 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] Integrating Drools5.0 into J2EE APP

2009-07-27 Thread Sumant Kumar
Hi,

Can somebody describe in a high level how the Drools components ( 
Guvnor,Expert, etc) are integrated into J2EE app.
I am looking for these items as part of Drools deployment configuration
1) How are rules saved ( File system or DB )
2) How is rule versioning enabled ( with Subversion )
3) Rules and RuleSet granularity . How many rules should go in one DRL.
4) Facts: Are facts defined as POJOs and uploaded to Drools or Declarative 
FACTs are defined in Drools Guvnor

Any links over the web will be great too.

thanks
Sam


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


Re: [rules-users] Integrating Drools5.0 into J2EE APP

2009-07-27 Thread Mauricio Salatino
2009/7/27 Sumant Kumar amul...@yahoo.com:
 Hi,
 Can somebody describe in a high level how the Drools components (
 Guvnor,Expert, etc) are integrated into J2EE app.
 I am looking for these items as part of Drools deployment configuration

 1) How are rules saved ( File system or DB )
In guvnor (JCR)

 2) How is rule versioning enabled ( with Subversion )
In guvnor (JCR)

 3) Rules and RuleSet granularity . How many rules should go in one DRL.
It depends on your business model

 4) Facts: Are facts defined as POJOs and uploaded to Drools or Declarative
 FACTs are defined in Drools Guvnor
In guvnor (JCR)

 Any links over the web will be great too.
 thanks
 Sam

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





-- 
 - http://salaboy.wordpress.com
 - 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] Using eval in LHS

2009-07-27 Thread Greg Barton
See the attached project.  You can run it using maven with this command:

mvn package exec:java -Dexec.mainClass=com.sample.DroolsTest

There are three basic rules: 

MakeCollision: Detect that a collision has happened

MatchCollision: Match vehicles to collisions

IdentifyLargeCollision: Find collisions that are large

rule MakeCollision
salience 10
when
s : Sighting( collision == null )
not Collision( direction == s.direction, position == 
s.position, lane == s.lane )
then
Collision c = new Collision( s.direction, s.position, s.lane );
c.getSightings().add( s );
s.setCollision( c );
System.out.println(Creating  + c);
update( s );
insert( c );
end

rule MatchCollision
salience 10
when
s : Sighting( collision == null )
c : Collision( direction == s.direction, position == 
s.position, lane == s.lane )
then
c.getSightings().add( s );
s.setCollision( c );
System.out.println(Matching  + s);
update( s );
update( c );
end

rule IdentifyLargeCollision
salience 5
when
num : Number ( intValue  1 ) 
from accumulate (
Collision( sightings.size  2 ),
init( int count = 0; ),
action( count++; ),
reverse( count--; ),
result( count )
);  
then
System.out.println(Found  + num);
end

--- On Fri, 7/24/09, nash.8...@gmail.com nash.8...@gmail.com wrote:

 From: nash.8...@gmail.com nash.8...@gmail.com
 Subject: Re: [rules-users] Using eval in LHS
 To: Rules Users List rules-users@lists.jboss.org
 Date: Friday, July 24, 2009, 2:16 PM
 Thanks Greg.
 
 The reason I chose HashMap is that an accident is said to
 occur if and only if more than 1 vehicle contains  four
 consecutive position report as same. So in my hashmap key is
 vehicle id and value is the no. Of times same position
 report received... Can you suggest me a way to
 1. Collect all vehicles stopped at some point and the
 occurance of that event  is reported more than thrice
 2. Report accident if there are more than one vehicle found
 in step 1
   
 ---Priya
 -original message-
 Subject: Re: [rules-users] Using eval in LHS
 From: Greg Barton greg_bar...@yahoo.com
 Date: 24/07/2009 10:36 pm
 
 
 Try this:
 
 rule Create Collision Location
     salience 90
     no-loop true
 when
     vehLoc : VehicleLocation()
     not CollisionLocation(xway == vehLoc.xway,
 pos ==
 vehLoc.pos, dir == vehLoc.dir, lane == vehLoc.lane)
 then
     CollisionLocation collisionLoc = new
 CollisionLocation(vehLoc.getXway(),
 vehLoc.getPos(), vehLoc.getDir(), vehLoc.getLane());
     insert(collisionLoc);
 end
 
 rule Collect Collided Vehicles
     salience 90
     no-loop true
 when
     vehLoc : VehicleLocation()
     $collisionLoc : CollisionLocation(xway ==
 vehLoc.xway, pos ==
 vehLoc.pos, dir == vehLoc.dir, lane == vehLoc.lane)
 then
    
 collisionLoc.getVehicleLocations().add(vehLoc);
     update(collisionLoc);
 end
 
 And now, the rule that detects more than three coinciding
 vehicle locations is simple:
 
 rule Detect Too Many
 when
     CollisionLocation(vehicleLocations.size 
 2)
 then
     ...foo...
 end
 
 And, if you want to make the execution a bit more
 efficient, put a reference in VehicleLocation to it's
 associated CollisionLocation.  That way you can have
 vehLoc : VehicleLocation(collisionLocation == null) to
 reduce partial matches.
 
 --- On Fri, 7/24/09, PriyaSha nash.8...@gmail.com
 wrote:
 
  From: PriyaSha nash.8...@gmail.com
  Subject: [rules-users]  Using eval in LHS
  To: rules-users@lists.jboss.org
  Date: Friday, July 24, 2009, 10:45 AM
  
  Input: 
  0,0,107,32,0,0,0,10,53320,-1,-1,-1,-1,-1,-1
  0,0,107,32,0,0,0,10,53320,-1,-1,-1,-1,-1,-1
  0,0,107,32,0,0,0,10,53320,-1,-1,-1,-1,-1,-1
  0,0,107,32,0,0,0,10,53320,-1,-1,-1,-1,-1,-1
  0,0,109,20,0,0,0,19,100644,-1,-1,-1,-1,-1,-1
  0,0,109,20,0,0,0,19,100644,-1,-1,-1,-1,-1,-1
  0,0,106,28,0,0,0,26,137745,-1,-1,-1,-1,-1,-1
  0,0,108,32,0,0,0,67,354281,-1,-1,-1,-1,-1,-1
  0,0,105,30,0,0,1,94,501089,-1,-1,-1,-1,-1,-1
  
  Problem:
  
  Should find vehicles with same data (if it occurs more
 than
  thrice).
  
  Though eval in rule 'Detect Accident' results in
 true,
  consequence is not
  fired.
  
  Output:
  
  Added
  Not Found -- 107---2
  test---2107
  Not Found -- 107---3
  test---3107
  Not Found -- 107---4
  test---4107
  no of veh : 1
  no of veh : 1
  no of veh : 1
  Not Found -- 109---5
  test---1109
  Not Found -- 109---6
  test---2109
  Not Found -- 106---7
  
  Please find the DRL below.
  
  
  package com.hp.hpl.CHAOS.LR;
  
  # 

Re: [rules-users] Run Drool Application From Command Prompt

2009-07-27 Thread Pankaj . Jain
Hi

I still have not got any solution of my problem that I posted previously. 
I have included all required jar files and set proper class path .. Please 
do help ?

problem: 

I am trying to integrate Drool with ofbiz and run application from command 
prompt. In one way I have integrated it properly and I am able to run it 
successfully. 

Code : Which I was using initially 

KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); 


or 

PackageBuilderConfiguration cfg = new PackageBuilderConfiguration(); 
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); 


Exception I got : 

org.drools.RuntimeDroolsException: Unable to load dialect 
'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java 
:org.drools.rule.builder.dialect.java.JavaDialectConfiguration' 
at 
org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:274)
 
at 
org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:259)
 


at 
org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:176)
 
at 
org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:153)
 
at org.drools.compiler.PackageBuilder.init(PackageBuilder.java:242) 
. 
. 
. 
Caused by: java.lang.NullPointerException 
at 
org.drools.rule.builder.dialect.java.JavaDialectConfiguration.setCompiler(JavaDialectConfiguration.java:92)
 
at 
org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(JavaDialectConfiguration.java:55)
 
at 
org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:270
 


Problem I found : 
In the class JavaDialectConfiguration in jar file drools-compiler.jar 
there is a method named setCompliler,  in this method Null Pointer 
Exception was coming. 

Solution I provided : 
In my application I created my custom class CustomJavaDialectConfiguration 
by extending to class JavaDialectConfiguration, In this class I overrided 
the method setCompiler. My method was exactly same as that of method 
setCompiler in JavaDialectConfiguration . To call my dialect class I also 
overrided the method addDialect of PackageBuilderConfiguration class . 
For that I created class CustomPackageBuilderConfiguration by extending to 
PackageBuilderConfiguration. 
after that I wrote the code: 

PackageBuilderConfiguration cfg = new CustomPackageBuilderConfiguration(); 

KnowledgeBuilder kbuilder = 
KnowledgeBuilderFactory.newKnowledgeBuilder(cfg); 


Now application is running perfectly fine from both eclipse and command 
prompt without any exception. 

I want to know as my overrided method setCompiler was exactly same then 
why I had to override method, and In original code (ie in 
drools-compiler.jar file) why it was giving exception  ???  Was that due 
to class lader or something else ??  Please do help in this regard  

 

Thanks  Regards:

Pankaj Jain | LT infotech |Navi Mumbai
Mobile: +91 9920218945
Email : pankaj.j...@lntinfotech.com
www.Lntinfotech.com

Whatever the mind of man can conceive  believe, it can achieve.

Larsen  Toubro Infotech Ltd.
www.Lntinfotech.com

This Document is classified as: 

LT Infotech Proprietary   LT Infotech Confidential   LT Infotech 
Internal Use Only   LT Infotech General Business 

This Email may contain confidential or privileged information for the 
intended recipient (s) If you are not the intended recipient, please do 
not use or disseminate the information, notify the sender and delete it 
from your system. 

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