Re: [rules-users] eval

2007-10-09 Thread Markus Helbig
you're right, but this was just an example for possible functions. In
reality i don't use equal methods here ...

Thanks

Markus


2007/10/8, Edson Tirelli [EMAIL PROTECTED]:

This is a bug in the DSL engine. May I ask you please to submit a JIRA
 for it?

Meanwhile, I advise you to avoid eval, since it is more performant and
 more clear to use regular constraints. The following grammar entries are
 equivalent to yours, but much more performant:

 [when]- Title equals {value}=title == {value}
 [when]- Event equals {value}=id == {value}

 []s
 Edson

 2007/10/8, Markus Helbig  [EMAIL PROTECTED]:
 
  Hi,
  given the following DSL
 
 
  [when]of type Item=Item()
  [when]- Title equals {value}=eval(title.isEqual({value})
  [when]- Event equals {value}=eval(id.isEqual({value})
  [then]Log : {message}= System.out.println({message});
 
 
 
  the dslr File:
 
  expander Test.dsl
 
  rule Your First Rule
when
   $p : of type Item
  - Title equals test
  - Event equals test
then
  #actions
  end
 
  resolves to (could be seen in the drl viewer)
 
  rule Your First Rule
 
  when
  $p :Item( eval( title.isEqual(test,
 eval(id.isEqual(test) ) )
  then
  #actions
 
  end
 
 
  so this of course does not work because of the brackets in eval
 
  How could i solve this problem? I need the two different eval
  conditions, and sometimes they have to be combined.
 
  Thanks
 
  Markus
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
 



 --
   Edson Tirelli
   Software Engineer - JBoss Rules Core Developer
   Office: +55 11 3529-6000
   Mobile: +55 11 9287-5646
   JBoss, a division of Red Hat @ www.jboss.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] Problem in using genrics with drools4.0.1.

2007-10-09 Thread Mark Proctor
Drools, and probably the underlying MVEL that the 'from' uses, has no 
understanding of Generics, so I expect thats your problem.


Mark
Gaurav2007 wrote:

HI ALL,

I am using drool 4.0.1 in my project.
I am facing problem in using generics feature of jdk1.5.

My objective is to perform validation on the basis of data type of variable.
for storing values of variable i have one Attribute Class it contains getter
setter for values of attribute and attributeId which is a string but value
of attribute is of deferent type so i am thinking to use generics here.

public class AttributeT {

public String qualifiedName;


public T newValue;

public T oldValue;

public String getQualifiedName() {
return qualifiedName;
}

public void setQualifiedName(String qualifiedName) {
this.qualifiedName = qualifiedName;
}

public T getNewValue() {
return (T)newValue;
}

public void setNewValue(T newValue) {
this.newValue = newValue;
}

public T getOldValue() {
return oldValue;
}

public void setOldValue(T oldValue) {
this.oldValue = oldValue;
}
}


my rule for date comparison looks like:

//Date Comparison.
rule W250.1 DateComparison
when
$dto : DataProvider()
Attribute(newValue  29-Oct-2007) from $dto.getValue(W250.1)
then
System.out.println (Error in Date check \t);
end

DataProvider class it is responsible to give instance of attribute
corresponding to attributeId:

public class DataProvider {

HashMapString,Attribute fieldMap=new HashMapString, Attribute();

public DataProvider() {

populateMap();
}

public Attribute  getValue(String qualifiedName){

Attribute attribute = fieldMap.get(qualifiedName);
return attribute;
}

public void populateMap(){

AttributeDate attribute = new AttributeDate();
SimpleDateFormat format = new SimpleDateFormat(dd-MMM-);
   Date date;
try {
date = format.parse(27-Oct-2007);
attribute.setQualifiedName(W250.1);
attribute.setOldValue(date);
attribute.setNewValue(date);
fieldMap.put(attribute.getQualifiedName(),attribute);

}

catch (ParseException e) {
e.printStackTrace();
}

}
}

in this case i am getting exception:
Exception in thread main java.lang.ClassCastException: java.lang.String

when i am not using generics this rule is working fine.
but in this case how should i perform validation depending upon data type of
attribute.

can you please help me in solving this problem.

Thanks,
Gaurav Joshi

  



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


RE: [rules-users] RE: rules precompilation

2007-10-09 Thread Manukyan, Sergey
Ekke,

Started using 4.0.2, but getting same error.

This is how I am loading the Package :

this.pkg = new Package();
this.pkg.readExternal(ois);

Does that look right to you?

-Sergey



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of ekke
Sent: Wednesday, October 03, 2007 4:08 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] RE: rules precompilation


sergey,

just tried it:
exported a package with rules as stream
(using the writeExternal() from Package)

then in another run I created new RuleBase, added new Package,
then import the rules into this empty Package (using the readExternal()
from
Package)
then added some facts, execute the rules,

tested if all rules are there,
tested if the Facts are in workingMemory - all ok

(using snapshot 4.0.2, eclipse 3.3, osx 10.4.10)

ekke

Manukyan, Sergey wrote:
 
 Ming, Ekke,
 
 After deserialising the Package back - getting exception when
inserting
 facts:
 
 Exception thrown : java.lang.NoClassDefFoundError: XXXShadowProxy
 
 XXX - is my class name
 
 Any ideas?
 
 -Sergey
 
 
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Jin, Ming
 Sent: Wednesday, October 03, 2007 1:50 PM
 To: Rules Users List
 Subject: RE: [rules-users] rules precompilation
 
 Sergey,
 
 I am using precompiled rules.  Serializing instances of
 org.drools.rule.Package works for me.
 
 Thanks,
 -Ming 
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Manukyan,
 Sergey
 Sent: Wednesday, October 03, 2007 12:29 PM
 To: Rules Users List
 Subject: [rules-users] rules precompilation
 
 
 Folks,
 
 Where can I find information on how to pre-compile rules in 4.0.1?
 
 Thanks,
 
 -Sergey
 
 
 **
 ** LEGAL DISCLAIMER **
 **
 
 This E-mail message and any attachments may contain legally
privileged,
 confidential or proprietary information. If you are not the intended
 recipient(s), or the employee or agent responsible for delivery of
this
 message to the intended recipient(s), you are hereby notified that any
 dissemination, distribution or copying of this E-mail message is
 strictly prohibited. If you have received this message in error,
please
 immediately notify the sender and delete this E-mail message from your
 computer.
 
 ___
 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
 
 

-- 
View this message in context:
http://www.nabble.com/How-to-have-your-emails-ignored-tf4562290.html#a13
026864
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] RE: rules precompilation

2007-10-09 Thread Mark Proctor

Manukyan, Sergey wrote:

Ekke,

Started using 4.0.2, but getting same error.

This is how I am loading the Package :

this.pkg = new Package();
this.pkg.readExternal(ois);

Does that look right to you?
  
wtf? you shouldn't be touching those methods, those are part of the 
internal serialisation process. And you should never instantiation a 
Package with the default constructor, the javadocs even state that. In 
fact you shouldn't instantiate a Package at all, either serialise in an 
existing one or use the PackageBuilder.

-Sergey



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of ekke
Sent: Wednesday, October 03, 2007 4:08 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] RE: rules precompilation


