Re: [rules-users] ClassCastException and other problems

2008-06-10 Thread Nagaraju runkana
Hi Edson,

i have some problem...
*core_preference_text* this my table name.Row like VARIABLE_CODE
VARCHAR2(60 BYTE)

i need write dsl,dslr files related data validation to the table.
1. variable_code should be unieque per enterprise_id
2. variable_code can not be updated


give me some suggestion ..how to write dsl,dslr file related two
conditions.ASAP..

=
Chanti


On Fri, Jun 6, 2008 at 8:19 PM, Edson Tirelli [EMAIL PROTECTED] wrote:



   Drools 5 implements a completely new propagation algorithm that
 allowed us to get rid of shadow proxies from the core engine. So, you will
 not have the problem.

   But for 4.0.x, if you are a community user, best you can do is open a
 JIRA with a test case to reproduce your problem. If we release a 4.0.8
 version, we can fix your issue there, but at this moment we don't know if
 there will be a 4.0.8 release or if the next release will be 5.0.
   If you are a Drools subscriber at Red Hat, then you can simply open a
 support case there and they will fix and provide a patch for you.


   []s
   Edson



 2008/6/6 Sibylle Duerr [EMAIL PROTECTED]:

 Thanks Edson,

 but the collections do return an empty collection. hm, I just tested this
 ones again and it worked fine. no exception when the set was empty. I will
 keep an eye on this and test some more but seems to work now for me.

 and for the other problem I then hope for 5.0 :).

 and what about the last problem I described before?

 best regards
 Sibylle



 Edson Tirelli wrote:



   Sibylle,

   Unfortunately, this is the way it was implemented to be, under a
 kind-of fail-fast philosophy we were following. I do think there is value
 in changing things in 5.0 so that, for instance:

 ProcessModel($activities : activities) from $models

   Simply does not match, instead of raises a CCE, in case the model is a
 TypeModel.
   But for 4.0.x, that is how things work.

The only suggestion I can give you is, in your second problem, to not
 return null on your collections. Simply return empty collections:

 class Project {
   ...
   public List getModels() {
if( this.models == null ) {
return Collections.emptyList();
}
return this.models;
   }
   ...
 }
 This is usually a good thing, unless you have a specific semantics
 for null collections in your domain model.

[]s
Edson

 2008/6/6 Sibylle Duerr [EMAIL PROTECTED]:

Hi there,

I have three issues, where I'm not sure if these are bugs in
drools, or if this is just the way it has to be.

the used classes in this case are:

Project
Model
ProcessModel extends Model

only the Project is in the working memory, because I didn't want
to load all elements due to performance issues (there can be
thousends of elements to load at startup).

if I have the following rule:

Project($models : models)
ProcessModel($activities : activities) from $models

there happen to be two problems. if the project does not only
contain ProcessModels but also TypeModels or others (all extend
Model), this leads to a ClassCastException.
I can solve this by writing the rule as follows:

Project($models : models)
$m : Model(eval($m instanceof ProcessModel)) from $models
ProcessModel($activities : activities) from $m

but this is not really nice and I hope there is a better solution
for this, is there?

the second problem this rule gives me, is when the set 'models' is
empty. that will also throw an exception. to solve this I write:

$p : Project(eval($p.hasModels()), $models : models)
$m : Model(eval($m instanceof ProcessModel)) from $models
ProcessModel($activities : activities) from $m

and I need to use this in each case where I have possible empty sets.


the last problem I encountered when I tried to load all elements
to the working memory and then redefine some rules. used classes:

Aggregation extends DomainElement

rule:

Aggregation(owner.owner != type.owner)

causes some exception. the root exception is a ClassCastException:
ProxyShadowProxy cannot be cast to Aggregation.
when I rewrite the rule as:

$element : DomainElement(eval($element instanceof Aggregation))
Aggregation(owner.owner != type.owner) from $element

everything works fine. but that again is not a nice solution.

any help?

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




 --
 Edson Tirelli
 JBoss Drools Core Development
 Office: +55 11 3529-6000
 Mobile: +55 11 9287-5646
 JBoss, a division of Red Hat @ www.jboss.com http://www.jboss.com
 

 ___
 rules-users mailing list
 

[rules-users] How to write related table dsl,dslr files

2008-06-10 Thread Nagaraju runkana
Hi ,

i have some problem...
core_preference_text this my table name.Row like VARIABLE_CODE VARCHAR2(60
BYTE)

i need write dsl,dslr files related data validation to the table.

1. variable_code should be unieque per enterprise_id
2. variable_code can not be updated


give me some suggestion ..how to write dsl,dslr file related two
conditions.ASAP..

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


[rules-users] JSR-94 and JEE integration

