Re: [rules-users] Problems archiving and restoring packages in the BRMS

2007-09-28 Thread Mark Proctor
each asset is currently treated indivually so a package is itself an 
asset like a rule is an asset. Whats needed here is an option, when 
archiving packages, that asks if you would like to archive its 
configured rules.


patch welcome :)

Mark
Shahad Ahmed wrote:


I've come across a few serious usability problems whilst using the 
import and archiving packages functionality in the BRMS. However, 
before raising a JIRA, I thought I'd ask the community if these are 
expected behaviours, or legitimate bugs.


1. Archiving a package only removes the package definition – all rules 
etc in the package are not archived. Is this the expected behaviour? 
As a naive user I would have expected the package and all its rules 
etc to be archived.


2. The archived package definition does not show up in the list of 
archived assets under the Admin/Manage Archived Assets option. Is the 
list of archived packages available elsewhere, and if so can you 
restore an archived package again?


3. I archived a package in the BRMS – which removed the package from 
the listed packages in the BRMS. I then tried to create a new package 
with the same name as the archived (i.e. removed) package using the 
"Import package from drl" option. The new drl package had rules with 
different names from the original rules in the archived package. 
However, the new package was not created from the drl (the new package 
name does not show up in the list of packages), although the new rules 
in the drl where imported. If you try to recreate this, be aware that 
it wont be obvious the new rules have imported as their containing 
package is not created – and as the imported rules from a drl have no 
category they do not show up in the list of rules, unless you search 
for them by name.


Am I right in thinking that the problem with archiving a package, and 
then failing to recreate the package with the same name using the 
import mechanism is a bug, or is there something subtle I'm missing 
with this behaviour?


Regards
Shahad



___
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] Need clarification when using maps

2007-09-28 Thread Jeffery Shutt
There has to be something I do not understand about using rules.

Take this simple class and rules and I don't understand the output.

 

First, when the rule constructor is executed it appears as though only the
value 1 was put into the map, then it runs rule test1 and then it sees only
values 2 and 3.

 

Secondly, look at rule test2 right now the RHS displays true, BUT if you
comment out the eval(true) and uncomment either of the evals you get a
nullpointer at runtime. I do not understand why there is a null pointer. Any
insight would be wonderful, I have been banging my head against this for a
bit and it's probably something stupid.

Thanks!

 

-

 

package test.map;

import java.util.HashMap;

import java.util.Map;

 

 

public class Test

{

public Test()

{

values = new HashMap();

}



private Map values;

 

public Map getValues()

{

return values;

}

 

public void setValues(Map values)

{

this.values = values;

}

}

 

-

 

 

package test.map

 

import java.math.BigDecimal;

import java.util.Map;

 

 

rule "Constructor"

   no-loop true

   when

  eval(true);

  $t : Test(values:values)

   then

  drools.setFocus("test2");

  drools.setFocus("test1");  

  values.put("one", new BigDecimal("1"));

  addValue($t, "two", new BigDecimal("2"));

  $t.getValues().put("three", new BigDecimal("3"));

  update($t);

  System.out.println("in constructor");

  System.out.println(values);

  System.out.println();

end

 

rule "test1"

   no-loop true

   agenda-group "test1"

   when

  eval(true);

  $t : Test(values:values)

   then

  System.out.println("in test1");

  System.out.println(values);

  System.out.println();

end

 

rule "test2"

   no-loop true

   agenda-group "test2"

   when

  eval(true);

  $t : Test(values:values)

  //eval(((BigDecimal)values.get("two")).equals(new BigDecimal("2")));

  //eval(((BigDecimal)$t.getValues().get("two")).equals(new
BigDecimal("2")));

   then

  System.out.println(((BigDecimal)$t.getValues().get("two")).equals(new
BigDecimal("2")));

end

 

function void addValue(Test t, String key, BigDecimal value)

{

   t.getValues().put(key, value);

}

 

 

---

This is a simple class to start it up.

---

 

package test.map;

 

import java.io.InputStreamReader;

import java.io.Reader;

 

import org.drools.RuleBase;

import org.drools.RuleBaseFactory;

import org.drools.WorkingMemory;

import org.drools.compiler.PackageBuilder;

import org.drools.rule.Package;

 

public class Mainclass 

{

public static void main(String[] args)

{

 try 

 {

 //load up the rulebase

 RuleBase ruleBase = readRule();

 WorkingMemory workingMemory =
ruleBase.newStatefulSession();

 

 Test test = new Test();

 

 workingMemory.insert(test);

 workingMemory.fireAllRules();

 }

 catch (Throwable t) 

 {

t.printStackTrace();

 }

}



/**

 * Please note that this is the "low level" rule assembly API.

 */

private static RuleBase readRule() throws Exception 

{

Reader source = new
InputStreamReader(Mainclass.class.getResourceAsStream("/Nulltest.drl"));



System.setProperty("drools.compiler", "JANINO");



PackageBuilder builder = new PackageBuilder();

 

builder.addPackageFromDrl( source );

Package pkg = builder.getPackage();



RuleBase ruleBase = RuleBaseFactory.newRuleBase();

ruleBase.addPackage( pkg );

return ruleBase;

}

}

 

 

 

 

Jeff Shutt

Software Developer

SOS Staffing Services

(801) 924-0429

[EMAIL PROTECTED]

 

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


[rules-users] Problems archiving and restoring packages in the BRMS

2007-09-28 Thread Shahad Ahmed
I've come across a few serious usability problems whilst using the import
and archiving packages functionality in the BRMS. However, before raising a
JIRA, I thought I'd ask the community if these are expected behaviours, or
legitimate bugs.

1. Archiving a package only removes the package definition – all rules etc
in the package are not archived. Is this the expected behaviour? As a naive
user I would have expected the package and all its rules etc to be archived.


2. The archived package definition does not show up in the list of archived
assets under the Admin/Manage Archived Assets option. Is the list of
archived packages available elsewhere, and if so can you restore an archived
package again?

3. I archived a package in the BRMS – which removed the package from the
listed packages in the BRMS. I then tried to create a new package with the
same name as the archived (i.e. removed) package using the "Import package
from drl" option. The new drl package had rules with different names from
the original rules in the archived package. However, the new package was not
created from the drl (the new package name does not show up in the list of
packages), although the new rules in the drl where imported. If you try to
recreate this, be aware that it wont be obvious the new rules have imported
as their containing package is not created – and as the imported rules from
a drl have no category they do not show up in the list of rules, unless you
search for them by name.

Am I right in thinking that the problem with archiving a package, and then
failing to recreate the package with the same name using the import
mechanism is a bug, or is there something subtle I'm missing with this
behaviour?

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


Re: [rules-users] accumulate funtion in xml

2007-09-28 Thread Fernando Meyer
Hi Isabelle,

I didn't paid enough attention to your rhs block :)
You are welcome and tks for your feedbak.