sergey,

just tried it:
exported a package with rules as stream
(using the writeExternal() from Package)

then in another run I created new RuleBase, added new Package,
then import the rules into this empty Package (using the readExternal()
from
Package)
then added some facts, execute the rules,

tested if all rules are there,
tested if the Facts are in workingMemory - all ok

(using snapshot 4.0.2, eclipse 3.3, osx 10.4.10)

ekke

Manukyan, Sergey wrote:
  

Ming, Ekke,

After deserialising the Package back - getting exception when


inserting
  

facts:

Exception thrown : java.lang.NoClassDefFoundError: XXXShadowProxy

XXX - is my class name

Any ideas?

-Sergey



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jin, Ming
Sent: Wednesday, October 03, 2007 1:50 PM
To: Rules Users List
Subject: RE: [rules-users] rules precompilation

Sergey,

I am using precompiled rules.  Serializing instances of
org.drools.rule.Package works for me.

Thanks,
-Ming 


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Manukyan,
Sergey
Sent: Wednesday, October 03, 2007 12:29 PM
To: Rules Users List
Subject: [rules-users] rules precompilation


Folks,

Where can I find information on how to pre-compile rules in 4.0.1?

Thanks,

-Sergey


**
** LEGAL DISCLAIMER **
**

This E-mail message and any attachments may contain legally


privileged,
  