2008-06-10 Thread Knoster
Hi,
i would like to integrate drools in jee. to be more flexible i was loking
at jsr-94. as i suppose jsr-94 only addresses j2se environment, my
question is: how it is possible to use drools with this specs from an ejb3
session bean? my thoughts about this brought me to the idea of injecting
the rules-administrator via resource annotation to prevent the container
always doing a class.forname(..) lookup. to define a j2se resource in a
jee container a jca might be the best way to integrate and to assure the
jee specs will not be violated. but this seams a lot of overhead to me.
how do u use drools in your jee applications when not relying on the brms?
any help or ideas on integrating drools with jsr-94 in jee would be great.

Knosta



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


RE: [rules-users] JSR-94 and JEE integration

2008-06-10 Thread Hehl, Thomas
I know nothing about jsr-94, but we use drools in a webapp, servlet side
only.

It seems to me you could simply put your rules into a stateless session
bean.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Knoster
Sent: Tuesday, June 10, 2008 4:46 AM
To: rules-users@lists.jboss.org
Subject: [rules-users] JSR-94 and JEE integration

Hi,
i would like to integrate drools in jee. to be more flexible i was loking
at jsr-94. as i suppose jsr-94 only addresses j2se environment, my
question is: how it is possible to use drools with this specs from an ejb3
session bean? my thoughts about this brought me to the idea of injecting
the rules-administrator via resource annotation to prevent the container
always doing a class.forname(..) lookup. to define a j2se resource in a
jee container a jca might be the best way to integrate and to assure the
jee specs will not be violated. but this seams a lot of overhead to me.
how do u use drools in your jee applications when not relying on the brms?
any help or ideas on integrating drools with jsr-94 in jee would be great.

Knosta



___
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] JSR-94 and JEE integration

2008-06-10 Thread Corneil du Plessis
We use JSR-94 and have a 'RuleLoader' that uses our rule definitions and a
velocity script to generate the rules and creates a ruleset from that.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Hehl, Thomas
Sent: 10 June 2008 13:48
To: 'Rules Users List'
Subject: RE: [rules-users] JSR-94 and JEE integration

I know nothing about jsr-94, but we use drools in a webapp, servlet side
only.

It seems to me you could simply put your rules into a stateless session
bean.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Knoster
Sent: Tuesday, June 10, 2008 4:46 AM
To: rules-users@lists.jboss.org
Subject: [rules-users] JSR-94 and JEE integration

Hi,
i would like to integrate drools in jee. to be more flexible i was loking at
jsr-94. as i suppose jsr-94 only addresses j2se environment, my question is:
how it is possible to use drools with this specs from an ejb3 session bean?
my thoughts about this brought me to the idea of injecting the
rules-administrator via resource annotation to prevent the container always
doing a class.forname(..) lookup. to define a j2se resource in a jee
container a jca might be the best way to integrate and to assure the jee
specs will not be violated. but this seams a lot of overhead to me.
how do u use drools in your jee applications when not relying on the brms?
any help or ideas on integrating drools with jsr-94 in jee would be great.

Knosta



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


RE: re[rules-users] -use of an object used in a previous rule

2008-06-10 Thread Corneil du Plessis
I can't see where you insert an object of type Alpha that would fire 'pack
eco' 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mounir Chattou
Sent: 10 June 2008 10:34
To: rules-users@lists.jboss.org
Subject: re[rules-users] -use of an object used in a previous rule


Hi,
I have a problem : a fact is inserted in a rule but when I cast for it in
another, nothing happened, here is a simplified code to understand better :

rule eco
ruleflow-group economic
salience 20
when
a : Alpha()
then 
Beta beta = new Beta()
beta.add(a)
beta.setStatus(eco) // the property status is setted
insert(beta)
end

rule fl eco
ruleflow-group economic
salience 20
when 
f : Fl ()   
then
Fl fl = new Fl();
fl.add(f);
fl.setStatus(eco)// the property status is setted
insert(fl)
end


rule pack eco
ruleflow-group economic
when
f : Fl(status == eco)   //those two conditions are never
casted
... while I inserted the facts
a : Alpha(status == eco) 
then

end


Could someone explain me why ?
--
View this message in context:
http://www.nabble.com/re-use-of-an-object-used-in-a-previous-rule-tp17750384
p17750384.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


Re: [rules-users] Security, ldap and tomcat - Urgent please help

2008-06-10 Thread jbossruler

Can anybody see this? it still shows pending?



jbossruler wrote:
 
 Hi,
 I deployed Drools onto Tomcat and I am trying to figure out how to get
 security to work. I want to use LDAP but I have no clue where to begin.
 All of the tutorials I see make use of JBoss AS. I do not have the option
 of using JBoss AS. Can somebody point me in the right direction or let me
 know how I can modify the components.xml file or the repository.xml file?
 
 What are the options besides using LDAP for security?
 
 I am using Drools 4.04
 
 Really appreciate your help!
 