On 9/28/07, Isabelle Hupont <[EMAIL PROTECTED]> wrote:
>
>
> Hi Fernando!!
>
> I have fixed the problem... I didn't changed drools v3 modify(_i)
> statement
> by drools v4 update(-i).
> Now everything works well!
> Thanks a lot for your attention.
>
>
>
>
> Isabelle Hupont wrote:
> >
> > Sorry!! I mixed the .class and. java files!! ;)
> > Here is the source code. I also paste the code I am using to read the
> rule
> > package:
> >
> > public RuleBase readRulePackage() throws PersistenceException{
> >   // Reads a set of rules from XML file
> >   try {
> >
> >   PackageBuilder builder = new PackageBuilder();
> >   builder.addPackageFromXml(new
> InputStreamReader(new
> > FileInputStream(ruleFile)));
> >
> >   ruleBase = RuleBaseFactory.newRuleBase();
> >   ruleBase.addPackage(builder.getPackage());
> >   return ruleBase;
> >
> >   } catch (Exception e){
> >   e.printStackTrace();
> >   throw new PersistenceException("Error reading
> rules file");
> >   }
> >   }
> >
> > thx! http://www.nabble.com/file/p12935779/Instance.java Instance.java
> >
> >
> > Fernando Meyer Camargo wrote:
> >>
> >> Hi isabelle,
> >>
> >> When I said instance class, I was meaning your instance source code ;)
> >>
> >> Regards
> >>
> >> On 9/28/07, Isabelle Hupont <[EMAIL PROTECTED]> wrote:
> >>>
> >>>
> >>> Hi Fernando!
> >>>
> >>> Mi Instance class is the Weka class I attach
> >>> Thanks for your attention.
> >>> Isabelle.
> >>> http://www.nabble.com/file/p12935480/Instance.class Instance.class
> >>>
> >>>
> >>>
> >>> Fernando Meyer Camargo wrote:
> >>> >
> >>> > Could you please provide your Instance class ?
> >>> >
> >>> >
> >>> > On 9/27/07, Isabelle Hupont <[EMAIL PROTECTED]> wrote:
> >>> >>
> >>> >>
> >>> >> Hi!
> >>> >>
> >>> >> I want to program the following drl rule in xml:
> >>> >>
> >>> >> rule "average calculation"
> >>> >> no-loop true
> >>> >> when
> >>> >> _i : Instance()
> >>> >> _average : Double()
> >>> >> from accumulate(accInst:
> Instance(),
> >>> >>average(
> >>> >> accInst.value("tend")))
> >>> >> eval(_average < 2)
> >>> >> then
> >>> >> _i.setValue("tend",2000);
> >>> >> end
> >>> >>
> >>> >>
> >>> >> For it, I have implemented the following xml file:
> >>> >>
> >>> >> 
> >>> >>  >>> xmlns="http://drools.org/drools-4.0";
> >>> >> xmlns:xs="http://www.w3.org/2001/XMLSchema-instance";
> >>> >> xs:schemaLocation="http://drools.org/drools-4.0 drools-4.0.xsd">
> >>> >> 
> >>> >> 
> >>> >> 
> >>> >> 
> >>> >> 
> >>> >> 
> >>> >> 
> >>> >> 
> >>> >> 
> >>> >> 
> >>> >> 
> >>> >> 
> >>> >> 
> >>> >>  >>> >> object-type="Instance"/>
> >>> >>  >>> >> expression="accInst.value("tend")"/>
> >>> >> 
> >>> >> 
> >>> >> 
> >>> >> _average < 2.0
> >>> >> 
> >>> >> 
> >>> >> _i.setValue("tend", 2000.0); manageRuleFired("Rule1", null, _i);
> >>> >> modify(_i);
> >>> >> 
> >>> >> 
> >>> >>
> >>> >> And I have the following error when reading the rule package:
> >>> >>
> >>> >> org.drools.rule.InvalidRulePackage: Rule Compilation error _average
> >>> >> cannot
> >>> >> be resolved _i cannot be resolved _i cannot be resolved
> _i__Handle__
> >>> >> cannot
> >>> >> be resolved _i cannot be resolved
> >>> >>
> >>> >>
> >>> >> I also have tried to replace the xml identifier  by
> 
> >>> >> with
> >>> >> no result. Can you help me, please?
> >>> >>
> >>> >>
> >>> >> --
> >>> >> View this message in context:
> >>> >>
> >>>
> http://www.nabble.com/accumulate-funtion-in-xml-tf4526879.html#a12916380
> >>> >> 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
> >>> >>
> >>> >
> >>> >
> >>> >
> >>> > --
> >>> > 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
> >>> >
> >>> >
> >>>
> >>> --
> >>> View this message in context:
> >>>
> http://www.nabble.com/accumulate-funtion-in-xml-tf4526879.html#a12935480
> >>> Sent from the drools - user mailing list archive at Nabble.com.
> >>>
> >>> 

RE: [rules-users] Please help

2007-09-28 Thread Bhattacharya, Sougata

Hi its working fine with the following rule.

 

   when

$item:OrderableLineItemVO($parent: parentLineItemID)

exists (not (OrderableLineItemVO(lineItemID == $parent)))

   then

 exception;

end

 

 

thanks 



From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bhattacharya,
Sougata
Sent: Friday, September 28, 2007 7:55 PM
To: Rules Users List
Subject: RE: [rules-users] Please help

 

Hmm I think we are just near to the solution,

I have the line item like this

 

  1

 
1

 

 

  2

 
1

 

 

 

  2

 
1

 

 

 

  4

 
2

 

 

 

  5

 
1

 

 

with this data set case my rule should not raise any exception, if any
of the lineItem has ParentLineItemID = 8 it should raise an exception

 

 

Cheers

Sougata

   



From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Anstis,
Michael (M.)
Sent: Friday, September 28, 2007 7:35 PM
To: Rules Users List
Subject: RE: [rules-users] Please help

 

You will need to use the exists keyword.

 

Without digging around for the manual you need to do something like:-

 

when

exists (
LineItem( $parent: parentId )
LineItem( id != $parent )

)
then
// raise the exception
end

 

 





From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bhattacharya,
Sougata
Sent: 28 September 2007 14:50
To: Rules Users List
Subject: RE: [rules-users] Please help

No 30 is not correct, I want if 1  lineItem.parentId does not
equals to any of the LineItem.Id throw one exception.

 

Thanks

 

 

 





From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Anstis,
Michael (M.)
Sent: Friday, September 28, 2007 7:13 PM
To: Rules Users List
Subject: RE: [rules-users] Please help

 

Is 30 correct, you are not clear. Did you want one exception for
any number of violations?

 





From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bhattacharya,
Sougata
Sent: 28 September 2007 14:33
To: Rules Users List
Subject: RE: [rules-users] Please help

Oh yes this raises 30 exceptions if I have 6 Line Items

 





From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Edson Tirelli
Sent: Friday, September 28, 2007 6:53 PM
To: Rules Users List
Subject: Re: [rules-users] Please help

 



when
LineItem( $parent: parentId )
LineItem( id != $parent )
then
// raise the exception
end

2007/9/28, Bhattacharya, Sougata <
[EMAIL PROTECTED]
 >:

 

Hi All,

  I am using drool to validate my business objects. I
have a Business object like this

LineItem

   String ID

   String parentId

 

I get 5 LineItems in a row and each line item has ID
and a Parent ID, I will have to check 

 

if(parented of Any LineItem ! = ID of any LineITem)

I have to show an exception,

Please help me to solve this

 

Cheers

Su

This message contains information that may be privileged or confidential
and is the property of the Capgemini Group. It is intended only for the
person to whom it is addressed. If you are not the intended recipient,
you are not authorized to read, print, retain, copy, disseminate,
distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all
copies of this message. 

 

This message contains information that may be privileged or confidential
and is the property of the Capgemini Group. It is intended only for the
person to whom it is addressed. If you are not the intended recipient,
you are not authorized to read, print, retain, copy, disseminate,
distribute, or use 

RE: [rules-users] Please help

2007-09-28 Thread Bhattacharya, Sougata

Hmm I think we are just near to the solution,

I have the line item like this

 

  1

 
1

 

 

  2

 
1

 

 

 

  2

 
1

 

 

 

  4

 
2

 

 

 

  5

 
1

 

 

with this data set case my rule should not raise any exception, if any
of the lineItem has ParentLineItemID = 8 it should raise an exception

 

 

Cheers

Sougata

   



From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Anstis,
Michael (M.)
Sent: Friday, September 28, 2007 7:35 PM
To: Rules Users List
Subject: RE: [rules-users] Please help

 

You will need to use the exists keyword.

 

Without digging around for the manual you need to do something like:-

 

when

exists (
LineItem( $parent: parentId )
LineItem( id != $parent )

)
then
// raise the exception
end

 

 





From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bhattacharya,
Sougata
Sent: 28 September 2007 14:50
To: Rules Users List
Subject: RE: [rules-users] Please help

No 30 is not correct, I want if 1  lineItem.parentId does not
equals to any of the LineItem.Id throw one exception.

 

Thanks

 

 

 





From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Anstis,
Michael (M.)
Sent: Friday, September 28, 2007 7:13 PM
To: Rules Users List
Subject: RE: [rules-users] Please help

 

Is 30 correct, you are not clear. Did you want one exception for
any number of violations?

 





From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bhattacharya,
Sougata
Sent: 28 September 2007 14:33
To: Rules Users List
Subject: RE: [rules-users] Please help

Oh yes this raises 30 exceptions if I have 6 Line Items

 





From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Edson Tirelli
Sent: Friday, September 28, 2007 6:53 PM
To: Rules Users List
Subject: Re: [rules-users] Please help

 



when
LineItem( $parent: parentId )
LineItem( id != $parent )
then
// raise the exception
end

2007/9/28, Bhattacharya, Sougata <
[EMAIL PROTECTED]
 >:

 

Hi All,

  I am using drool to validate my business objects. I
have a Business object like this

LineItem

   String ID

   String parentId

 

I get 5 LineItems in a row and each line item has ID
and a Parent ID, I will have to check 

 

if(parented of Any LineItem ! = ID of any LineITem)

I have to show an exception,

Please help me to solve this

 

Cheers

Su

This message contains information that may be privileged or confidential
and is the property of the Capgemini Group. It is intended only for the
person to whom it is addressed. If you are not the intended recipient,
you are not authorized to read, print, retain, copy, disseminate,
distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all
copies of this message. 

 

This message contains information that may be privileged or confidential
and is the property of the Capgemini Group. It is intended only for the
person to whom it is addressed. If you are not the intended recipient,
you are not authorized to read, print, retain, copy, disseminate,
distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all
copies of this message. 


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




-- 

Re: [rules-users] Please help