confidential or proprietary information. If you are not the intended
recipient(s), or the employee or agent responsible for delivery of


this
  

message to the intended recipient(s), you are hereby notified that any
dissemination, distribution or copying of this E-mail message is
strictly prohibited. If you have received this message in error,


please
  

immediately notify the sender and delete this E-mail message from your
computer.

___
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





  


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


Re: [rules-users] About rules firing

2007-10-09 Thread Mark Proctor

[EMAIL PROTECTED] wrote:

Hi
 
I am using Drools 4.0.
I have two rules in my rule file.The when condition of my first rule 
is satisfying.Now please tell me that what should i do if i don't want 
to execute the second rule?
Please atleast attempt to go through the examples documentation before 
asking questions like this. Your question shows you haven't even gone 
through the HelloWorld example.

http://downloads.jboss.com/drools/docs/4.0.2.15666.GA/html/ch10.html
 
Thanks.
 
/*With Regards*/

/*Prateek*/

The information contained in this electronic message and any 
attachments to this message are intended for the exclusive use of the 
addressee(s) and may contain proprietary, confidential or privileged 
information. If you are not the intended recipient, you should not 
disseminate, distribute or copy this e-mail. Please notify the sender 
immediately and destroy all copies of this message and any attachments.


WARNING: Computer viruses can be transmitted via email. The recipient 
should check this email and any attachments for the presence of 
viruses. The company accepts no liability for any damage caused by any 
virus transmitted by this email.


www.wipro.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] RE: RE: rules precompilation

2007-10-09 Thread ekke

Sergey,

of course Mark is right - you shouldn't use readExternal and the default
constructor.
this was my fault from an earlier mail.

please try something like this:

// EXPORT
...
FileOutputStream fos .
...
ObjectOutputStream oos = null;
try {
oos = new ObjectOutputStream(fos);
oos.writeObject(builder.getPackage());
oos.close();
} catch (final IOException e) {
... your code
}
...

// IMPORT
FileInputStream fis...
...
ObjectInputStream ois = null;
try {
ois = new ObjectInputStream(fis);
builder = new PackageBuilder((Package)ois.readObject());
ois.close();
} catch (final IOException e) {
...your code...;
} catch (final ClassNotFoundException e) {
...your code...;
}

now your imported package should work like the exported

ekke


Manukyan, Sergey wrote:
 
 Ekke,
 
 Started using 4.0.2, but getting same error.
 
 This is how I am loading the Package :
 
 this.pkg = new Package();
 this.pkg.readExternal(ois);
 
 Does that look right to you?
 
 -Sergey
 
 
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of ekke
 Sent: Wednesday, October 03, 2007 4:08 PM
 To: rules-users@lists.jboss.org
 Subject: [rules-users] RE: rules precompilation
 
 
 sergey,
 
 just tried it:
 exported a package with rules as stream
 (using the writeExternal() from Package)
 
 then in another run I created new RuleBase, added new Package,
 then import the rules into this empty Package (using the readExternal()
 from
 Package)
 then added some facts, execute the rules,
 
 tested if all rules are there,
 tested if the Facts are in workingMemory - all ok
 
 (using snapshot 4.0.2, eclipse 3.3, osx 10.4.10)
 
 ekke
 
 Manukyan, Sergey wrote:
 
 Ming, Ekke,
 
 After deserialising the Package back - getting exception when
 inserting
 facts:
 
 Exception thrown : java.lang.NoClassDefFoundError: XXXShadowProxy
 
 XXX - is my class name
 
 Any ideas?
 
 -Sergey
 
 
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Jin, Ming
 Sent: Wednesday, October 03, 2007 1:50 PM
 To: Rules Users List
 Subject: RE: [rules-users] rules precompilation
 
 Sergey,
 
 I am using precompiled rules.  Serializing instances of
 org.drools.rule.Package works for me.
 
 Thanks,
 -Ming 
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Manukyan,
 Sergey
 Sent: Wednesday, October 03, 2007 12:29 PM
 To: Rules Users List
 Subject: [rules-users] rules precompilation
 
 
 Folks,
 
 Where can I find information on how to pre-compile rules in 4.0.1?
 
 Thanks,
 
 -Sergey
 
 
 **
 ** LEGAL DISCLAIMER **
 **
 
 This E-mail message and any attachments may contain legally
 privileged,
 confidential or proprietary information. If you are not the intended
 recipient(s), or the employee or agent responsible for delivery of
 this
 message to the intended recipient(s), you are hereby notified that any
 dissemination, distribution or copying of this E-mail message is
 strictly prohibited. If you have received this message in error,
 please
 immediately notify the sender and delete this E-mail message from your
 computer.
 
 ___
 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
 
 
 
 -- 
 View this message in context:
 http://www.nabble.com/How-to-have-your-emails-ignored-tf4562290.html#a13
 026864
 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
 
 