-- 
View this message in context: 
http://www.nabble.com/Security%2C-ldap-and-tomcat---Urgent-please-help-tp17693453p17758182.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] Accessing the fact model class files

2008-06-10 Thread Felbecker, Tobias
Hi all, I  create a *.pkg package with the BRMS and I want to access the
class files from my fact model at runtime. I coud't find a way to do so
in the org.drools.rule.Package API. Is there a way to do so?

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


[rules-users] Security, ldap and tomcat

2008-06-10 Thread jbossruler

Hi,
I deployed Drools onto Tomcat and I am trying to figure out how to get
security to work. I want to use LDAP but I have no clue where to begin. All
of the tutorials I see make use of JBoss AS. I do not have the option of
using JBoss AS. Can somebody point me in the right direction or let me know
how I can modify the components.xml file or the repository.xml file?

What are the options besides using LDAP for security?

I am using Drools 4.04

Really appreciate your help!
-- 
View this message in context: 
http://www.nabble.com/Security%2C-ldap-and-tomcat-tp17693453p17693453.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] Drools Maven repository error

2008-06-10 Thread Wilson O Ojwang

All,

I am getting the following error while updating drools 4.0.7 repo. using 
the following ant task


artifact:dependencies pathId=dependency.class.path
   dependency groupId=org.drools artifactId=drools-repository 
version=4.0.7/

/artifact:dependencies

OR using

artifact:dependencies pathId=dependency.class.path
   dependency groupId=org.drools artifactId=drools-core 
version=4.0.7/
  dependency groupId=org.drools artifactId=drools-compiler 
version=4.0.7/

/artifact:dependencies

 Here is the error ==

ant
Buildfile: build.xml
[artifact:dependencies] Downloading: 
org/drools/drools-repository/4.0.7/drools-repository-4.0.7.pom from central
[artifact:dependencies] Downloading: 
org/drools/drools-repository/4.0.7/drools-repository-4.0.7.pom from central
[artifact:dependencies] Downloading: 
org/drools/drools-repository/4.0.7/drools-repository-4.0.7.jar from central
[artifact:dependencies] Downloading: 
org/drools/drools-repository/4.0.7/drools-repository-4.0.7.jar from central
[artifact:dependencies] An error has occurred while processing the Maven 
artifact tasks.

[artifact:dependencies]  Diagnosis:
[artifact:dependencies]
[artifact:dependencies] Unable to resolve artifact: Missing:
[artifact:dependencies] --
[artifact:dependencies] 1) org.drools:drools-repository:jar:4.0.7
[artifact:dependencies]
[artifact:dependencies]   Try downloading the file manually from the 
project website.

[artifact:dependencies]
[artifact:dependencies]   Then, install it using the command:
[artifact:dependencies]   mvn install:install-file 
-DgroupId=org.drools -DartifactId=drools-repository -Dversion=4.0.7 
-Dpackaging=jar -Dfile=/path/to/file

[artifact:dependencies]
[artifact:dependencies]   Alternatively, if you host your own repository 
you can deploy the file there:
[artifact:dependencies]   mvn deploy:deploy-file 
-DgroupId=org.drools -DartifactId=drools-repository -Dversion=4.0.7 
-Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

[artifact:dependencies]
[artifact:dependencies]   Path to dependency:
[artifact:dependencies] 1) org.apache.maven:super-pom:jar:2.0
[artifact:dependencies] 2) org.drools:drools-repository:jar:4.0.7
[artifact:dependencies]
[artifact:dependencies] --
[artifact:dependencies] 1 required artifact is missing.
[artifact:dependencies]
[artifact:dependencies] for artifact:
[artifact:dependencies]   org.apache.maven:super-pom:jar:2.0
[artifact:dependencies]
[artifact:dependencies] from the specified remote repositories:
[artifact:dependencies]   central (http://repo1.maven.org/maven2)
[artifact:dependencies]

BUILD FAILED
/home/wojwang/workspace_5350/HibernateDrools/build.xml:13: Unable to 
resolve artifact: Missing:

--
1) org.drools:drools-repository:jar:4.0.7

 Try downloading the file manually from the project website.

 Then, install it using the command:
 mvn install:install-file -DgroupId=org.drools 
-DartifactId=drools-repository -Dversion=4.0.7 -Dpackaging=jar 
-Dfile=/path/to/file


 Alternatively, if you host your own repository you can deploy the file 
there:
 mvn deploy:deploy-file -DgroupId=org.drools 