2007-09-28 Thread Edson Tirelli
   I may be misinterpreting your message bellow, but the way I read it,
being sarcastic instead of explaining what is your problem will not make
people help you.

   I think you need to read the manual, Rule language chapter. To raise only
one exception in case there is on or more matches, use the "exists" CE:

 when
exists( LineItem( $parent: parentId ) and LineItem( id != $parent ) )
then
// raise the exception
end

[]s
Edson

2007/9/28, Bhattacharya, Sougata <[EMAIL PROTECTED]>:
>
>  Oh yes this raises 30 exceptions if I have 6 Line Items
>
>
>  --
>
> *From:* [EMAIL PROTECTED] [mailto:
> [EMAIL PROTECTED] *On Behalf Of *Edson Tirelli
> *Sent:* Friday, September 28, 2007 6:53 PM
> *To:* Rules Users List
> *Subject:* Re: [rules-users] Please help
>
>
>
>
>
> when
> LineItem( $parent: parentId )
> LineItem( id != $parent )
> then
> // raise the exception
> end
>
> 2007/9/28, Bhattacharya, Sougata < [EMAIL PROTECTED]>:
>
>
>
> Hi All,
>
>   I am using drool to validate my business objects. I have a Business
> object like this
>
> LineItem
>
>String ID
>
>String parentId
>
>
>
> I get 5 LineItems in a row and each line item has ID  and a Parent ID, I
> will have to check
>
>
>
> if(parented of Any LineItem ! = ID of any LineITem)
>
> I have to show an exception,
>
> Please help me to solve this
>
>
>
> Cheers
>
> Su
>
> This message contains information that may be privileged or confidential
> and is the property of the Capgemini Group. It is intended only for the
> person to whom it is addressed. If you are not the intended recipient, you
> are not authorized to read, print, retain, copy, disseminate, distribute, or
> use this message or any part thereof. If you receive this message in error,
> please notify the sender immediately and delete all copies of this message.
>
>
>
> This message contains information that may be privileged or confidential
> and is the property of the Capgemini Group. It is intended only for the
> person to whom it is addressed. If you are not the intended recipient, you
> are not authorized to read, print, retain, copy, disseminate, distribute, or
> use this message or any part thereof. If you receive this message in error,
> please notify the sender immediately and delete all copies of this message.
>
>
> ___
> 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
>  This message contains information that may be privileged or confidential
> and is the property of the Capgemini Group. It is intended only for the
> person to whom it is addressed. If you are not the intended recipient, you
> are not authorized to read, print, retain, copy, disseminate, distribute, or
> use this message or any part thereof. If you receive this message in error,
> please notify the sender immediately and delete all copies of this message.
>
>
> ___
> 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


Re: [rules-users] Re: About for and inheritance

2007-09-28 Thread Edson Tirelli
You have a valid point. I was thinking in a more general situation where
the class returned by the method may be completely unrelated to the class
declared in the rule. Raising a compile time error would help preventing the
user writing rules that will never match.
Maybe we can mix both approaches by doing a compile time hierarchy
analysis + runtime type matching, or, if we really want to keep it dynamic,
analytics module could raise a warning at compile time, but no error would
be raised by the compiler and we could do only the runtime type matching.
   I'm not aware of similar semantics in other products, so, suggestions
above are things that just occurred me and may not be the best ever way to
handle the situation.

   Mark, what do you think?

   []s
   Edson


2007/9/28, Chris Woodrow <[EMAIL PROTECTED]>:
>
> I am a bit surprised by your answer...
>
> Let's consider :
> rule "likes french cheese1"
> when
> FrenchCheese( smell == "good" )
> then
> System.out.println("likes french cheese1");
> end
>
> rule "likes french cheese2"
> when
> $person : Person ()
> FrenchCheese( smell == "good" )  from $person.getLikes()
> then
> System.out.println("likes french cheese2");
> end
>
> These 2 rules do not behave the same way :
> - First one simply does not match (with a Cheese instance inserted in WM)
> - Second one throws an error (see third test in my original mail)
>
> Chris
>
>
> 2007/9/27, Edson Tirelli <[EMAIL PROTECTED]>:
> >
> >
> >Ideal IMO would be a compile time error, since getLikes() returns a
> > Cheese instance, but as we use MVEL to resolve the expression, I'm not 100%
> > sure we are able to cover all possible scenarios at compile time. I guess we
> > can, but need to double check that.
> >
> >[]s
> >Edson
> >
> > 2007/9/27, Chris Woodrow < [EMAIL PROTECTED]>:
> > >
> > > Thanks.
> > > I was supposing so...
> > > Do you think test 3 should throw a ClassCastException or just not
> > > match?
> > > Chris
> > >
> > > 2007/9/27, Edson Tirelli < [EMAIL PROTECTED] >:
> > > >
> > > >
> > > >Yes, drools is deferring the type verification until it is needed
> > > > (in your example, to check the constraint). May I ask you please to 
> > > > open a
> > > > JIRA... I will fix that.
> > > >
> > > >   []s
> > > >   Edson
> > > >
> > > > 2007/9/27, Chris Woodrow <[EMAIL PROTECTED]>:
> > > >
> > > > >  I am sorry I didn't mean 'for' but 'from'.
> > > > > :D
> > > > >
> > > > > 2007/9/27, Chris Woodrow < [EMAIL PROTECTED]>:
> > > > > >
> > > > > > Hi,
> > > > > > I recently find out a few issues using for, and I wanted to
> > > > > > share it with you. I made a simple exemple to illustrate my purpose.
> > > > > >
> > > > > > My classes are (I did not represent accessors & constructors):
> > > > > >
> > > > > > public class Cheese {
> > > > > > protected String name;
> > > > > > }
> > > > > >
> > > > > > public class FrenchCheese extends Cheese{
> > > > > > private String smell;
> > > > > > }
> > > > > >
> > > > > > public class Person {
> > > > > > private Cheese likes;
> > > > > > }
> > > > > >
> > > > > > Here is my rule set :
> > > > > >
> > > > > > package rules
> > > > > >
> > > > > > rule "likes cheese"
> > > > > > when
> > > > > > $person : Person ()
> > > > > > Cheese(  ) from $person.getLikes()
> > > > > > then
> > > > > > System.out.println ("likes cheese");
> > > > > > end
> > > > > >
> > > > > >
> > > > > > rule "likes french cheese"
> > > > > > when
> > > > > > $person : Person ()
> > > > > > FrenchCheese(  ) from $person.getLikes()
> > > > > > then
> > > > > > System.out.println ("likes french cheese");
> > > > > > end
> > > > > >
> > > > > > First test :
> > > > > > Cheese cheese = new FrenchCheese("good", "camembert");
> > > > > > Person person = new Person();
> > > > > > person.setLikes(cheese);
> > > > > >
> > > > > > Output :
> > > > > > likes french cheese
> > > > > > likes cheese
> > > > > >
> > > > > > Wich is expected...
> > > > > >
> > > > > > Second test :
> > > > > > Cheese cheese = new Cheese();
> > > > > > Person person = new Person();
> > > > > > person.setLikes(cheese);
> > > > > >
> > > > > > Output :
> > > > > > likes french cheese
> > > > > > likes cheese
> > > > > >
> > > > > > That's the first strange thing. As far as I am concerned, rule
> > > > > > "likes french cheese" should not match (since a Cheese is not a
> > > > > > FrenchCheese).
> > > > > >
> > > > > > I made a change to the second rule :
> > > > > > rule "likes french cheese"
> > > > > > when
> > > > > > $person : Person ()
> > > > > > FrenchCheese( smell == "good" ) from $person.getLikes()
> > > > > > then
> > > > > > System.out.println("likes french cheese");
> > > > > > end
> > > > > >
> > > > > > Third test :
> > > > > > Cheese cheese = new Cheese();
> > > > > > 

RE: [rules-users] Please help

2007-09-28 Thread Anstis, Michael \(M.\)
You will need to use the exists keyword.
 
Without digging around for the manual you need to do something like:-
 
when
exists (
LineItem( $parent: parentId )
LineItem( id != $parent )
)
then
// raise the exception
end
 



  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bhattacharya,
Sougata
Sent: 28 September 2007 14:50
To: Rules Users List
Subject: RE: [rules-users] Please help



No 30 is not correct, I want if 1  lineItem.parentId does not equals to any
of the LineItem.Id throw one exception.

 

Thanks

 

 

 


  _  


From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Anstis, Michael
(M.)
Sent: Friday, September 28, 2007 7:13 PM
To: Rules Users List
Subject: RE: [rules-users] Please help

 

Is 30 correct, you are not clear. Did you want one exception for any number
of violations?

 


  _  


From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bhattacharya,
Sougata
Sent: 28 September 2007 14:33
To: Rules Users List
Subject: RE: [rules-users] Please help

Oh yes this raises 30 exceptions if I have 6 Line Items

 


  _  


From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Edson Tirelli
Sent: Friday, September 28, 2007 6:53 PM
To: Rules Users List
Subject: Re: [rules-users] Please help

 



when
LineItem( $parent: parentId )
LineItem( id != $parent )
then
// raise the exception
end

2007/9/28, Bhattacharya, Sougata <

[EMAIL PROTECTED]>:

 

Hi All,

  I am using drool to validate my business objects. I have a Business object
like this

LineItem

   String ID

   String parentId

 

I get 5 LineItems in a row and each line item has ID  and a Parent ID, I
will have to check 

 

if(parented of Any LineItem ! = ID of any LineITem)

I have to show an exception,

Please help me to solve this

 

Cheers

Su


This message contains information that may be privileged or confidential and
is the property of the Capgemini Group. It is intended only for the person
to whom it is addressed. If you are not the intended recipient, you are not
authorized to read, print, retain, copy, disseminate, distribute, or use
this message or any part thereof. If you receive this message in error,
please notify the sender immediately and delete all copies of this message. 

 


This message contains information that may be privileged or confidential and
is the property of the Capgemini Group. It is intended only for the person
to whom it is addressed. If you are not the intended recipient, you are not
authorized to read, print, retain, copy, disseminate, distribute, or use
this message or any part thereof. If you receive this message in error,
please notify the sender immediately and delete all copies of this message. 


___
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 


This message contains information that may be privileged or confidential and
is the property of the Capgemini Group. It is intended only for the person
to whom it is addressed. If you are not the intended recipient, you are not
authorized to read, print, retain, copy, disseminate, distribute, or use
this message or any part thereof. If you receive this message in error,
please notify the sender immediately and delete all copies of this message.

 

This message contains information that may be privileged or confidential and
is the property of the Capgemini Group. It is intended only for the person
to whom it is addressed. If you are not the intended recipient, you are not
authorized to read, print, retain, copy, disseminate, distribute, or use
this message or any part thereof. If you receive this message in error,
please notify the sender immediately and delete all copies of this message.





smime.p7s
Description: S/MIME cryptographic signature
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] Please help