-- 
View this message in context: 
http://www.nabble.com/How-to-have-your-emails-ignored-tf4562290.html#a13121860
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


RE: [rules-users] RE: rules precompilation

2007-10-09 Thread Manukyan, Sergey
wtf? you shouldn't be touching those methods, those are part of the
internal serialisation process. In fact you shouldn't instantiate a
Package at all, either serialise in an existing one 

 

So you mean do this? :

 

  ois = new ObjectInputStream(fis);

  this.pkg = (Package) ois.readObject();

  ois.close();

 

It did the same thing... threw same exception...

 

 

or use the PackageBuilder

 

How? Where is it described? Are there any examples?

 





 

 



From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mark Proctor
Sent: Tuesday, October 09, 2007 11:55 AM
To: Rules Users List
Subject: Re: [rules-users] RE: rules precompilation

 

Manukyan, Sergey wrote: 

Ekke,
 
Started using 4.0.2, but getting same error.
 
This is how I am loading the Package :
 
this.pkg = new Package();
this.pkg.readExternal(ois);
 
Does that look right to you?
  

wtf? you shouldn't be touching those methods, those are part of the
internal serialisation process. And you should never instantiation a
Package with the default constructor, the javadocs even state that. In
fact you shouldn't instantiate a Package at all, either serialise in an
existing one or use the PackageBuilder.



 
-Sergey
 
 
 
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of ekke
Sent: Wednesday, October 03, 2007 4:08 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] RE: rules precompilation
 
 
sergey,
 
just tried it:
exported a package with rules as stream
(using the writeExternal() from Package)
 
then in another run I created new RuleBase, added new Package,
then import the rules into this empty Package (using the readExternal()
from
Package)
then added some facts, execute the rules,
 
tested if all rules are there,
tested if the Facts are in workingMemory - all ok
 
(using snapshot 4.0.2, eclipse 3.3, osx 10.4.10)
 
ekke
 
Manukyan, Sergey wrote:
  

Ming, Ekke,
 
After deserialising the Package back - getting exception when


inserting
  

facts:
 
Exception thrown : java.lang.NoClassDefFoundError:
XXXShadowProxy
 
XXX - is my class name
 
Any ideas?
 
-Sergey
 
 
 
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jin,
Ming
Sent: Wednesday, October 03, 2007 1:50 PM
To: Rules Users List
Subject: RE: [rules-users] rules precompilation
 
Sergey,
 
I am using precompiled rules.  Serializing instances of
org.drools.rule.Package works for me.
 
Thanks,
-Ming 
 
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Manukyan,
Sergey
Sent: Wednesday, October 03, 2007 12:29 PM
To: Rules Users List
Subject: [rules-users] rules precompilation
 
 
Folks,
 
Where can I find information on how to pre-compile rules in
4.0.1?
 
Thanks,
 
-Sergey
 
 
**
** LEGAL DISCLAIMER **
**
 
This E-mail message and any attachments may contain legally


privileged,
  

confidential or proprietary information. If you are not the
intended
recipient(s), or the employee or agent responsible for delivery
of


this
  

message to the intended recipient(s), you are hereby notified
that any
dissemination, distribution or copying of this E-mail message is
strictly prohibited. If you have received this message in error,


please
  

immediately notify the sender and delete this E-mail message
from your
computer.
 
___
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
 
 


 
  

 

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


[rules-users] Drools 4.0.2 compatible with Eclipse 3.3 ?

2007-10-09 Thread Guardian
Hello,

Is it right that Drools 4.0.2 is not compatible with Eclipse 3.3?



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


Re: [rules-users] Drools 4.0.2 compatible with Eclipse 3.3 ?

2007-10-09 Thread Mark Proctor

Guardian wrote:

Hello,

Is it right that Drools 4.0.2 is not compatible with Eclipse 3.3?
  