-DartifactId=drools-repository -Dversion=4.0.7 -Dpackaging=jar 
-Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]


 Path to dependency:
   1) org.apache.maven:super-pom:jar:2.0
   2) org.drools:drools-repository:jar:4.0.7

--
1 required artifact is missing.

for artifact:
 org.apache.maven:super-pom:jar:2.0

from the specified remote repositories:
 central (http://repo1.maven.org/maven2)

=


Thanks for your help.

Regards
Wilson

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


[rules-users] NoClassDefFoundError when dynamically updating rulebase for rule using 'accumulate' CE

2008-06-10 Thread kunal

I am dynamically adding/modifying rules (packages) to a loaded rule-base and
having issues specifically when my rule contains accumulate CE. For an
example, following is a rule which I am trying to add to my rulebase (which
is already loaded in memory).

rule 7d7fa7f1-164b-45a7-8e5a-c0c260815f9a
enabled true
salience 0
no-loop true
agenda-group DATA_ARRIVAL
when
AgentID(agentId : agentId);
DeviceData()

Property(key==threshold,classifier==7d7fa7f1-164b-45a7-8e5a-c0c260815f9a.Condition0,$prop_threshold0
: value)
$total0: Number( doubleValue  $prop_threshold0)   from 
accumulate(
DataPoint( $value0: value ) from
dataService.getDataPoints(5e0de623-9a25-45a1-8bc5-745254c2576e,SPEED,3),
average( $value0) )
then

agent.handleAction(rules.sl.7d7fa7f1-164b-45a7-8e5a-c0c260815f9a,0);
end

I am not getting any error (Rule validation or any other) when adding
package with my rule to rulebase, but when getting following error, when
rulebase is used thereafter:

java.lang.NoClassDefFoundError:
rules/sl/Rule_7d7fa7f1_164b_45a7_8e5a_c0c260815f9a_0
at
rules.sl.Rule_7d7fa7f1_164b_45a7_8e5a_c0c260815f9a_0AccumulateExpression0Invoker.evaluate(Unknown
Source)
at
org.drools.base.accumulators.JavaAccumulatorFunctionExecutor.reverse(JavaAccumulatorFunctionExecutor.java:91)
at org.drools.rule.Accumulate.reverse(Accumulate.java:151)
at
org.drools.reteoo.AccumulateNode.modifyTuple(AccumulateNode.java:376)
at
org.drools.reteoo.AccumulateNode.retractObject(AccumulateNode.java:292)
at
org.drools.reteoo.SingleObjectSinkAdapter.propagateRetractObject(SingleObjectSinkAdapter.java:32)
at
org.drools.reteoo.RightInputAdapterNode.retractTuple(RightInputAdapterNode.java:124)
at
org.drools.reteoo.SingleTupleSinkAdapter.propagateRetractTuple(SingleTupleSinkAdapter.java:38)
at org.drools.reteoo.FromNode.retractTuple(FromNode.java:130)
at
org.drools.reteoo.CompositeTupleSinkAdapter.propagateRetractTuple(CompositeTupleSinkAdapter.java:52)
at org.drools.reteoo.JoinNode.retractTuple(JoinNode.java:231)
at
org.drools.reteoo.CompositeTupleSinkAdapter.propagateRetractTuple(CompositeTupleSinkAdapter.java:52)
at org.drools.reteoo.JoinNode.retractObject(JoinNode.java:191)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateRetractObject(CompositeObjectSinkAdapter.java:375)
at
org.drools.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:189)
at org.drools.reteoo.Rete.retractObject(Rete.java:215)
at
org.drools.reteoo.ReteooRuleBase.retractObject(ReteooRuleBase.java:211)
at
org.drools.reteoo.ReteooWorkingMemory.doRetract(ReteooWorkingMemory.java:79)
at
org.drools.common.AbstractWorkingMemory.retract(AbstractWorkingMemory.java:1023)
at
org.drools.common.AbstractWorkingMemory.retract(AbstractWorkingMemory.java:982)
at
com.sensorlogic.rules.RuleAgent.retractMatchingFact(RuleAgent.java:283)
at com.sensorlogic.rules.RuleAgent.processFact(RuleAgent.java:264)
at com.sensorlogic.rules.RuleAgent.run(RuleAgent.java:342)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)

I will appreciate any insight with this problem. My process of
adding/updating rules dynamically works with all other rules I am using but
only has issues with using 'accumulate' CE. Has someone encountered this
before? Or just any ideas on what can cause NoClassDefFound for my added
rule?
-- 
View this message in context: 
http://www.nabble.com/NoClassDefFoundError-when-dynamically-updating-rulebase-for-rule-using-%27accumulate%27-CE-tp17765904p17765904.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