2007-09-28 Thread Anstis, Michael (M.)
Is 30 correct, you are not clear. Did you want one exception for any number
of violations?


  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bhattacharya,
Sougata
Sent: 28 September 2007 14:33
To: Rules Users List
Subject: RE: [rules-users] Please help



Oh yes this raises 30 exceptions if I have 6 Line Items

 


  _  


From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Edson Tirelli
Sent: Friday, September 28, 2007 6:53 PM
To: Rules Users List
Subject: Re: [rules-users] Please help

 



when
LineItem( $parent: parentId )
LineItem( id != $parent )
then
// raise the exception
end

2007/9/28, Bhattacharya, Sougata <

[EMAIL PROTECTED]>:

 

Hi All,

  I am using drool to validate my business objects. I have a Business object
like this

LineItem

   String ID

   String parentId

 

I get 5 LineItems in a row and each line item has ID  and a Parent ID, I
will have to check 

 

if(parented of Any LineItem ! = ID of any LineITem)

I have to show an exception,

Please help me to solve this

 

Cheers

Su


This message contains information that may be privileged or confidential and
is the property of the Capgemini Group. It is intended only for the person
to whom it is addressed. If you are not the intended recipient, you are not
authorized to read, print, retain, copy, disseminate, distribute, or use
this message or any part thereof. If you receive this message in error,
please notify the sender immediately and delete all copies of this message. 

 


This message contains information that may be privileged or confidential and
is the property of the Capgemini Group. It is intended only for the person
to whom it is addressed. If you are not the intended recipient, you are not
authorized to read, print, retain, copy, disseminate, distribute, or use
this message or any part thereof. If you receive this message in error,
please notify the sender immediately and delete all copies of this message. 


___
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 

This message contains information that may be privileged or confidential and
is the property of the Capgemini Group. It is intended only for the person
to whom it is addressed. If you are not the intended recipient, you are not
authorized to read, print, retain, copy, disseminate, distribute, or use
this message or any part thereof. If you receive this message in error,
please notify the sender immediately and delete all copies of this message.





smime.p7s
Description: S/MIME cryptographic signature
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Firing of specific rules

2007-09-28 Thread prateek.katiyar

Hi 
 
I am using Drools 4.0.
First time I want to fire some specific rules from my rule file(in .xml format) 
and then other rules for the second time.
I have defined agenda-group attribute for the rules as follows:
 
 
 
how can I execute specific rules using agenda group or is there any other 
options are available.
When I had gone through Drools documentation ,they mentioned Listener api can 
be used to execute specific rules but I did not find enough information on 
Listener.
Please let me know how can I implement Listener api to execute specific rules.
 



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


RE: [rules-users] Please help

2007-09-28 Thread Bhattacharya, Sougata

No 30 is not correct, I want if 1  lineItem.parentId does not equals to
any of the LineItem.Id throw one exception.

 

Thanks

 

 

 



From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Anstis,
Michael (M.)
Sent: Friday, September 28, 2007 7:13 PM
To: Rules Users List
Subject: RE: [rules-users] Please help

 

Is 30 correct, you are not clear. Did you want one exception for any
number of violations?

 





From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bhattacharya,
Sougata
Sent: 28 September 2007 14:33
To: Rules Users List
Subject: RE: [rules-users] Please help

Oh yes this raises 30 exceptions if I have 6 Line Items

 





From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Edson Tirelli
Sent: Friday, September 28, 2007 6:53 PM
To: Rules Users List
Subject: Re: [rules-users] Please help

 



when
LineItem( $parent: parentId )
LineItem( id != $parent )
then
// raise the exception
end

2007/9/28, Bhattacharya, Sougata <
[EMAIL PROTECTED]
 >:

 

Hi All,

  I am using drool to validate my business objects. I have a
Business object like this

LineItem

   String ID

   String parentId

 

I get 5 LineItems in a row and each line item has ID  and a
Parent ID, I will have to check 

 

if(parented of Any LineItem ! = ID of any LineITem)

I have to show an exception,

Please help me to solve this

 

Cheers

Su

This message contains information that may be privileged or confidential
and is the property of the Capgemini Group. It is intended only for the
person to whom it is addressed. If you are not the intended recipient,
you are not authorized to read, print, retain, copy, disseminate,
distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all
copies of this message. 

 

This message contains information that may be privileged or confidential
and is the property of the Capgemini Group. It is intended only for the
person to whom it is addressed. If you are not the intended recipient,
you are not authorized to read, print, retain, copy, disseminate,
distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all
copies of this message. 


___
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 

This message contains information that may be privileged or confidential
and is the property of the Capgemini Group. It is intended only for the
person to whom it is addressed. If you are not the intended recipient,
you are not authorized to read, print, retain, copy, disseminate,
distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all
copies of this message.

 



This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] Please help

2007-09-28 Thread Bhattacharya, Sougata

Oh yes this raises 30 exceptions if I have 6 Line Items

 



From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Edson Tirelli
Sent: Friday, September 28, 2007 6:53 PM
To: Rules Users List
Subject: Re: [rules-users] Please help

 



when
LineItem( $parent: parentId )
LineItem( id != $parent )
then
// raise the exception
end

2007/9/28, Bhattacharya, Sougata < [EMAIL PROTECTED]
 >:

 

Hi All,

  I am using drool to validate my business objects. I have a Business
object like this

LineItem

   String ID

   String parentId

 

I get 5 LineItems in a row and each line item has ID  and a Parent ID, I
will have to check 

 

if(parented of Any LineItem ! = ID of any LineITem)

I have to show an exception,

Please help me to solve this

 

Cheers

Su

This message contains information that may be privileged or confidential
and is the property of the Capgemini Group. It is intended only for the
person to whom it is addressed. If you are not the intended recipient,
you are not authorized to read, print, retain, copy, disseminate,
distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all
copies of this message. 

 

This message contains information that may be privileged or confidential
and is the property of the Capgemini Group. It is intended only for the
person to whom it is addressed. If you are not the intended recipient,
you are not authorized to read, print, retain, copy, disseminate,
distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all
copies of this message. 


___
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 



This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Please help

2007-09-28 Thread Edson Tirelli
when
LineItem( $parent: parentId )
LineItem( id != $parent )
then
// raise the exception
end