No it is not. But trunk has now been upgraded so that it does. Hudson 
has just build this, so you can play with it now and find regressions:
https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/ 




___
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] Exception in JBRMS with 4.0.2

2007-10-09 Thread kissro
Hello,

I upgraded from 4.0.1 to 4.0.2 and am getting the following errors when
I try to bring up the BRMS in the web-based gui. I get the JBoss Rules
screen but it's blank; it doesn't have the login boxes.  The console
shows:

[STDOUT] ERROR 09-10 (Contexts.java:flushAndDestroyContexts:
   could not discover transaction status
[STDOUT] ERROR 09-10 (StandardWrapperValve.java:invoke:278)
   Servlet.service() for servlet default threw exception
   java.lang.IllegalStateException: Cannot create a session after
  the response has been committed
at org.apache.catalina.connector.Request.doGetSession(Request.java:2284)
at org.apache.catalina.connector.Request.getSession(Request.java:2066)
at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833
at 
org.jboss.seam.servlet.ServletRequestSessionMap.put(ServletRequestSessionMap.java:87)
at 
org.jboss.seam.servlet.ServletRequestSessionMap.put(ServletRequestSessionMap.java:25)

Also, when I run my java program that reads the .drl file, builds
WorkingMemory, fires the rules, etc., I get this exception:

[STDOUT] ERROR 09-10 (Contexts.java:flushAndDestroyContexts:
 could not discover transaction status
[STDOUT] Error calling UnderwritingRule java.lang.ClassCastException:
 java.util.Collections$EmptyMap

If I revert back to the 4.0.1 jar files and 4.0.1 brms .war file,
everything works fine again.  Could someone tell me how to resolve these
errors or point me in the direction to start looking?  Did I just not
copy in a new file or update somewhere?

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


Re: [rules-users] Exception in JBRMS with 4.0.2

2007-10-09 Thread Fernando Meyer
Rod,

Could you provide more information about this? :For example which
application server you are using ?

Thanks

On 10/9/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Hello,

 I upgraded from 4.0.1 to 4.0.2 and am getting the following errors when
 I try to bring up the BRMS in the web-based gui. I get the JBoss Rules
 screen but it's blank; it doesn't have the login boxes.  The console
 shows:

 [STDOUT] ERROR 09-10 (Contexts.java:flushAndDestroyContexts:
could not discover transaction status
 [STDOUT] ERROR 09-10 (StandardWrapperValve.java:invoke:278)
Servlet.service() for servlet default threw exception
java.lang.IllegalStateException: Cannot create a session after
   the response has been committed
 at org.apache.catalina.connector.Request.doGetSession(Request.java:2284)
 at org.apache.catalina.connector.Request.getSession(Request.java:2066)
 at org.apache.catalina.connector.RequestFacade.getSession(
 RequestFacade.java:833
 at org.jboss.seam.servlet.ServletRequestSessionMap.put(
 ServletRequestSessionMap.java:87)
 at org.jboss.seam.servlet.ServletRequestSessionMap.put(
 ServletRequestSessionMap.java:25)

 Also, when I run my java program that reads the .drl file, builds
 WorkingMemory, fires the rules, etc., I get this exception:

 [STDOUT] ERROR 09-10 (Contexts.java:flushAndDestroyContexts:
  could not discover transaction status
 [STDOUT] Error calling UnderwritingRule java.lang.ClassCastException:
  java.util.Collections$EmptyMap

 If I revert back to the 4.0.1 jar files and 4.0.1 brms .war file,
 everything works fine again.  Could someone tell me how to resolve these
 errors or point me in the direction to start looking?  Did I just not
 copy in a new file or update somewhere?

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




-- 
Fernando Meyer http://fmeyer.org
JBoss Rules Core Developer
[EMAIL PROTECTED]
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] RE: RE: rules precompilation

2007-10-09 Thread Manukyan, Sergey
Ekke,

Thanks a lot! It worked just fine...

The other missing point is that after deserializing the PackageBuilder
should be buit as in your example :

builder = new PackageBuilder((Package)ois.readObject());

and later on from that isnatcne should be retrieved the Package inctance
by doing:

package = buider.getPackage();

as otherwise this code was failing:

package = (Package)ois.readObject();  // FAILES, subsequent use
of package produces class not found exception when inserting objects.



Mark,

Think this should be documented somewhere in manual... under  IMPORTANT
section... by the way, IMHO that section should be more visible from
what is used currently in manual... - thin italic font, how about bold
red?


Thanks to all,

-Sergey



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of ekke
Sent: Tuesday, October 09, 2007 2:35 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] RE: RE: rules precompilation


Sergey,

of course Mark is right - you shouldn't use readExternal and the default
constructor.
this was my fault from an earlier mail.

please try something like this:

// EXPORT
...
FileOutputStream fos .
...
ObjectOutputStream oos = null;
try {
oos = new ObjectOutputStream(fos);
oos.writeObject(builder.getPackage());
oos.close();
} catch (final IOException e) {
... your code
}
...

// IMPORT
FileInputStream fis...
...
ObjectInputStream ois = null;
try {
ois = new ObjectInputStream(fis);
builder = new
PackageBuilder((Package)ois.readObject());
ois.close();
} catch (final IOException e) {
...your code...;
} catch (final ClassNotFoundException e) {
...your code...;
}

now your imported package should work like the exported

ekke


Manukyan, Sergey wrote:
 
 Ekke,
 
 Started using 4.0.2, but getting same error.
 
 This is how I am loading the Package :
 
 this.pkg = new Package();
 this.pkg.readExternal(ois);
 
 Does that look right to you?
 
 -Sergey
 
 
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of ekke
 Sent: Wednesday, October 03, 2007 4:08 PM
 To: rules-users@lists.jboss.org
 Subject: [rules-users] RE: rules precompilation
 
 
 sergey,
 
 just tried it:
 exported a package with rules as stream
 (using the writeExternal() from Package)
 
 then in another run I created new RuleBase, added new Package,
 then import the rules into this empty Package (using the
readExternal()
 from
 Package)
 then added some facts, execute the rules,
 
 tested if all rules are there,
 tested if the Facts are in workingMemory - all ok
 
 (using snapshot 4.0.2, eclipse 3.3, osx 10.4.10)
 
 ekke
 
 Manukyan, Sergey wrote:
 
 Ming, Ekke,
 
 After deserialising the Package back - getting exception when
 inserting
 facts:
 
 Exception thrown : java.lang.NoClassDefFoundError: XXXShadowProxy
 
 XXX - is my class name
 
 Any ideas?
 
 -Sergey
 
 
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Jin, Ming
 Sent: Wednesday, October 03, 2007 1:50 PM
 To: Rules Users List
 Subject: RE: [rules-users] rules precompilation
 
 Sergey,
 
 I am using precompiled rules.  Serializing instances of
 org.drools.rule.Package works for me.
 
 Thanks,
 -Ming 
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Manukyan,
 Sergey
 Sent: Wednesday, October 03, 2007 12:29 PM
 To: Rules Users List
 Subject: [rules-users] rules precompilation
 
 
 Folks,
 
 Where can I find information on how to pre-compile rules in 4.0.1?
 
 Thanks,
 
 -Sergey
 
 
 **
 ** LEGAL DISCLAIMER **
 **
 
 This E-mail message and any attachments may contain legally
 privileged,
 confidential or proprietary information. If you are not the intended
 recipient(s), or the employee or agent responsible for delivery of
 this
 message to the intended recipient(s), you are hereby notified that
any
 dissemination, distribution or copying of this E-mail message is
 strictly prohibited. If you have received this message in error,
 please
 immediately notify the sender and delete this E-mail message from
your
 computer.
 
 ___
 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: [rules-users] RE: RE: rules precompilation

2007-10-09 Thread Mark Proctor

Manukyan, Sergey wrote:

Ekke,

Thanks a lot! It worked just fine...

The other missing point is that after deserializing the PackageBuilder
should be buit as in your example :

builder = new PackageBuilder((Package)ois.readObject());

and later on from that isnatcne should be retrieved the Package inctance
by doing:

package = buider.getPackage();

as otherwise this code was failing:

package = (Package)ois.readObject();  // FAILES, subsequent use
of package produces class not found exception when inserting objects.



Mark,

Think this should be documented somewhere in manual... under  IMPORTANT
section... by the way, IMHO that section should be more visible from
what is used currently in manual... - thin italic font, how about bold
red?

  
You should be able to serialise a Package without having to first add it 
to PackageBuilder, we have numerous  tests for this.

Thanks to all,

-Sergey



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of ekke
Sent: Tuesday, October 09, 2007 2:35 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] RE: RE: rules precompilation


Sergey,

of course Mark is right - you shouldn't use readExternal and the default
constructor.
this was my fault from an earlier mail.

please try something like this:

// EXPORT
...
FileOutputStream fos .
...
ObjectOutputStream oos = null;
try {
oos = new ObjectOutputStream(fos);
oos.writeObject(builder.getPackage());
oos.close();
} catch (final IOException e) {
... your code
}
...

// IMPORT
FileInputStream fis...
...
ObjectInputStream ois = null;
try {
ois = new ObjectInputStream(fis);
builder = new
PackageBuilder((Package)ois.readObject());
ois.close();
} catch (final IOException e) {
...your code...;
} catch (final ClassNotFoundException e) {
...your code...;
}

now your imported package should work like the exported

ekke


Manukyan, Sergey wrote:
  

Ekke,

Started using 4.0.2, but getting same error.

This is how I am loading the Package :

this.pkg = new Package();
this.pkg.readExternal(ois);

Does that look right to you?

-Sergey



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of ekke
Sent: Wednesday, October 03, 2007 4:08 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] RE: rules precompilation


sergey,

just tried it:
exported a package with rules as stream
(using the writeExternal() from Package)

then in another run I created new RuleBase, added new Package,
then import the rules into this empty Package (using the


readExternal()
  

from
Package)
then added some facts, execute the rules,

tested if all rules are there,
tested if the Facts are in workingMemory - all ok

(using snapshot 4.0.2, eclipse 3.3, osx 10.4.10)

ekke

Manukyan, Sergey wrote:


Ming, Ekke,

After deserialising the Package back - getting exception when
  

inserting


facts:

Exception thrown : java.lang.NoClassDefFoundError: XXXShadowProxy

XXX - is my class name

Any ideas?

-Sergey



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jin, Ming
Sent: Wednesday, October 03, 2007 1:50 PM
To: Rules Users List
Subject: RE: [rules-users] rules precompilation

Sergey,

I am using precompiled rules.  Serializing instances of
org.drools.rule.Package works for me.

Thanks,
-Ming 


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Manukyan,
Sergey
Sent: Wednesday, October 03, 2007 12:29 PM
To: Rules Users List
Subject: [rules-users] rules precompilation


Folks,

Where can I find information on how to pre-compile rules in 4.0.1?

Thanks,

-Sergey


**
** LEGAL DISCLAIMER **
**

This E-mail message and any attachments may contain legally
  

privileged,


confidential or proprietary information. If you are not the intended
recipient(s), or the employee or agent responsible for delivery of
  

this


message to the intended recipient(s), you are hereby notified that
  

any
  

dissemination, distribution or copying of this E-mail message is
strictly prohibited. If you have received this message in error,
  

please


immediately notify the sender and delete this E-mail message from
  

your
  

computer.

___
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] Re: JBOSS and multiple rule conditions being met

2007-10-09 Thread Mark Proctor

Sheila,

You have just violated #4
http://labs.jboss.com/drools/lists.html

Mark
[EMAIL PROTECTED] wrote:

Hi

I have been working with JBOSS for a few days now. I cannot say that I am very 
familiar with it yet.

JBOSS rules have been used to validate data in our system. It works fine as 
long as we care only if a product met any one condition.

However, there is now a new requirement which says that the users would like to 
know all the conditions which the product met setting it to a particular state.

To explain with an example:
Rule 1 - set status to PENDING if product is  HIKING == y 
Rule 2 - set status to ERROR if product has High Risk Flag == y 


If a product is only HIKING, then this rule works well. If a product is only 
HISK RISK then this rule works. However, if a product meets both HIKING and 
HISK RISK then we would see only one or the other. Code is as given below:
  WorkingMemory workingMemory = null;
workingMemory = getClassValidationRuleBase().newWorkingMemory();
workingMemory.assertObject(classificationValidationData);
workingMemory.fireAllRules();
  String result = 
classificationValidationData.getResultValue()

How can get the output such that I get a list of all(multiple) the conditions 
that were met by a product setting it to a particular state.

Do you have an example which can show how this can be done.

Thanks  for your time and help.

Sheila



  



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