2007/9/28, Bhattacharya, Sougata <[EMAIL PROTECTED]>:
>
>
>
> Hi All,
>
>   I am using drool to validate my business objects. I have a Business
> object like this
>
> LineItem
>
>String ID
>
>String parentId
>
>
>
> I get 5 LineItems in a row and each line item has ID  and a Parent ID, I
> will have to check
>
>
>
> if(parented of Any LineItem ! = ID of any LineITem)
>
> I have to show an exception,
>
> Please help me to solve this
>
>
>
> Cheers
>
> Su
>  This message contains information that may be privileged or confidential
> and is the property of the Capgemini Group. It is intended only for the
> person to whom it is addressed. If you are not the intended recipient, you
> are not authorized to read, print, retain, copy, disseminate, distribute, or
> use this message or any part thereof. If you receive this message in error,
> please notify the sender immediately and delete all copies of this message.
>
>  This message contains information that may be privileged or confidential
> and is the property of the Capgemini Group. It is intended only for the
> person to whom it is addressed. If you are not the intended recipient, you
> are not authorized to read, print, retain, copy, disseminate, distribute, or
> use this message or any part thereof. If you receive this message in error,
> please notify the sender immediately and delete all copies of this message.
>
>
> ___
> 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


Re: [rules-users] Classpath and jar issue

2007-09-28 Thread Edson Tirelli
Krishnan,

You should not need decision tables and jsr94 jars if you are not using
such feature. Regarding the compiler, you must use either core (jdt) jar or
Janino jar... I'm not aware of any hard dependency on core itself... if it
exists, please open a jira for us to fix.

[]s
Edson

2007/9/28, Krishnan <[EMAIL PROTECTED]>:
>
>
> hi all,
>
> In my application, I use simple drl file based rules and it is not a J2EE
> application. Based on the dependencies
> documentation
> http://anonsvn.labs.jboss.com/labs/jbossrules/tags/4.0.1.14754GA/README_DEPENDENCIES.txt
> , it seems I am in the compiler option
>
> The only jars I am including are as follows :-
>
> drools-compiler-4.0.0.jar
> drools-core-4.0.0.jar
> drools-decisiontables-4.0.0.jar
> drools-jsr94-4.0.0.jar
> antlr-runtime-3.0.jar
> mvel14-1.2rc1.jar
>
> core-3.2.3.v_686_R32x.jar [Can anyone explain why I need this, the
> documentation seems like this is optional, but when I
> don't specify this, it does not work ?.]
>
> I also tried not including the core but including the janino library and
> specifying the janino compiler at run time and that also
> expects the core to be included. Any help is appreciated.
>
> TIA,
> Krishnan.
>
> --
> Sivaramakrishna Iyer Krishnan (Anand)
>
> Never assume the obvious is true.
> - William Safire
> ___
> 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] Please help

2007-09-28 Thread Bhattacharya, Sougata

 

Hi All,

  I am using drool to validate my business objects. I have a Business
object like this

LineItem

   String ID

   String parentId

 

I get 5 LineItems in a row and each line item has ID  and a Parent ID, I
will have to check 

 

if(parented of Any LineItem ! = ID of any LineITem)

I have to show an exception,

Please help me to solve this

 

Cheers

Su

This message contains information that may be privileged or confidential
and is the property of the Capgemini Group. It is intended only for the
person to whom it is addressed. If you are not the intended recipient,
you are not authorized to read, print, retain, copy, disseminate,
distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all
copies of this message.


This message contains information that may be privileged or confidential
and is the property of the Capgemini Group. It is intended only for the
person to whom it is addressed. If you are not the intended recipient,
you are not authorized to read, print, retain, copy, disseminate,
distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all
copies of this message.




This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Please help

2007-09-28 Thread Bhattacharya, Sougata

 

Hi All,

  I am using drool to validate my business objects. I have a Business
object like this

LineItem

   String ID

   String parentId

 

I get 5 LineItems in a row and each line item has ID  and a Parent ID, I
will have to check 

 

if(parented of Any LineItem ! = ID of any LineITem)

I have to show an exception,

Please help me to solve this

 

Cheers

Su

This message contains information that may be privileged or confidential
and is the property of the Capgemini Group. It is intended only for the
person to whom it is addressed. If you are not the intended recipient,
you are not authorized to read, print, retain, copy, disseminate,
distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all
copies of this message.




This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Re: licensing text

2007-09-28 Thread Krishnan
thanks a lot geoffrey.

-Krishnan.

On 9/28/07, Geoffrey De Smet <[EMAIL PROTECTED]> wrote:
>
> jxl is http://jexcelapi.sourceforge.net/
> it's not http://sourceforge.net/projects/jxl/
>
> so it's LGPM:
> http://sourceforge.net/projects/jexcelapi
>
> very confusing indeed :(
> but mvnrepository.com search on "jxl" explains why:
>
> #  net.sourceforge.jexcelapi » jxl
>
> jxl - JExcelApi is a java library which provides the ability to read,
> write, and modify Microsoft Excel spreadsheets.
>
>
>
> With kind regards,
> Geoffrey De Smet
>
> Krishnan schreef:
> > Hi Mark,
> >
> > I tried to google for jxl-2.4.2.jar and I must say that the site it
> > pointed me towards was the following :-
> > http://sourceforge.net/projects/jxl/
> >
> > The license for this seems to be GPL. Am I looking at the wrong library,
> > if so can you send me the
> > website for the right library ?. I could not also find any website for
> > core-3.2.3.v_686_R32x.jar  ?.
> >
> > Sorry for the weird request but the legal department at my work is
> > breathing down my throat for using
> > drools which was helpful in solving my technical problem.
> >
> > TIA,
> > Krishnan.
> >
> > On 9/26/07, *Krishnan* <[EMAIL PROTECTED]
> > > wrote:
> >
> >
> > hi,
> >
> > I am trying to use drools 4.0 for our project and understand the
> > licensing agreement for drools. Drools
> > uses Apache license where as some of the dependant libraries use New
> > BSD and other type of licenses.
> > Since I am not a lawyer, does anybody have any idea of any
> > implications on any problems related to
> > the licenses ?.
> >
> > Drools use the following libraries
> >
> > antlr-runtime-3.0.jar
> > core-3.2.3.v_686_R32x.jar
> > janino-2.5.7.jar
> > jsr94-1.1.jar
> > jxl-2.4.2.jar
> > mvel14-1.2rc1.jar
> > xercesImpl-2.4.0.jar
> > xml-apis-1.0.b2.jar
> > xpp3-1.1.3.4.O.jar
> > xstream-1.1.3.jar
> >
> > (a) Do you guys have the licensing agreement for each of these jars
> ?
> > (b) Also, I tried searching for the websites using their name but
> > some of them I am not able to find. IF you
> > have the website information for these jars, that will help.
> > (c) Has anybody run into any particular licensing issue problem with
> > Drools ?.
> >
> > Any help is appreciated.
> >
> > Thanks,
> > Krishnan.
> >
> >
> > --
> > Sivaramakrishna Iyer Krishnan (Anand)
> >
> > Never assume the obvious is true.
> > - William Safire
> >
> >
> >
> >
> > --
> > Sivaramakrishna Iyer Krishnan (Anand)
> >
> > Never assume the obvious is true.
> > - William Safire
> >
> >
> > 
> >
> > ___
> > 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
>



-- 
Sivaramakrishna Iyer Krishnan (Anand)

Never assume the obvious is true.
- William Safire
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Classpath and jar issue

2007-09-28 Thread Krishnan
hi all,

In my application, I use simple drl file based rules and it is not a J2EE
application. Based on the dependencies
documentation
http://anonsvn.labs.jboss.com/labs/jbossrules/tags/4.0.1.14754GA/README_DEPENDENCIES.txt
, it seems I am in the compiler option

The only jars I am including are as follows :-

drools-compiler-4.0.0.jar
drools-core-4.0.0.jar
drools-decisiontables-4.0.0.jar
drools-jsr94-4.0.0.jar
antlr-runtime-3.0.jar
mvel14-1.2rc1.jar

core-3.2.3.v_686_R32x.jar [Can anyone explain why I need this, the
documentation seems like this is optional, but when I
don't specify this, it does not work ?.]

I also tried not including the core but including the janino library and
specifying the janino compiler at run time and that also
expects the core to be included. Any help is appreciated.

TIA,
Krishnan.

-- 
Sivaramakrishna Iyer Krishnan (Anand)

Never assume the obvious is true.
- William Safire
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] accumulate funtion in xml

2007-09-28 Thread Isabelle Hupont

Hi Fernando!!

I have fixed the problem... I didn't changed drools v3 modify(_i) statement
by drools v4 update(-i).
Now everything works well!
Thanks a lot for your attention.




Isabelle Hupont wrote:
> 
> Sorry!! I mixed the .class and. java files!! ;)
> Here is the source code. I also paste the code I am using to read the rule
> package: 
> 
> public RuleBase readRulePackage() throws PersistenceException{
>   // Reads a set of rules from XML file
>   try {   
> 
>   PackageBuilder builder = new PackageBuilder();
>   builder.addPackageFromXml(new InputStreamReader(new
> FileInputStream(ruleFile)));
> 
>   ruleBase = RuleBaseFactory.newRuleBase();
>   ruleBase.addPackage(builder.getPackage());
>   return ruleBase;
>   
>   } catch (Exception e){
>   e.printStackTrace();
>   throw new PersistenceException("Error reading rules 
> file");
>   }
>   }
> 
> thx! http://www.nabble.com/file/p12935779/Instance.java Instance.java 
> 
> 
> Fernando Meyer Camargo wrote:
>> 
>> Hi isabelle,
>> 
>> When I said instance class, I was meaning your instance source code ;)
>> 
>> Regards
>> 
>> On 9/28/07, Isabelle Hupont <[EMAIL PROTECTED]> wrote:
>>>
>>>
>>> Hi Fernando!
>>>
>>> Mi Instance class is the Weka class I attach
>>> Thanks for your attention.
>>> Isabelle.
>>> http://www.nabble.com/file/p12935480/Instance.class Instance.class
>>>
>>>
>>>
>>> Fernando Meyer Camargo wrote:
>>> >
>>> > Could you please provide your Instance class ?
>>> >
>>> >
>>> > On 9/27/07, Isabelle Hupont <[EMAIL PROTECTED]> wrote:
>>> >>
>>> >>
>>> >> Hi!
>>> >>
>>> >> I want to program the following drl rule in xml:
>>> >>
>>> >> rule "average calculation"
>>> >> no-loop true
>>> >> when
>>> >> _i : Instance()
>>> >> _average : Double()
>>> >> from accumulate(accInst: Instance(),
>>> >>average(
>>> >> accInst.value("tend")))
>>> >> eval(_average < 2)
>>> >> then
>>> >> _i.setValue("tend",2000);
>>> >> end
>>> >>
>>> >>
>>> >> For it, I have implemented the following xml file:
>>> >>
>>> >> 
>>> >> >> xmlns="http://drools.org/drools-4.0";
>>> >> xmlns:xs="http://www.w3.org/2001/XMLSchema-instance";
>>> >> xs:schemaLocation="http://drools.org/drools-4.0 drools-4.0.xsd">
>>> >> 
>>> >> 
>>> >> 
>>> >> 
>>> >> 
>>> >> 
>>> >> 
>>> >> 
>>> >> 
>>> >> 
>>> >> 
>>> >> 
>>> >> 
>>> >> >> >> object-type="Instance"/>
>>> >> >> >> expression="accInst.value("tend")"/>
>>> >> 
>>> >> 
>>> >> 
>>> >> _average < 2.0
>>> >> 
>>> >> 
>>> >> _i.setValue("tend", 2000.0); manageRuleFired("Rule1", null, _i);
>>> >> modify(_i);
>>> >> 
>>> >> 
>>> >>
>>> >> And I have the following error when reading the rule package:
>>> >>
>>> >> org.drools.rule.InvalidRulePackage: Rule Compilation error _average
>>> >> cannot
>>> >> be resolved _i cannot be resolved _i cannot be resolved _i__Handle__
>>> >> cannot
>>> >> be resolved _i cannot be resolved
>>> >>
>>> >>
>>> >> I also have tried to replace the xml identifier  by 
>>> >> with
>>> >> no result. Can you help me, please?
>>> >>
>>> >>
>>> >> --
>>> >> View this message in context:
>>> >>
>>> http://www.nabble.com/accumulate-funtion-in-xml-tf4526879.html#a12916380
>>> >> 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
>>> >>
>>> >
>>> >
>>> >
>>> > --
>>> > 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
>>> >
>>> >
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/accumulate-funtion-in-xml-tf4526879.html#a12935480
>>> 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
>>>
>> 
>> 
>> 
>> -- 
>> 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] BRMS class cast exception

2007-09-28 Thread Wojtek Kedzior
Hello,

Im having trouble with the BRMS front end throwing an:

Exception in thread "main" java.lang.ClassCastException: java.util.HashSet 
cannot be cast to java.util.List
at org.drools.rule.Package.readExternal(Package.java:172)


This is what I have set up:

  jbossweb-1.0.1.GA
  drools-4.0.1-brms
  Java version 1.6.0 - VM 1.6.0-b105

mvel jar file:

  mvel14-1.2rc4rv908 (taken from the jbossweb lib)


This is the class, which i put into a .jar, which in turn I import into the 
front end:


package data;

import java.io.Serializable;

public class ExceptionType implements Serializable{
private String customerType = "";
private String exceptionType = "";

public ExceptionType(){}

public ExceptionType(String customerType, String exceptionType)
{
this.exceptionType = exceptionType;
this.customerType = customerType;
}

public void setExceptionType(String exceptionType) {
this.exceptionType = exceptionType;
}

public String getExceptionType() {
return exceptionType;
}

public void setCustomerType(String customerType) {
this.customerType = customerType;
}

public String getCustomerType() {
return customerType;
}
}




And here is the starting point:




package data;

import java.util.Properties;

import org.drools.RuleBase;
import data.ExceptionType;
import org.drools.StatefulSession;
import org.drools.agent.RuleAgent;


public class Runner {
public Runner()
{
ExceptionType e = new ExceptionType("das", "32432");
e.setExceptionType("system failure");

Properties prop = new Properties();
prop.setProperty("newInstance", "true");

prop.setProperty("url","http://localhost:8080/drools-jbrms/org.drools.brms.JBRMS/package/defaultPackage/snap2";);

prop.setProperty("poll", "30");

RuleAgent agent = RuleAgent.newRuleAgent(prop);  //error occurs 
on this line.
RuleBase rb = agent.getRuleBase();

StatefulSession session = rb.newStatefulSession();
session.insert(e);
session.fireAllRules(); 
}
/**
 * @param args
 */
public static void main(String[] args)
{
new Runner();
}
}


I have specified a package import in the packge in the front end:

   import data.ExceptionType

Validation of the .jar file and build of the package seem to work fine.



Here is the complete stack trace:

RuleAgent(default) INFO (Fri Sep 28 21:57:54 NZST 2007): Configuring with 
newInstance=true, secondsToRefresh=30
RuleAgent(default) INFO (Fri Sep 28 21:57:54 NZST 2007): Configuring package 
provider : URLScanner monitoring URLs:  
http://localhost:8080/drools-jbrms/org.drools.brms.JBRMS/package/defaultPackage/snap2
Exception in thread "main" java.lang.ClassCastException: java.util.HashSet 
cannot be cast to java.util.List
at org.drools.rule.Package.readExternal(Package.java:172)
at 
java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1792)
at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1751)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at org.drools.agent.HttpClientImpl.fetchPackage(HttpClientImpl.java:54)
at org.drools.agent.URLScanner.readPackage(URLScanner.java:137)
at org.drools.agent.URLScanner.getChangeSet(URLScanner.java:109)
at org.drools.agent.URLScanner.loadPackageChanges(URLScanner.java:88)
at org.drools.agent.RuleAgent.checkForChanges(RuleAgent.java:297)
at org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:265)
at org.drools.agent.RuleAgent.configure(RuleAgent.java:251)
at org.drools.agent.RuleAgent.init(RuleAgent.java:183)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:140)
at data.Runner.(Runner.java:25)
at data.Runner.main(Runner.java:37)


Any help would be appreciated.


Thanks,

Wojtek Kedzior

First Data Utilities
Auckland, New Zealand

Software Engineering





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


[rules-users] execute specific rule using agenda

2007-09-28 Thread marimuthu.balasubramanian

Hi,
I would like to execute specific rules from the rule file(.xml).
Find the rule file content below. There are three rules are available in
the xml file(Rule names: 1.Check_NotNullof_rfqId ,
2.Check_NotNullof_partId and 3.validateFullName)
First time we are trying to execute 1.Check_NotNullof_rfqId and
2.Check_NotNullof_partId rules. next time we are trying to execute
3.validateFullName rule
 
We have tried the following option 
 
The rule name start with "Check" require to set only "rfq" global
identifier.
So when we execute first two rules we followed following approach
workingMemory.setGlobal("rfq",rfqbean);
workingMemory.fireAllRules(new RuleNameStartsWithAgendaFilter( "Check"
));  
 
but it gives following NullPointerException. It is trying to execute
validatefullname rule also.
Caused by: java.lang.NullPointerException
at
rules.Rule_Check_NotNullof_rfqId_0.eval0(Rule_Check_NotNullof_rfqId_0.ja
va:9)
at
rules.Rule_Check_NotNullof_rfqId_0Eval0Invoker.evaluate(Rule_Check_NotNu
llof_rfqId_0Eval0Invoker.java:16)
at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:71)
... 12 more
 
When  we execute third rule alone. we followed following approach
workingMemory.setGlobal("loanApplication",loanApplicationbean);
workingMemory.fireAllRules(new RuleNameStartsWithAgendaFilter(
"validate" ));
 
 
Please help us to resolve this issue
 
XML rule File
 

http://drools.org/drools-4.0";
 xmlns:xs="http://www.w3.org/2001/XMLSchema-instance";
 xs:schemaLocation="http://drools.org/drools-4.0
drools-4.0.xsd">
 
 
 
  
 
  
   (rfq.getM_rfqId() =="null") ||
(rfq.getM_rfqId().trim().equals(""))
  
  
   System.out.println("The value of m_rfqId is null");
  

 
  
  
   (rfq.getM_partId() =="null") ||
(rfq.getM_partId().trim().equals(""))
  
  
   System.out.println("The value of m_partId is null");
  
 
 
 
 
 

  
  
 
loanApplication.getFullName() == null ||
loanApplication.getFullName().trim().equals("")
  
 
  System.out.println("full name is null from xml");
  
  




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


Re: [rules-users] Re: About for and inheritance

2007-09-28 Thread Chris Woodrow
I am a bit surprised by your answer...

Let's consider :
rule "likes french cheese1"
when
FrenchCheese( smell == "good" )
then
System.out.println("likes french cheese1");
end

rule "likes french cheese2"
when
$person : Person ()
FrenchCheese( smell == "good" )  from $person.getLikes()
then
System.out.println("likes french cheese2");
end

These 2 rules do not behave the same way :
- First one simply does not match (with a Cheese instance inserted in WM)
- Second one throws an error (see third test in my original mail)

Chris


2007/9/27, Edson Tirelli <[EMAIL PROTECTED]>:
>
>
>Ideal IMO would be a compile time error, since getLikes() returns a
> Cheese instance, but as we use MVEL to resolve the expression, I'm not 100%
> sure we are able to cover all possible scenarios at compile time. I guess we
> can, but need to double check that.
>
>[]s
>Edson
>
> 2007/9/27, Chris Woodrow <[EMAIL PROTECTED]>:
> >
> > Thanks.
> > I was supposing so...
> > Do you think test 3 should throw a ClassCastException or just not match?
> > Chris
> >
> > 2007/9/27, Edson Tirelli < [EMAIL PROTECTED] >:
> > >
> > >
> > >Yes, drools is deferring the type verification until it is needed
> > > (in your example, to check the constraint). May I ask you please to open a
> > > JIRA... I will fix that.
> > >
> > >   []s
> > >   Edson
> > >
> > > 2007/9/27, Chris Woodrow <[EMAIL PROTECTED]>:
> > >
> > > >  I am sorry I didn't mean 'for' but 'from'.
> > > > :D
> > > >
> > > > 2007/9/27, Chris Woodrow < [EMAIL PROTECTED]>:
> > > > >
> > > > > Hi,
> > > > > I recently find out a few issues using for, and I wanted to share
> > > > > it with you. I made a simple exemple to illustrate my purpose.
> > > > >
> > > > > My classes are (I did not represent accessors & constructors):
> > > > >
> > > > > public class Cheese {
> > > > > protected String name;
> > > > > }
> > > > >
> > > > > public class FrenchCheese extends Cheese{
> > > > > private String smell;
> > > > > }
> > > > >
> > > > > public class Person {
> > > > > private Cheese likes;
> > > > > }
> > > > >
> > > > > Here is my rule set :
> > > > >
> > > > > package rules
> > > > >
> > > > > rule "likes cheese"
> > > > > when
> > > > > $person : Person ()
> > > > > Cheese(  ) from $person.getLikes()
> > > > > then
> > > > > System.out.println ("likes cheese");
> > > > > end
> > > > >
> > > > >
> > > > > rule "likes french cheese"
> > > > > when
> > > > > $person : Person ()
> > > > > FrenchCheese(  ) from $person.getLikes()
> > > > > then
> > > > > System.out.println ("likes french cheese");
> > > > > end
> > > > >
> > > > > First test :
> > > > > Cheese cheese = new FrenchCheese("good", "camembert");
> > > > > Person person = new Person();
> > > > > person.setLikes(cheese);
> > > > >
> > > > > Output :
> > > > > likes french cheese
> > > > > likes cheese
> > > > >
> > > > > Wich is expected...
> > > > >
> > > > > Second test :
> > > > > Cheese cheese = new Cheese();
> > > > > Person person = new Person();
> > > > > person.setLikes(cheese);
> > > > >
> > > > > Output :
> > > > > likes french cheese
> > > > > likes cheese
> > > > >
> > > > > That's the first strange thing. As far as I am concerned, rule
> > > > > "likes french cheese" should not match (since a Cheese is not a
> > > > > FrenchCheese).
> > > > >
> > > > > I made a change to the second rule :
> > > > > rule "likes french cheese"
> > > > > when
> > > > > $person : Person ()
> > > > > FrenchCheese( smell == "good" ) from $person.getLikes()
> > > > > then
> > > > > System.out.println("likes french cheese");
> > > > > end
> > > > >
> > > > > Third test :
> > > > > Cheese cheese = new Cheese();
> > > > > Person person = new Person();
> > > > > person.setLikes(cheese);
> > > > >
> > > > > output :
> > > > > It throwed an exception : Exception in thread "main"
> > > > > java.lang.ClassCastException: rules.Cheese
> > > > > I am not saying the ClassCastException is not to expect in such a
> > > > > case but I think I would simply expect it not to match (as far as a 
> > > > > Cheese
> > > > > is not a FrenchCheese).
> > > > >
> > > > > Chris
> > > > >
> > > >
> > > >
> > > > ___
> > > > 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
> > >
> > >
> >
> > ___

RE: [rules-users] Hibernate

2007-09-28 Thread Heyns, Juan

This is very strange. Let me explain the scenario and you can tell me if
we have something fundamentally wrong.



We have a class (Persister) that receives a lightweight object (VO) to
persist, the Persister does the following:

1.   Starts a hibernate transaction

2.   Creates hibernate pojo's and calls
session.save(persister_created_pojo) on each of the pojo's

3.   Passes these objects to Drools, which creates more hibernate
pojo's and returns them

4.   The Persister class then calls
session.save(drools_created_pojo) for each of the returned pojo's

5.   If no errors exist the transaction is committed, otherwise it
is rolled back.



When we updated the drules packages from 4.0.0 to 4.0.1 we started
getting these errors, it seems like the session gets

disconnected the moment we pass the pojo to drools.



Maybe someone has some advice or has encountered something similar.



Juan



From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mark Proctor
Sent: 27 September 2007 04:12 PM
To: Rules Users List
Cc: [EMAIL PROTECTED]
Subject: Re: [rules-users] Hibernate



Drools doesn't handle Hibernate in anyway, we have no awareness of it.
The exceptions indicates that you have lazy loading enabled for
hibernate, but your session is disconnected when it tries to lazy load
the object.

Mark
Heyns, Juan wrote:

Hi,



I am getting the following error with 4.0.1, I didn't get this with
4.0.0... Has anything changed in the way Drools works with Hibernate.



Juan



15:24:52,281 ERROR LazyInitializationException:19 - failed to lazily
initialize a collection, no session or session was closed

org.hibernate.LazyInitializationException: failed to lazily initialize a
collection, no session or session was closed

  at
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializ
ationException(AbstractPersistentCollection.java:358)

  at
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializ
ationExceptionIfNotConnected(AbstractPersistentCollection.java:350)

  at
org.hibernate.collection.AbstractPersistentCollection.readElementExisten
ce(AbstractPersistentCollection.java:132)

  at
org.hibernate.collection.PersistentSet.contains(PersistentSet.java:153)

  at
org.drools.base.evaluators.ObjectFactory$ObjectContainsEvaluator.evaluat
eCachedLeft(ObjectFactory.java:481)

  at
org.drools.rule.VariableRestriction.isAllowedCachedLeft(VariableRestrict
ion.java:72)

  at
org.drools.rule.VariableConstraint.isAllowedCachedLeft(VariableConstrain
t.java:72)

  at
org.drools.common.SingleBetaConstraints.isAllowedCachedLeft(SingleBetaCo
nstraints.java:117)

  at org.drools.reteoo.JoinNode.assertTuple(JoinNode.java:119)

  at
org.drools.reteoo.CompositeTupleSinkAdapter.createAndPropagateAssertTupl
e(CompositeTupleSinkAdapter.java:73)

  at
org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode
.java:131)

  at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleOb
jectSinkAdapter.java:20)

  at
org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:160)

  at org.drools.reteoo.Rete.assertObject(Rete.java:176)

  at
org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:196)

  at
org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:
70)

  at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.jav
a:854)

  at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.jav
a:826)

  at
org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.jav
a:60)

  at
org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.jav
a:54)

  at
com.lonmin.bns.domain.rules.Rule_Stope_Drilling_work_is_evaluated_based_
on_the_holes_drilled_and_blasts_0.consequence(Rule_Stope_Drilling_work_i
s_evaluated_based_on_the_holes_drilled_and_blasts_0.java:35)

  at
com.lonmin.bns.domain.rules.Rule_Stope_Drilling_work_is_evaluated_based_
on_the_holes_drilled_and_blasts_0ConsequenceInvoker.evaluate(Rule_Stope_
Drilling_work_is_evaluated_based_on_the_holes_drilled_and_blasts_0Conseq
uenceInvoker.java:22)

  at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:550)

  at
org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:514)

  at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemo
ry.java:434)

  at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemo
ry.java:396)

  at
com.lonmin.bns.domain.rules.RulesEngine.calculateStopeDrillingBonus(Rule
sEngine.java:54)

  at
com.lonmin.bns.domain.model.StopeDrillingCardPersister.processDetail(Sto
peDrillingCardPersister.java:371)

  at
com.lonmin.bns.domain.model.StopeDrillingCardPersister.processCard(Stope
DrillingCardPersister.java:276)

  at
com.lonmin.bns.domain.model.StopeDrillingCardPersister.process(StopeDril
lingCardPersister.java:69)

  at
c

Re: [rules-users] RE: rules-users Digest, Vol 10, Issue 56

2007-09-28 Thread Mark Proctor

Try using a regular expression.

Mark
Sikkandar Nawabjan wrote:

Hi,

How to check my property contains only numeric.

for ex 

when 


address(telphoneno=="??")  telephone no should be numeric

then

s.o.p("error");

Basha

  



___
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-users Digest, Vol 10, Issue 56

2007-09-28 Thread Christian Spurk

Hi Basha!

Sikkandar Nawabjan wrote:

How to check my property contains only numeric.

for ex

when

address(telphoneno=="??")  telephone no should be numeric


then

s.o.p("error");


If your "telephoneno" variable is a String, you can use the "matches" 
operator (cf. Drools manual section 6.5.2.1.1.3.1., "Matches Operator"):


address(telephoneno matches "^\\d+$")

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


Re: [rules-users] RE: rules-users Digest, Vol 10, Issue 56

2007-09-28 Thread Christian Spurk

Hi again!

Christian Spurk wrote:

If your "telephoneno" variable is a String, you can use the "matches"
 operator (cf. Drools manual section 6.5.2.1.1.3.1., "Matches
Operator"):

address(telephoneno matches "^\\d+$")


Sorry, I should have read the manual more thoroughly; you dont' need to 
escape backslashes as in Java Strings, so the example would be instead:


address(telephoneno matches "^\d+$")

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


[rules-users] RE: rules-users Digest, Vol 10, Issue 56

2007-09-28 Thread Sikkandar Nawabjan
Hi,

How to check my property contains only numeric.

for ex 

when 

address(telphoneno=="??")  telephone no should be numeric

then

s.o.p("error");

Basha

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


Re: [rules-users] accumulate funtion in xml

2007-09-28 Thread Isabelle Hupont

Sorry!! I mixed the .class and. java files!! ;)
Here is the source code. I also paste the code I am using to read the rule
package: 

public RuleBase readRulePackage() throws PersistenceException{
// Reads a set of rules from XML file
try {   

PackageBuilder builder = new PackageBuilder();
builder.addPackageFromXml(new InputStreamReader(new
FileInputStream(ruleFile)));

ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage(builder.getPackage());
return ruleBase;

} catch (Exception e){
e.printStackTrace();
throw new PersistenceException("Error reading rules 
file");
}
}

thx! http://www.nabble.com/file/p12935779/Instance.java Instance.java 


Fernando Meyer Camargo wrote:
> 
> Hi isabelle,
> 
> When I said instance class, I was meaning your instance source code ;)
> 
> Regards
> 
> On 9/28/07, Isabelle Hupont <[EMAIL PROTECTED]> wrote:
>>
>>
>> Hi Fernando!
>>
>> Mi Instance class is the Weka class I attach
>> Thanks for your attention.
>> Isabelle.
>> http://www.nabble.com/file/p12935480/Instance.class Instance.class
>>
>>
>>
>> Fernando Meyer Camargo wrote:
>> >
>> > Could you please provide your Instance class ?
>> >
>> >
>> > On 9/27/07, Isabelle Hupont <[EMAIL PROTECTED]> wrote:
>> >>
>> >>
>> >> Hi!
>> >>
>> >> I want to program the following drl rule in xml:
>> >>
>> >> rule "average calculation"
>> >> no-loop true
>> >> when
>> >> _i : Instance()
>> >> _average : Double()
>> >> from accumulate(accInst: Instance(),
>> >>average(
>> >> accInst.value("tend")))
>> >> eval(_average < 2)
>> >> then
>> >> _i.setValue("tend",2000);
>> >> end
>> >>
>> >>
>> >> For it, I have implemented the following xml file:
>> >>
>> >> 
>> >> http://drools.org/drools-4.0";
>> >> xmlns:xs="http://www.w3.org/2001/XMLSchema-instance";
>> >> xs:schemaLocation="http://drools.org/drools-4.0 drools-4.0.xsd">
>> >> 
>> >> 
>> >> 
>> >> 
>> >> 
>> >> 
>> >> 
>> >> 
>> >> 
>> >> 
>> >> 
>> >> 
>> >> 
>> >> > >> object-type="Instance"/>
>> >> > >> expression="accInst.value("tend")"/>
>> >> 
>> >> 
>> >> 
>> >> _average < 2.0
>> >> 
>> >> 
>> >> _i.setValue("tend", 2000.0); manageRuleFired("Rule1", null, _i);
>> >> modify(_i);
>> >> 
>> >> 
>> >>
>> >> And I have the following error when reading the rule package:
>> >>
>> >> org.drools.rule.InvalidRulePackage: Rule Compilation error _average
>> >> cannot
>> >> be resolved _i cannot be resolved _i cannot be resolved _i__Handle__
>> >> cannot
>> >> be resolved _i cannot be resolved
>> >>
>> >>
>> >> I also have tried to replace the xml identifier  by 
>> >> with
>> >> no result. Can you help me, please?
>> >>
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/accumulate-funtion-in-xml-tf4526879.html#a12916380
>> >> 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
>> >>
>> >
>> >
>> >
>> > --
>> > 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
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/accumulate-funtion-in-xml-tf4526879.html#a12935480
>> 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
>>
> 
> 
> 
> -- 
> 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
> 
> 

-- 
View this message in context: 
http://www.nabble.com/accumulate-funtion-in-xml-tf4526879.html#a12935779
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] accumulate funtion in xml

2007-09-28 Thread Fernando Meyer
Hi isabelle,

When I said instance class, I was meaning your instance source code ;)

Regards

On 9/28/07, Isabelle Hupont <[EMAIL PROTECTED]> wrote:
>
>
> Hi Fernando!
>
> Mi Instance class is the Weka class I attach
> Thanks for your attention.
> Isabelle.
> http://www.nabble.com/file/p12935480/Instance.class Instance.class
>
>
>
> Fernando Meyer Camargo wrote:
> >
> > Could you please provide your Instance class ?
> >
> >
> > On 9/27/07, Isabelle Hupont <[EMAIL PROTECTED]> wrote:
> >>
> >>
> >> Hi!
> >>
> >> I want to program the following drl rule in xml:
> >>
> >> rule "average calculation"
> >> no-loop true
> >> when
> >> _i : Instance()
> >> _average : Double()
> >> from accumulate(accInst: Instance(),
> >>average(
> >> accInst.value("tend")))
> >> eval(_average < 2)
> >> then
> >> _i.setValue("tend",2000);
> >> end
> >>
> >>
> >> For it, I have implemented the following xml file:
> >>
> >> 
> >> http://drools.org/drools-4.0";
> >> xmlns:xs="http://www.w3.org/2001/XMLSchema-instance";
> >> xs:schemaLocation="http://drools.org/drools-4.0 drools-4.0.xsd">
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >>  >> object-type="Instance"/>
> >>  >> expression="accInst.value("tend")"/>
> >> 
> >> 
> >> 
> >> _average < 2.0
> >> 
> >> 
> >> _i.setValue("tend", 2000.0); manageRuleFired("Rule1", null, _i);
> >> modify(_i);
> >> 
> >> 
> >>
> >> And I have the following error when reading the rule package:
> >>
> >> org.drools.rule.InvalidRulePackage: Rule Compilation error _average
> >> cannot
> >> be resolved _i cannot be resolved _i cannot be resolved _i__Handle__
> >> cannot
> >> be resolved _i cannot be resolved
> >>
> >>
> >> I also have tried to replace the xml identifier  by 
> >> with
> >> no result. Can you help me, please?
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/accumulate-funtion-in-xml-tf4526879.html#a12916380
> >> 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
> >>
> >
> >
> >
> > --
> > 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
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/accumulate-funtion-in-xml-tf4526879.html#a12935480
> 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
>



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