[rules-users] Creating DSL rules in guvnor - Object mapping issues

2010-06-30 Thread Fnu Mahalakshmi
hi,

I am wanting to use a particular feature while creating my DSLs using enums. Is 
it possible???
what i want to do is :
[when]When the credit rating is {rating:ENUM:Applicant.creditRating} = 
applicant:Applicant(creditRating=="{rating}")
[then]Approve the loan = applicant.setApproved(true)

I want the option to be either an Applicant or an Employee [both are different 
fact models)

So is it possible to do a mapping using Enums for the 2 object types : 
Applicant / Employee ???

Please Help
M




Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


Re: [rules-users] Dynamic Loading of Rules from BRMS

2010-06-28 Thread Fnu Mahalakshmi
Hi,

I did try to do what you suggested:
My change-set.xml is in my main project folder and I set the URL to point to 
that file.
kagent.applyChangeSet( ResourceFactory.newUrlResource("change-set.xml"));

But still the file does not get parsed or detected. 

I change set has to be in the project folder right as per my understanding?

Thanks.

--

Message: 3
Date: Sun, 27 Jun 2010 19:03:38 -0300
From: Esteban Aliverti 
Subject: Re: [rules-users] Dynamic Loading of Rules from BRMS
To: Rules Users List 
Message-ID:

Content-Type: text/plain; charset="iso-8859-1"

Hi,
When you execute:
kagent.applyChangeSet( ResourceFactory.newUrlResource("
http://localhost:8280/jboss-brms/org.drools.guvnor.Guvnor/Guvnor.html";));

you need to point to your change-set.xml file and not to guvnor.

Inside you change-set you need to point to each resource you want the agent
take care of. In your example the first two resources have the same URL. It
doesn't look right.

Best,

2010/6/27 jillika iyer 

> hi guys,
>
> I am trying to upload my rules from jboss-brms to my eclipse in order to
> run it against the working memory.
> The following is my code and change-set.xml file and I am getting the
> following error stack ( which is a java error but just attaching it for
> giving more info).
>
>
> I have started the jboss-server and it is connected correctly.
>
> I am getting a java based error which says that it is unable to parse
> change-set.xml and unable to connect to the server.
>
> I just want to know if I am not the right path for creating the required
> change-set.xml file due to which I am getting the java connection error.
>
>
> I have just specified the url path in my change-set file and the types of
> files it should be looking out for.
>
> What else do I need to incorporate for it to connect to the server???
>
> Please help me. I am relatively new to Drools.
>
> Code in my Runner class:
>
> KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
> ResourceFactory.getResourceChangeScannerService().start();
> ResourceFactory.getResourceChangeNotifierService().start();
>
> // creating a knowledge agent
> KnowledgeAgentConfiguration aconf =
> KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
>
> KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent(
> "MyAgent", kbase,aconf );
> kagent.applyChangeSet( ResourceFactory.newUrlResource("
> http://localhost:8280/jboss-brms/org.drools.guvnor.Guvnor/Guvnor.html";));
> StatefulKnowledgeSession ksession =
> kagent.getKnowledgeBase().newStatefulKnowledgeSession();
>
>   //  StatelessSession workingMemory = ruleBase.newStatelessSession();
> ArrayList ipList = new ArrayList();
>
> ksession.setGlobal("ipList", ipList);
> ksession.insert(al);
> ksession.fireAllRules();
> ksession.dispose();
>
>
>
> my change-set.xml file:
>
>xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
>  xs:schemaLocation='
> http://drools.org/drools-5.0/change-set.xsd' >
>
>
>
>
> type='DSL' />";
>
>
>  
>
>
>
>
> error stack:
>
> java.lang.RuntimeException: Unable to parse ChangeSet
> at
> org.drools.agent.impl.KnowledgeAgentImpl.getChangeSet(KnowledgeAgentImpl.java:223)
> at
> org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:109)
> at com.org.RuleRunner.runStatelessRules(RuleRunner.java:156)
> at com.org.RulesTest.main(RulesTest.java:38)
> Caused by: java.net.SocketException: Network is unreachable: connect
> at java.net.PlainSocketImpl.socketConnect(Native Method)
> at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> at java.net.Socket.connect(Socket.java:524)
> at java.net.Socket.connect(Socket.java:474)
> at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
> at sun.net.www.http.HttpClient.openServer(HttpClient.java:388)
> at sun.net.www.http.HttpClient.openServer(HttpClient.java:523)
> at sun.net.www.http.HttpClient.(HttpClient.java:231)
> at sun.net.www.http.HttpClient.New(HttpClient.java:304)
> at sun.net.www.http.HttpClient.New(HttpClient.java:321)
> at
> sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:839)
> at
> sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:791)
> at
> sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:716)
> at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:960)
> at
> com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:973)
> at
> com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityMana

[rules-users] Object Referencing in Test Scenarios

2010-06-25 Thread Fnu Mahalakshmi
Hi

How can we create test cases in BRMS by giving value of an object??
Example:

Fire{
Room room;
String something;
}

Room{
String value;
}

Test case:

Room [R]
Value 'some_value'

Fire[F]
Room ?

We cannot give [R] here as it is not recognized.

Is there any way to test this kind of conditions in the test scenarios we 
create???

Thank you.
M

Please consider the environment before printing this email.

Visit our website at http://www.nyse.com



Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] Smooks error

2010-06-21 Thread Fnu Mahalakshmi
Hi,

I am having a problem working with smooks.
I downloaded smooks 1.3.1 from the site and included all the .jar files inside 
lib directory to my drools project class path.

I imported :

import org.milyn.Smooks;
import org.milyn.SmooksException;
import org.milyn.SmooksUtil;

And my code which is not getting resolved is :
Smooks smooks = new Smooks("smooks-config.xml");
  DroolsSmooksConfiguration conf = new DroolsSmooksConfiguration("",null);
  DroolsSmooksStatelessSession smooksSession = new 
DroolsSmooksStatelessSession(session,smooks,conf);


I am unable to resolve DroolsSmooksConfiguration and 
DroolsSmooksStatelessSession.
If I run it anyways I get this error stack:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
  DroolsSmooksConfiguration cannot be resolved to a type
  DroolsSmooksConfiguration cannot be resolved to a type
  DroolsSmooksStatelessSession cannot be resolved to a type
  DroolsSmooksStatelessSession cannot be resolved to a type
  session cannot be resolved

  at com.org.RuleRunner.runStatelessRules(RuleRunner.java:225)
  at com.org.RulesTest.main(RulesTest.java:38)


I do not know what more dependencies I need to account for.

Can you please help me out???


Thanks
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] Knowledge Builder Question

2010-06-18 Thread Fnu Mahalakshmi

Hi guys,

In my program I have couple of .brl, .drl and .dslr files which get added to 
the rulebase.

Now my .brl files get converted to drl files and then have to be added to the 
rulebase.

After creating my .drl or .dslr file I am using this code to update the 
resources in my change-set.xml
ResourceChangeScannerConfiguration sconf = 
ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration();
sconf.setProperty( "drools.resource.scanner.interval",
   "30" ); // set the disk scanning interval to 30s, default is 
60s
ResourceFactory.getResourceChangeScannerService().configure( sconf );
ResourceFactory.getResourceChangeNotifierService().start();
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add( ResourceFactory.newClassPathResource( "change-set.xml", 
getClass()),ResourceType.CHANGE_SET );
if ( kbuilder.hasErrors() ) {
   System.err.println( kbuilder.getErrors().toString() );
}

Now as per my understanding:
Since a new .drl file has been just created - the resource notifier will update 
my change-set.xml file of the change.

Now I need to load this new file to my rulebase along with my dsl file.

kbuilder.add( ResourceFactory.newClassPathResource( "change-set.xml", 
getClass()),ResourceType.CHANGE_SET );

is adding my new created file to my knowledge pacakage.
How can I specify my dsl file also to be added along with it???

I also keep getting the following error when I run the program:

Exception in thread "main" java.lang.NoSuchMethodError: 
org.drools.compiler.PackageBuilder.addKnowledgeResource(Lorg/drools/io/Resource;Lorg/drools/builder/ResourceType;Lorg/drools/builder/ResourceConfiguration;)V
  at 
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:30)
  at com.org.RuleRunner.loadRules(RuleRunner.java:75)
  at com.org.RuleRunner.runStatelessRules(RuleRunner.java:155)
  at com.org.RulesTest.main(RulesTest.java:40)
Is my drools-compiler.jar not having the correct information required How 
can I change that??

Can you please guide me in the right direction..??
Please help.

Thank you.
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] Knowledge Agent Question

2010-06-18 Thread Fnu Mahalakshmi
Hi guys,

In my program I have couple of .brl, .drl and .dslr files which get added to 
the rulebase.

Now my .brl files get converted to drl files and then have to be added to the 
rulebase.

After creating my .drl or .dslr file I am using this code to update the 
resources in my change-set.xml
ResourceChangeScannerConfiguration sconf = 
ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration();
sconf.setProperty( "drools.resource.scanner.interval",
   "30" ); // set the disk scanning interval to 30s, default is 
60s
ResourceFactory.getResourceChangeScannerService().configure( sconf );
ResourceFactory.getResourceChangeNotifierService().start();
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add( ResourceFactory.newClassPathResource( "change-set.xml", 
getClass()),ResourceType.CHANGE_SET );
if ( kbuilder.hasErrors() ) {
   System.err.println( kbuilder.getErrors().toString() );
}

Now as per my understanding:
Since a new .drl file has been just created - the resource notifier will update 
my change-set.xml file of the change.

Now I need to load this new file to my rulebase along with my dsl file.

kbuilder.add( ResourceFactory.newClassPathResource( "change-set.xml", 
getClass()),ResourceType.CHANGE_SET );

is adding my new created file to my knowledge pacakage.
How can I specify my dsl file also to be added along with it???

Can you please guide me in the right direction..??
Please help.

Thank you.
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


Re: [rules-users] creating and integrating a specific output using drools

2010-06-18 Thread Fnu Mahalakshmi


Hi,

For using queries against the working memory :  we do again need a knowledge of 
which query to fire against the working memory depending on which rule is 
fired. Also maintain a list of different queries which is ultimately written 
out to our output file.
Is there any way to determine this in our rule itself??
I could set a variable stating which query to be fired. But again I will be 
maintaining  a lot of global variables then.

Any idea?? Any better solution???

Thanks
M 

--

Message: 2
Date: Fri, 18 Jun 2010 15:12:28 +0100
From: "Swindells, Thomas" 
Subject: Re: [rules-users] creating and integrating a specific output
using   drools
To: Rules Users List 
Message-ID:

Content-Type: text/plain; charset="us-ascii"

Rather maintaining global lists have you looked into using queries against the 
working memory to get out what you need?

Thomas

Please consider the environment before printing this email.

Visit our website at http://www.nyse.com



Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


Re: [rules-users] creating and integrating a specific output using drools

2010-06-18 Thread Fnu Mahalakshmi

Hi,

No. I did not look into that. Thanks for the info.

Do you know of any documentation I could refer for the same??

Thank you.
M

Today's Topics:

   1. creating and integrating a specific output using  drools
      (Fnu Mahalakshmi)
   2. Re: creating and integrating a specific outputusing   drools
  (Swindells, Thomas)
   3. Problems with OR (skasab2s)
   4. Re: Problems with OR (David Sinclair)
   5. Re: Problems with OR (Giovanni Motta)


--

Message: 2
Date: Fri, 18 Jun 2010 15:12:28 +0100
From: "Swindells, Thomas" 
Subject: Re: [rules-users] creating and integrating a specific output
using   drools
To: Rules Users List 
Message-ID:

Content-Type: text/plain; charset="us-ascii"

Rather maintaining global lists have you looked into using queries against the 
working memory to get out what you need?

Thomas

Please consider the environment before printing this email.

Visit our website at http://www.nyse.com



Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] creating and integrating a specific output using drools

2010-06-18 Thread Fnu Mahalakshmi
Hi,

I have my basic drools application up and running.
Now I have a very disconnected input file (i.e all data is very diff from each 
other)
As of now I am loading all the output data in a globallist and writing it to an 
output file.
Now all the global lists are separate for different data inputs that I provide.
Is there a more efficient way to do this rather than maintaining many global 
lists ???

Thank you.
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] Loading .brl files

2010-06-17 Thread Fnu Mahalakshmi
Hi,

Does anyone have any idea as to how we can load .brl files which have been 
created using a dsl into the rulebase?
How do we convert them to a format understood by the rulebase?

Please help.

Thank you
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] Knowledge Builder error

2010-06-17 Thread Fnu Mahalakshmi
Hi,

I am using the following code for adding DSLs to my knowledge base and I keep 
getting following error
My code :

private KnowledgeBase loadRules(String[]  rules) throws Exception{

  KnowledgeBuilder builder = KnowledgeBuilderFactory.newKnowledgeBuilder();
  
builder.add(ResourceFactory.newClassPathResource("/sample-dsl.dsl"),ResourceType.DSL);
  builder.add(ResourceFactory.newClassPathResource("/Rule1.dslr"), 
ResourceType.DSLR);
if (builder.hasErrors()) {
throw new RuntimeException(builder.getErrors().toString());
}
KnowledgeBase knowledgeBase = KnowledgeBaseFactory.newKnowledgeBase();
knowledgeBase.addKnowledgePackages(builder.getKnowledgePackages());
return knowledgeBase;
}

Error Stack:
Exception in thread "main" java.lang.NoSuchMethodError: 
org.drools.compiler.PackageBuilder.addKnowledgeResource(Lorg/drools/io/Resource;Lorg/drools/builder/ResourceType;Lorg/drools/builder/ResourceConfiguration;)V
  at 
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:30)
  at com.org.RuleRunner.loadRules(RuleRunner.java:51)
  at com.org.RuleRunner.runStatelessRules(RuleRunner.java:127)
  at com.org.RulesTest.main(RulesTest.java:41)


I have added all the required .jars for processing knowledge builder.
I have the drools-compiler.jar5.0.1 added to my classpath ( I downloaded it 
online)

Could you point me towards where I could download  the correct drools-compiler 
and drools-core.jar files from?? Seems like the ones I have added to my 
classpath are not in harmony with each other.

Thank you. Please help.
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] Working with DSL

2010-06-17 Thread Fnu Mahalakshmi
Hi,

I am creating a DSL for my rules.
All my rules are business guided rules.
When using these business rules and loading them into the rule base : I need to 
convert them into .dslr rules. 
I do know how to go about converting a .brl to a .drl file.
Can anyone give me a hint how to go about conversion of .brl to a .dslr file?

Thank you.
M

Please consider the environment before printing this email.

Visit our website at http://www.nyse.com



Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] dsl error- please help

2010-06-16 Thread Fnu Mahalakshmi
Hi guys,

I am trying to create a very basic dsl which is giving me the following error 
stack:

The code to add the dsl is as follows:

InputStream ruleSource = 
RuleRunner.class.getClassLoader().getResourceAsStream("/Rule1.dslr");
InputStream dslSource = 
RuleRunner.class.getClassLoader().getResourceAsStream("/sample-dsl.dsl");

//Load the rules , using DSL
addRulesToThisPackage.addPackageFromDrl(
new InputStreamReader(ruleSource),
new InputStreamReader(dslSource));

I have both the sample-dsl .dsl and Rule1.dslr in my working directory.

Error encountered at adding the dsl to the package (last line)

Error stack:
Exception in thread "main" java.lang.NullPointerException
  at java.io.Reader.(Unknown Source)
  at java.io.InputStreamReader.(Unknown Source)
  at com.org.RuleRunner.loadRuleFile(RuleRunner.java:96)
  at com.org.RuleRunner.loadRules(RuleRunner.java:48)
  at com.org.RuleRunner.runStatelessRules(RuleRunner.java:109)
  at com.org.RulesTest.main(RulesTest.java:41)

my dsl file has basic mapping as per the online documentations.

The dsl rule I created is:
expander sample-dsl.dsl

rule "A status changes B status"
  when
There is an A
-has an address
There is a B
  - has name
  then
- print updated A and Aaddress
End


I have created DSL in eclipse.

Is the code I added for it to be loaded to my package correct?? Or am I missing 
something


Please help.

Thanks.
M




Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] specific rules

2010-06-16 Thread Fnu Mahalakshmi
Hi,

Is it possible for us to enhance the way our rule works?
For example:
Using a business rule can I specify to the user: A can have option 1,2,3
And user can set it as A[a] value 'is equal to ' 1// and you can get output 
accordingly.
For instance if we could specify a set of drop down options for the user to 
make rules operation more easier??

Is it possible. I am using a DSL for the normal rules. But not sure how I can 
specify these specific details before hand.

Can we use or populate global lists in business guided rules??? In the 
condition part of a rule?? I am able to access it in the action part.

Please help.

Thank you.
M







Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] Global Variables and Business rules

2010-06-16 Thread Fnu Mahalakshmi
Hi,

How can I depict global lists in my business rules?
For instance:
rule "populate list for A with required status"
when
$a : A()
$list : ArrayList( size > 0 )
  from collect( B( a.name == $a.name, status == "P" ) )
then
  requiredList.addAll($list);
end


I want to depict my $list : ArrayList( size > 0 )
  from collect( B( a.name == $a.name, status == "P" ) )
with help of business rules.
Any idea how???

Thank you
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] major errors with drools

2010-06-16 Thread Fnu Mahalakshmi
Hi,

I just installed plugin for smooks.
It ended up crashing my other data.
I now do not seem to even be able to resolve org.drools.RuleBase.
I am unable to understand why.
Everything is installed just right.

Please help!!
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] A real funny thin I wanted to share!

2010-06-16 Thread Fnu Mahalakshmi
Hey guys,

You have all been really helpful and I really wanted to share a funny thing 
that keeps happening!
It would probably make your day!
I use eclipse for my drools projects. Have everything set up!
Out of the blue when I click 'open perspective' I don't seem to get the 'Guvnor 
' option.
Then suddenly it appears again ! This seems to be a repeat process! I have no 
idea why!
But seems ridiculous! :P :)

M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] smooks terrible error

2010-06-16 Thread Fnu Mahalakshmi
Hi,
I am trying to work with smooks and have major errors !!! everything is 
crashing!

My code which I added is:
public void runStatelessRules(String[] rulesFiles,String 
dslFileName,Collectional,
String ruleFlowFileName) throws Exception {
  KnowledgeBase ruleBase = loadRules(rulesFiles);
StatelessKnowledgeSession workingMemory = 
ruleBase.newStatelessKnowledgeSession();

Smooks smooks = new Smooks("smooks-config.xml");
DroolsSmooksConfiguration conf = new DroolsSmooksConfiguration("some 
name",null);
DroolsSmooksStatelessSession smooksSession = new
DroolsSmooksStatelessSession(session,smooks, conf);

javax.xml.transform.Source xmlSource = new 
StreamSource(getClass().getResourceAsStream("NewFile.xml"));
smooksSession.executeFileter(xmlSource);
workingMemory.execute(al);  // what to add to my working 
memory?
  }

This is the basic code which I just incorporated from the book.
I installed smooks plugin for eclipse.
But could not find smooks-config.xml file.
I am not usre of what else I need to incorporate.
Now everything else also seems to be showing error i.e all the code which was 
working perfectly.

Please help!!! Major disaster.

Thank you
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


Re: [rules-users] pulling data from external database

2010-06-16 Thread Fnu Mahalakshmi
Hi,
Yes. I need facts from the database. I will be query the database using a SOAP 
call. So I end up getting an XML input file as my fact input.
I am trying to use Smooks framework for this as suggested online. I downloaded 
the required JBoss Tool for it
But don't seem to be able to find much information on how to implement it.
I just got this snippet of code:
Smooks smooks = new Smooks("smooks-config.xml");
DroolsSmooksConfiguration conf = new DroolsSmooksConfiguration("some 
name",null);
DroolsSmooksStatelessSession smooksSession = new DroolsSmooksStatelessSession 
(session,smooks, conf);

javax.xml.transform.Source xmlSource = new 
StreamSource(getClass().getResourceAsStream("name-of-data
-file.xml"))

smooksSession.executeFileter(xmlSource); 

Where do I get my smooks-config.xml file? And if I want to specify multiple 
input XML files can I just keep invoking this again for passing my input files?
javax.xml.transform.Source xmlSource = new 
StreamSource(getClass().getResourceAsStream("name-of-data
-file.xml"))

Please guide.Is there any better documentation for this? Or is there a better 
way to do this?

Thank you.
M


--

Message: 3
Date: Wed, 16 Jun 2010 11:05:30 -0400
From: David Sinclair 
Subject: Re: [rules-users] pulling data from external database
To: Rules Users List 
Message-ID:

Content-Type: text/plain; charset="iso-8859-1"

There is no specific "way" of doing it with drools. You could use JDBC,
Spring, Hibernate, etc. The more important question is what data from a DB
do u need? Facts?

2010/6/16 Fnu Mahalakshmi 

>  Hi,
>
>
>
> Could you point me towards some documentation which gives information on
> how I could pull data from my database with drools??
>
>  can I just do it by using JDBC (using this right now)? Is there any other
> way to it?
>
> Could not find it in the documentation online.
>
>
>
> Thank you
>
> M
>
> --
>
> *Please consider the environment before printing this email.*
>
> *Visit our website at http://www.nyse.com
> *
>
> Note: The information contained in this message and any attachment to it is
> privileged, confidential and protected from disclosure. If the reader of
> this message is not the intended recipient, or an employee or agent
> responsible for delivering this message to the intended recipient, you are
> hereby notified that any dissemination, distribution or copying of this
> communication is strictly prohibited. If you have received this
> communication in error, please notify the sender immediately by replying to
> the message, and please delete it from your system. Thank you. NYSE
> Euronext. *
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-- next part --
An HTML attachment was scrubbed...
URL: 
http://lists.jboss.org/pipermail/rules-users/attachments/20100616/f5438798/attachment.html
 

--

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


End of rules-users Digest, Vol 43, Issue 97
***
Please consider the environment before printing this email.

Visit our website at http://www.nyse.com



Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] Rules error

2010-06-16 Thread Fnu Mahalakshmi
Hi,
I m trying to do this:
GeneralList and RequiredList are my global lists
rule "populate list for A with required status"
when
$a : A()
$list : ArrayList( size > 0 )
  from collect( B( a.name == $a.name, status == "P" ) )
then
  requiredList.addAll($list);
end

rule "populate list for A with general status"
when
$a : A()
$list : ArrayList( size > 0 )
  from collect( B( a.name == $a.name, status == "U" ) )
then
  generalList.addAll($list2);
  System.out.println("general list size " +generalList.size());
  generalList.removeAll(requiredList);
  System.out.println("general list size " +generalList.size());
End

But remove all does not seem to have any effect.
Any idea why

Plus if I do
when
$a : A()
$list : ArrayList( size > 0 )
  from collect( B( a.name == $a.name, status != "U" ) ) // "!=" it 
just ends up giving me all the values and not what status is


Please help.

Thanks
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] pulling data from external database

2010-06-16 Thread Fnu Mahalakshmi
Hi,

Could you point me towards some documentation which gives information on how I 
could pull data from my database with drools??
 can I just do it by using JDBC (using this right now)? Is there any other way 
to it?
Could not find it in the documentation online.

Thank you
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


Re: [rules-users] deleting records in rules

2010-06-16 Thread Fnu Mahalakshmi

Hi ,


I ended up doing this:
I have the following:
> > A = new A(); A1 = new A()
> > B b1 = new B(A)
> > B b2 = new B(A)
> > B b3 = new B(A1)
> >
> > Each of the B above have a parameter "status"
> >
> > I am setting the name in one of my rules which works properly.
> >
> > I want to create an output list which:
> > Checks that all B objects pointing to a single A object (eg. A1 or A in
> > this case) have same name. If they don't I don't want to have them on my
> > output list.

ArrayList list = new ArrayList();
workingMemory.setGlobal( "list", list );
To set global list in my working memory

My rule is like this:

rule "Raise priority for A with required name"
when
$a : A()
$list : ArrayList( size > 0 )
  from collect( B( a == $a, status == "x" ) )

then
list.addAll($list);

end

my global list is getting populated with values.
But still I end up getting a value for B even if it has a different status.
Eg:
B1 = (A, status = x)
B2 = (A, status = y)
B3 = (A1, status = x)

And I want values where status = x
In my above code I get output as: B1, and B3 whereas my output should be B3 
only.

Any hint?? How can I segregate specific values?? I am inputting the $a for 
exact matching. What more can be done???
 Please help.

Thank you.
M

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
rules-users-requ...@lists.jboss.org
Sent: Wednesday, June 16, 2010 9:01 AM
To: rules-users@lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 93

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

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

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

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


Today's Topics:

   1. Re: deleting records using rules (Esteban Aliverti)


--

Message: 1
Date: Wed, 16 Jun 2010 10:00:41 -0300
From: Esteban Aliverti 
Subject: Re: [rules-users] deleting records using rules
To: Rules Users List 
Message-ID:

Content-Type: text/plain; charset="iso-8859-1"

No. If B class has a reference to A, then *$list: List(size >0) from collect
B(a.name = "x") *will collect all B fact having a.name == "x" into a new
List
You could read the documentation about *from collect *for further
information.

Best,

On Wed, Jun 16, 2010 at 9:55 AM, Fnu Mahalakshmi wrote:

> Hi,
> Are you suggesting to maintain a list of B values in A?
> Like A { list();}
> // inside my A
> And then to populate the list and iterate through that list??
>
> Is that not too much extra data storing?
>
> Thanks
> M
>
> -Original Message-
> From: rules-users-boun...@lists.jboss.org [mailto:
> rules-users-boun...@lists.jboss.org] On Behalf Of
> rules-users-requ...@lists.jboss.org
> Sent: Wednesday, June 16, 2010 8:31 AM
> To: rules-users@lists.jboss.org
> Subject: rules-users Digest, Vol 43, Issue 90
>
> Send rules-users mailing list submissions to
>rules-users@lists.jboss.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>https://lists.jboss.org/mailman/listinfo/rules-users
> or, via email, send a message with subject or body 'help' to
>rules-users-requ...@lists.jboss.org
>
> You can reach the person managing the list at
>rules-users-ow...@lists.jboss.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of rules-users digest..."
>
>
> Today's Topics:
>
>1. Re: deleting records using rules (Esteban Aliverti)
>
>
> --
>
> Message: 1
> Date: Wed, 16 Jun 2010 09:30:37 -0300
> From: Esteban Aliverti 
> Subject: Re: [rules-users] deleting records using rules
> To: Rules Users List 
> Message-ID:
> 
> Content-Type: text/plain; charset="iso-8859-1"
>
> If B has a getA() method, you could do something like this:
>
> rule "XX"
> when
>  $list: List(size > 0) from collect B(a.name = "x")
> then
>  someGlobalList.addAll($list);
> end
>
> best,
>
> On Wed, Jun 16, 2010 at 9:15 AM, Fnu Mahalakshmi  >wrote:
>
> > Hi,
> >
> > Thanks. Sorry for not being clear.
> > I have the 

Re: [rules-users] deleting records in rules

2010-06-16 Thread Fnu Mahalakshmi
Hi ,
Thanks so much.
I ended up doing this:
ArrayList list = new ArrayList();
workingMemory.setGlobal( "list", list );
To set global list in my working memory

My rule is like this:

rule "Raise priority for A with required name"
when
$a : A()
$list : ArrayList( size > 0 )
  from collect( B( a == $a, status == "x" ) )
$b : B()
then
list.addAll($list);

end

It seems to be getting populated with values.
How can I directly write these values to my output file??
I am not sure about working with global lists as yet and have never worked with 
it.. Please help.

Thank you.
M

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
rules-users-requ...@lists.jboss.org
Sent: Wednesday, June 16, 2010 9:01 AM
To: rules-users@lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 93

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

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

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

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


Today's Topics:

   1. Re: deleting records using rules (Esteban Aliverti)


--

Message: 1
Date: Wed, 16 Jun 2010 10:00:41 -0300
From: Esteban Aliverti 
Subject: Re: [rules-users] deleting records using rules
To: Rules Users List 
Message-ID:

Content-Type: text/plain; charset="iso-8859-1"

No. If B class has a reference to A, then *$list: List(size >0) from collect
B(a.name = "x") *will collect all B fact having a.name == "x" into a new
List
You could read the documentation about *from collect *for further
information.

Best,

On Wed, Jun 16, 2010 at 9:55 AM, Fnu Mahalakshmi wrote:

> Hi,
> Are you suggesting to maintain a list of B values in A?
> Like A { list();}
> // inside my A
> And then to populate the list and iterate through that list??
>
> Is that not too much extra data storing?
>
> Thanks
> M
>
> -Original Message-
> From: rules-users-boun...@lists.jboss.org [mailto:
> rules-users-boun...@lists.jboss.org] On Behalf Of
> rules-users-requ...@lists.jboss.org
> Sent: Wednesday, June 16, 2010 8:31 AM
> To: rules-users@lists.jboss.org
> Subject: rules-users Digest, Vol 43, Issue 90
>
> Send rules-users mailing list submissions to
>rules-users@lists.jboss.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>https://lists.jboss.org/mailman/listinfo/rules-users
> or, via email, send a message with subject or body 'help' to
>rules-users-requ...@lists.jboss.org
>
> You can reach the person managing the list at
>rules-users-ow...@lists.jboss.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of rules-users digest..."
>
>
> Today's Topics:
>
>1. Re: deleting records using rules (Esteban Aliverti)
>
>
> --
>
> Message: 1
> Date: Wed, 16 Jun 2010 09:30:37 -0300
> From: Esteban Aliverti 
> Subject: Re: [rules-users] deleting records using rules
> To: Rules Users List 
> Message-ID:
> 
> Content-Type: text/plain; charset="iso-8859-1"
>
> If B has a getA() method, you could do something like this:
>
> rule "XX"
> when
>  $list: List(size > 0) from collect B(a.name = "x")
> then
>  someGlobalList.addAll($list);
> end
>
> best,
>
> On Wed, Jun 16, 2010 at 9:15 AM, Fnu Mahalakshmi  >wrote:
>
> > Hi,
> >
> > Thanks. Sorry for not being clear.
> > I have the following:
> > A = new A(); A1 = new A()
> > B b1 = new B(A)
> > B b2 = new B(A)
> > B b3 = new B(A1)
> >
> > Each of the B above have a parameter "name"
> >
> > I am setting the name in one of my rules which works properly.
> >
> > I want to create an output list which:
> > Checks that all B objects pointing to a single A object (eg. A1 or A in
> > this case) have same name. If they don't I don't want to have them on my
> > output list.
> >
> > I tried using forAll for the rule but that checks forALL B's in genral
> > having same A object which is not what I want.
> >
> > Could you give me a starter / hint to create the rule.
>

Re: [rules-users] deleting records using rules

2010-06-16 Thread Fnu Mahalakshmi
Hi,
Are you suggesting to maintain a list of B values in A?
Like A { list();}
// inside my A
And then to populate the list and iterate through that list??

Is that not too much extra data storing?

Thanks
M

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
rules-users-requ...@lists.jboss.org
Sent: Wednesday, June 16, 2010 8:31 AM
To: rules-users@lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 90

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

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

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

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


Today's Topics:

   1. Re: deleting records using rules (Esteban Aliverti)


--

Message: 1
Date: Wed, 16 Jun 2010 09:30:37 -0300
From: Esteban Aliverti 
Subject: Re: [rules-users] deleting records using rules
To: Rules Users List 
Message-ID:

Content-Type: text/plain; charset="iso-8859-1"

If B has a getA() method, you could do something like this:

rule "XX"
when
  $list: List(size > 0) from collect B(a.name = "x")
then
 someGlobalList.addAll($list);
end

best,

On Wed, Jun 16, 2010 at 9:15 AM, Fnu Mahalakshmi wrote:

> Hi,
>
> Thanks. Sorry for not being clear.
> I have the following:
> A = new A(); A1 = new A()
> B b1 = new B(A)
> B b2 = new B(A)
> B b3 = new B(A1)
>
> Each of the B above have a parameter "name"
>
> I am setting the name in one of my rules which works properly.
>
> I want to create an output list which:
> Checks that all B objects pointing to a single A object (eg. A1 or A in
> this case) have same name. If they don't I don't want to have them on my
> output list.
>
> I tried using forAll for the rule but that checks forALL B's in genral
> having same A object which is not what I want.
>
> Could you give me a starter / hint to create the rule.
> I even thought that I could maybe populate a list for each A object:
> When $a : A()
>  b : B(a : $a , name == "x")
> Then
>Modify($a){
>setAList(b) // adding all b's to a list contained in a
> };
>
> But that does not help me achieve the second part as I cant traverse
> through a list inside rules.
>
> Any idea??
>
> Please help.
> Thanks
> M
> -Original Message-
> From: rules-users-boun...@lists.jboss.org [mailto:
> rules-users-boun...@lists.jboss.org] On Behalf Of
> rules-users-requ...@lists.jboss.org
> Sent: Wednesday, June 16, 2010 2:22 AM
> To: rules-users@lists.jboss.org
> Subject: rules-users Digest, Vol 43, Issue 84
>
> Send rules-users mailing list submissions to
>rules-users@lists.jboss.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>https://lists.jboss.org/mailman/listinfo/rules-users
> or, via email, send a message with subject or body 'help' to
>rules-users-requ...@lists.jboss.org
>
> You can reach the person managing the list at
>rules-users-ow...@lists.jboss.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of rules-users digest..."
>
>
> Today's Topics:
>
>   1. Re: Flow persistence (Rob Collins)
>   2. Re: deleting records using rules (Wolfgang Laun)
>
>
> --
>
> Message: 1
> Date: Tue, 15 Jun 2010 18:55:03 -0700
> From: Rob Collins 
> Subject: Re: [rules-users] Flow persistence
> To: Rules Users List 
> Message-ID:
><0019f265-aa56-4104-b657-083c37aae...@patientsafesolutions.com>
> Content-Type: text/plain; charset="us-ascii"
>
> You were right the first time - I am sharing the environment between
> multiple sessions. That is easy for me to fix.
>
> Can I share the EntityManagerFactory, or should I create one for each
> session?
>
> Thanks,
> Rob
>
> On Jun 15, 2010, at 9:47 PM, Mauricio Salatino wrote:
>
> oh.. sorry.. you are creating a new env per each session.. but the problem
> is related with that..
> I will review that and let you know.
>
> On Tue, Jun 15, 2010 at 9:45 PM, Mauricio Salatino  <mailto:sala...@gmail.com>> wrote:
> yes the problem is the environment.. I saw that problem in the past..
> you need to create a separate environmen

Re: [rules-users] Dynamic rule loading

2010-06-16 Thread Fnu Mahalakshmi
Hi,
Yes I added the drools-compiler as a dependency.
I have added all the required jars to my classpath.
Any other error???
Thanks
M

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
rules-users-requ...@lists.jboss.org
Sent: Wednesday, June 16, 2010 8:25 AM
To: rules-users@lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 89

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

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

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

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


Today's Topics:

   1. Re: Dynamic Rule Loading (Esteban Aliverti)
   2. Re: rule error (Esteban Aliverti)


--

Message: 1
Date: Wed, 16 Jun 2010 09:21:13 -0300
From: Esteban Aliverti 
Subject: Re: [rules-users] Dynamic Rule Loading
To: Rules Users List 
Message-ID:

Content-Type: text/plain; charset="iso-8859-1"

Are you including drools-compiler as a dependency?

On Tue, Jun 15, 2010 at 5:28 PM, Fnu Mahalakshmi wrote:

> Hi,
>
> I was trying to use knowledge builder package for dynamic loading of the
> rule files. Getting major errors.
>
> My knowledge builder basically adds the rule resources from the
> change-set.xml file which I have in my project directory.
>
> I am using the knowledge agent and knowledge base to add all the packages
> loaded from my change-set xml file.
>
> Am I wrong somewhere???
>
> My code is as follows:
>
>
>private KnowledgeBase loadRules(String[]  rules) throws Exception{
>
> KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
>  kbuilder.add( ResourceFactory.newClassPathResource(
> "/change-set.xml", getClass() ),
>ResourceType.CHANGE_SET );
>  if ( kbuilder.hasErrors() ) {
>  System.err.println( kbuilder.getErrors().toString() );
>  }
>  KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent(
> "MyAgent" );
>  kagent.applyChangeSet(
> ResourceFactory.newClassPathResource("/change-set.xml", getClass()));
>  KnowledgeBase kbase = kagent.getKnowledgeBase();
>  kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
>
>  return kbase;
>}
>
> my change-set.xml is as follows:
>
> 
>  xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
> xs:schemaLocation='drools-change-set-5.0.xsd' >
>  
>   
>   
>  
>
> I am getting the following error stack when I run:
>
> Exception in thread "main" org.drools.ProviderInitializationException:
> Provider org.drools.builder.impl.KnowledgeBuilderProviderImpl could not be
> set.
>at
> org.drools.builder.KnowledgeBuilderFactory.loadProvider(KnowledgeBuilderFactory.java:111)
>at
> org.drools.builder.KnowledgeBuilderFactory.getKnowledgeBuilderProvider(KnowledgeBuilderFactory.java:101)
>at
> org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilder(KnowledgeBuilderFactory.java:29)
>at com.org.RuleRunner.loadRules(RuleRunner.java:58)
>at com.org.RuleRunner.runStatelessRules(RuleRunner.java:127)
>at com.org.RulesTest.main(RulesTest.java:40)
> Caused by: java.lang.ClassNotFoundException:
> org.drools.builder.impl.KnowledgeBuilderProviderImpl
>at java.net.URLClassLoader$1.run(Unknown Source)
>at java.security.AccessController.doPrivileged(Native Method)
>at java.net.URLClassLoader.findClass(Unknown Source)
>at java.lang.ClassLoader.loadClass(Unknown Source)
>at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>at java.lang.ClassLoader.loadClass(Unknown Source)
>at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>at java.lang.Class.forName0(Native Method)
>at java.lang.Class.forName(Unknown Source)
>at
> org.drools.builder.KnowledgeBuilderFactory.loadProvider(KnowledgeBuilderFactory.java:108)
>... 5 more
>
>
> The error comes exactly at the start where I call knowledge builder.
> Please help!!
>
> Thanks
> M
>
> Please consider the environment before printing this email.
>
> Visit our website at http://www.nyse.com
>
> 
>
> Note:  The 

Re: [rules-users] deleting records using rules

2010-06-16 Thread Fnu Mahalakshmi
ewHttpTest.loginUser(LogicalViewHttpTest.java:80)
at 
com.patientsafesolutions.api.httptest.LogicalViewHttpTest.navigateToPatient(LogicalViewHttpTest.java:102)
at 
com.patientsafesolutions.api.httptest.HomeTests.homeLogicalView(HomeTests.java:14)
at com.patientsafesolutions.api.httptest.HomeTests$1.run(HomeTests.java:23)
at 
com.patientsafesolutions.test.http.HttpTest$ThreadWithThrowable$1.run(HttpTest.java:241)
at java.lang.Thread.run(Thread.java:637)

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



--
- CTO @ 
http://www.plugtree.com<http://www.plugtree.com/><http://www.plugtree.com/>
- MyJourney @ 
http://salaboy.wordpress.com<http://salaboy.wordpress.com/><http://salaboy.wordpress.com/>
- Co-Founder @ 
http://www.jbug.com.ar<http://www.jbug.com.ar/><http://www.jbug.com.ar/>

- Salatino "Salaboy" Mauricio -



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



--
- CTO @ http://www.plugtree.com<http://www.plugtree.com/>
- MyJourney @ http://salaboy.wordpress.com<http://salaboy.wordpress.com/>
- Co-Founder @ http://www.jbug.com.ar<http://www.jbug.com.ar/>

- Salatino "Salaboy" Mauricio -



--
- CTO @ http://www.plugtree.com<http://www.plugtree.com/>
- MyJourney @ http://salaboy.wordpress.com<http://salaboy.wordpress.com/>
- Co-Founder @ http://www.jbug.com.ar<http://www.jbug.com.ar/>

- Salatino "Salaboy" Mauricio -





--

Message: 2
Date: Wed, 16 Jun 2010 08:22:10 +0200
From: Wolfgang Laun 
Subject: Re: [rules-users] deleting records using rules
To: Rules Users List 
Message-ID:

Content-Type: text/plain; charset=windows-1252

If you can do it in Java, you can do it in a rule.

Asking questions in this very general way will only (if at all) give
you very general answers.

-W


2010/6/15 Fnu Mahalakshmi :
> Hi,
>
> How can I delete records using rules??
>
> I want to fire my rules on a dataset ? modify the dataset and delete data
> not concerned to me after the modification.
>
> can I do this with my rules directly?
>
>
>
> Thanks
>
> M
>
> 
>
> Please consider the environment before printing this email.
>
> Visit our website at http://www.nyse.com
> *
> Note: The information contained in this message and any attachment to it is
> privileged, confidential and protected from disclosure. If the reader of
> this message is not the intended recipient, or an employee or agent
> responsible for delivering this message to the intended recipient, you are
> hereby notified that any dissemination, distribution or copying of this
> communication is strictly prohibited. If you have received this
> communication in error, please notify the sender immediately by replying to
> the message, and please delete it from your system. Thank you. NYSE
> Euronext.
>
> ___
> 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


End of rules-users Digest, Vol 43, Issue 84
***
Please consider the environment before printing this email.

Visit our website at http://www.nyse.com



Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] rule error

2010-06-15 Thread Fnu Mahalakshmi
Hi,

I want to just depict '&&' and 'or' in my rules and did as follows:

rule "Update value"
no-loop true
  when
$y :Y(name != "")
$x: X(status != "")
$z : Z( y == $y, x == $X,(status == "yes" or status == "no"))
  then
modify($z){};

end

The above does not work. Is it not valid to write as above??
How else can I depict "or" ? relation?
rule "Update value"
no-loop true
  when
$y :Y(name != "")
$x: X(status != "")
$z : Z( y == $y, x == $X,(status == "yes" , status == "no"))
  then
modify($z){
setOutput($z)};

end


even this does not work.

I also want to add all the values specific to this condition and just print 
them out in my output file.
So I tried adding it to a list (which is done by setOutput().
But here I keep getting multiple entries for the same value.
For eg. {a,b,c } //are instances of type z
They keep getting added again and again. Should it not process input only 
once


Please help.

Thank you
m



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] creating specific dataset with help of rules

2010-06-15 Thread Fnu Mahalakshmi
Hi,
Is it possible to trigger out only a specific dataset with help of my rules?
I want only a list of data as my output which has A=10 for example.
Is it possible? How can I do that??
Thank you
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] deleting records using rules

2010-06-15 Thread Fnu Mahalakshmi
Hi,
How can I delete records using rules??
I want to fire my rules on a dataset - modify the dataset and delete data not 
concerned to me after the modification.
can I do this with my rules directly?

Thanks
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] Weird error with rule files

2010-06-15 Thread Fnu Mahalakshmi
Hi,

When I run my project - I have brl and drl rule files.
When I run it for the first time: I am converting brl to drl files.
I get this error

Exception in thread "main" java.lang.NullPointerException
  at java.io.Reader.(Unknown Source)
  at java.io.InputStreamReader.(Unknown Source)
  at com.org.RuleRunner.loadRuleFile(RuleRunner.java:87)
  at com.org.RuleRunner.loadRules(RuleRunner.java:44)
  at com.org.RuleRunner.runStatelessRules(RuleRunner.java:108)
  at com.org.RulesTest.main(RulesTest.java:40)


But after I run it for the first time and the rule.drl (converted file from brl 
to drl) exists in my directory - I run it again and then the program runs fine.

So number of .brl files that many number of exceptions(same as above) and then 
program runs.

Why is this happening?? Should it not create the file and load it into the 
rulebase?

My code for converting from brl to drl is :
   try{
  BRXMLPersistence read = (BRXMLPersistence) 
BRXMLPersistence.getInstance();
  BRDRLPersistence write = (BRDRLPersistence) 
BRDRLPersistence.getInstance();
  brl = FileUtils.readFileToString(file);
System.out.println("File content: " + brl);
outputDRL = write.marshal(read.unmarshal(brl));
String drlFilePath = "src/main/rules"+rulesFiles +".drl";
System.out.println("drlFilePath "+drlFilePath +"rulesFiles 
"+rulesFiles);
String path = rulesFiles+".drl";
System.out.println("path "+path);
System.out.println("drlfile "+drlFilePath);
drlFile = new File(drlFilePath);
FileUtils.writeStringToFile(drlFile, outputDRL);

Reader source = new InputStreamReader( 
RuleRunner.class.getResourceAsStream(path) ); // error is here
addRulesToThisPackage.addPackageFromDrl(source);
}catch (IOException e) {

  e.printStackTrace();
 }
  }

Any idea why this problem?? Is there some error in my code above

Please help.
Thank you
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


Re: [rules-users] Dynamic Rule Loading

2010-06-15 Thread Fnu Mahalakshmi
Hi,

I was trying to use knowledge builder package for dynamic loading of the rule 
files. Getting major errors.

My knowledge builder basically adds the rule resources from the change-set.xml 
file which I have in my project directory.

I am using the knowledge agent and knowledge base to add all the packages 
loaded from my change-set xml file.

Am I wrong somewhere???

My code is as follows:


private KnowledgeBase loadRules(String[]  rules) throws Exception{

KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
  kbuilder.add( ResourceFactory.newClassPathResource( 
"/change-set.xml", getClass() ),
ResourceType.CHANGE_SET );
  if ( kbuilder.hasErrors() ) {
  System.err.println( kbuilder.getErrors().toString() );
  }
  KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent( 
"MyAgent" );
  kagent.applyChangeSet( 
ResourceFactory.newClassPathResource("/change-set.xml", getClass()));
  KnowledgeBase kbase = kagent.getKnowledgeBase();
  kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
 
  return kbase;
}

my change-set.xml is as follows:

 

  
   
   
 

I am getting the following error stack when I run:

Exception in thread "main" org.drools.ProviderInitializationException: Provider 
org.drools.builder.impl.KnowledgeBuilderProviderImpl could not be set.
at 
org.drools.builder.KnowledgeBuilderFactory.loadProvider(KnowledgeBuilderFactory.java:111)
at 
org.drools.builder.KnowledgeBuilderFactory.getKnowledgeBuilderProvider(KnowledgeBuilderFactory.java:101)
at 
org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilder(KnowledgeBuilderFactory.java:29)
at com.org.RuleRunner.loadRules(RuleRunner.java:58)
at com.org.RuleRunner.runStatelessRules(RuleRunner.java:127)
at com.org.RulesTest.main(RulesTest.java:40)
Caused by: java.lang.ClassNotFoundException: 
org.drools.builder.impl.KnowledgeBuilderProviderImpl
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at 
org.drools.builder.KnowledgeBuilderFactory.loadProvider(KnowledgeBuilderFactory.java:108)
... 5 more


The error comes exactly at the start where I call knowledge builder.
Please help!!

Thanks
M

Please consider the environment before printing this email.

Visit our website at http://www.nyse.com



Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


Re: [rules-users] Dynamic rule file uploading

2010-06-15 Thread Fnu Mahalakshmi

Hi Payet,

Thanks for the solution.

I just had one more question:

Whats the main benefit of doing it in this manner??
Because I would be basically creating my change-set.xml file by pulling in data 
from my directory containing my rule files which would then be added to my 
knowledgebuilder.
The other option was to list all the existing files and add them to the 
packagebuilder.
Both seem to in the end do the same thing as per my understanding.
What is the plus point of the first approach?? Is it not just longer??

Thanks
M

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
rules-users-requ...@lists.jboss.org
Sent: Tuesday, June 15, 2010 12:33 PM
To: rules-users@lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 76

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

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

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

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


Today's Topics:

   1. Re: Dynamic rule file uploading (PAYET, Manuel)
   2. Re: Uploading rules dynamically (Fnu Mahalakshmi)


--

Message: 1
Date: Tue, 15 Jun 2010 18:02:06 +0200
From: "PAYET, Manuel" 
Subject: Re: [rules-users] Dynamic rule file uploading
To: Rules Users List 
Message-ID:
<5104f06b63e3164faeb2f42b920311654ccca...@corpmail05.corp.capgemini.com>

Content-Type: text/plain; charset="iso-8859-1"

So, why wouldn't you dinamically construct you change-set.xml file?
You have lots of solutions to generate xml files in Java

-Message d'origine-
De : rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] De la part de Fnu Mahalakshmi
Envoy? : mardi 15 juin 2010 17:59
? : 'rules-users@lists.jboss.org'
Objet : Re: [rules-users] Dynamic rule file uploading

Hi,

Thanks for the quick reply.
But even by using knowledge agent I have to keep specifying each of the files 
one by one right? Which ever is contained in my folder with all the rule files? 
As I would keep doing:

kbuilder.add( ResourceFactory.newUrlResource( "file://myrules.drl" ),
   ResourceType.DRL);

So again I would have to list all my files and pass it to the knowledge agent 
which would add the new rule to the existing package( created using package 
builder).
Am I going wrong here??
Please help.

Thank you.
M


-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
rules-users-requ...@lists.jboss.org
Sent: Tuesday, June 15, 2010 11:13 AM
To: rules-users@lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 74

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

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

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

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


Today's Topics:

   1. Uploading rules dynamically (Fnu Mahalakshmi)
   2. Dynamic rule file uploading (Fnu Mahalakshmi)
   3. Re: Dynamic rule file uploading (PAYET, Manuel)


----------

Message: 1
Date: Tue, 15 Jun 2010 10:56:42 -0400
From: Fnu Mahalakshmi 
Subject: [rules-users] Uploading rules dynamically
To: "'rules-users@lists.jboss.org'" 
Message-ID:
<994758e35590274e955fa75763c5aa5002d01...@mtexmbxp01.ad.nyx.com>
Content-Type: text/plain; charset="us-ascii"

Hi Guys,

How can I dynamically upload my rules? Can someone point me towards some 
documentation for the same??

Thank you.

M



Please consider the environment before printing 
this email. Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If y

Re: [rules-users] Uploading rules dynamically

2010-06-15 Thread Fnu Mahalakshmi
Hi,

I was just going through how to work with knowledge builder and have some 
doubts:
Code sample is as follows:

final KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();

// this will parse and compile in one step
kbuilder.add(ResourceFactory.newClassPathResource("HelloWorld.drl",
HelloWorldExample.class), ResourceType.DRL);

// Check the builder for errors
if (kbuilder.hasErrors()) {
System.out.println(kbuilder.getErrors().toString());
throw new RuntimeException("Unable to compile \"HelloWorld.drl\".");
}

// get the compiled packages (which are serializable)
final Collection pkgs = kbuilder.getKnowledgePackages();

// add the packages to a knowledgebase (deploy the knowledge packages).
final KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(pkgs);

final StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();

In the above code: I am manually having to add the .drl file and the classpath 
to my kbuilder. So don't I just have to end up listing all the files and adding 
it to my knowledge builder?

Is it that each of the files keeps getting added as and when you update the 
rule files?
How does the program detect this update?? As I am ending up having to add 
everything.

Please guide.

Thank you
M






-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
rules-users-requ...@lists.jboss.org
Sent: Tuesday, June 15, 2010 12:00 PM
To: rules-users@lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 75

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

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

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

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


Today's Topics:

   1. Re: Uploading rules dynamically (Esteban Aliverti)
   2. Re: Dynamic rule file uploading (Fnu Mahalakshmi)


--

Message: 1
Date: Tue, 15 Jun 2010 12:12:45 -0300
From: Esteban Aliverti 
Subject: Re: [rules-users] Uploading rules dynamically
To: Rules Users List 
Message-ID:

Content-Type: text/plain; charset="iso-8859-1"

You can read about Knowledge Agent:
http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-expert/html_single/index.html#d4e615

Maybe it suits your needs.

2010/6/15 Fnu Mahalakshmi 

>  Hi Guys,
>
>
>
> How can I dynamically upload my rules? Can someone point me towards some
> documentation for the same??
>
>
>
> Thank you.
>
>
>
> M
>
> --
>
> *Please consider the environment before printing this email.*
>
> *Visit our website at http://www.nyse.com
> *
>
> Note: The information contained in this message and any attachment to it is
> privileged, confidential and protected from disclosure. If the reader of
> this message is not the intended recipient, or an employee or agent
> responsible for delivering this message to the intended recipient, you are
> hereby notified that any dissemination, distribution or copying of this
> communication is strictly prohibited. If you have received this
> communication in error, please notify the sender immediately by replying to
> the message, and please delete it from your system. Thank you. NYSE
> Euronext. *
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


--


Esteban Aliverti
-- next part --
An HTML attachment was scrubbed...
URL: 
http://lists.jboss.org/pipermail/rules-users/attachments/20100615/09ed061f/attachment-0001.html

--

Message: 2
Date: Tue, 15 Jun 2010 11:58:37 -0400
From: Fnu Mahalakshmi 
Subject: Re: [rules-users] Dynamic rule file uploading
To: "'rules-users@lists.jboss.org'" 
Message-ID:
<994758e35590274e955fa75763c5aa5002d01...@mtexmbxp01.ad.nyx.com>
Content-Type: text/plain; charset="us-ascii"

Hi,

Thanks for the quick reply.
But even by using knowledge agent I have to keep specifying each of the files 
one by one right? Which ever is contained in my folder with all the rule files? 
As I would keep doing:

kbuilder.add( ResourceFactory.newUrlResource

Re: [rules-users] Dynamic rule file uploading

2010-06-15 Thread Fnu Mahalakshmi
Hi,

Thanks for the quick reply.
But even by using knowledge agent I have to keep specifying each of the files 
one by one right? Which ever is contained in my folder with all the rule files? 
As I would keep doing:

kbuilder.add( ResourceFactory.newUrlResource( "file://myrules.drl" ),
   ResourceType.DRL);

So again I would have to list all my files and pass it to the knowledge agent 
which would add the new rule to the existing package( created using package 
builder).
Am I going wrong here??
Please help.

Thank you.
M


-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
rules-users-requ...@lists.jboss.org
Sent: Tuesday, June 15, 2010 11:13 AM
To: rules-users@lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 74

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

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

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

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


Today's Topics:

   1. Uploading rules dynamically (Fnu Mahalakshmi)
   2. Dynamic rule file uploading (Fnu Mahalakshmi)
   3. Re: Dynamic rule file uploading (PAYET, Manuel)


--

Message: 1
Date: Tue, 15 Jun 2010 10:56:42 -0400
From: Fnu Mahalakshmi 
Subject: [rules-users] Uploading rules dynamically
To: "'rules-users@lists.jboss.org'" 
Message-ID:
<994758e35590274e955fa75763c5aa5002d01...@mtexmbxp01.ad.nyx.com>
Content-Type: text/plain; charset="us-ascii"

Hi Guys,

How can I dynamically upload my rules? Can someone point me towards some 
documentation for the same??

Thank you.

M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


-- next part --
An HTML attachment was scrubbed...
URL: 
http://lists.jboss.org/pipermail/rules-users/attachments/20100615/dd42b4f2/attachment-0001.html
 

----------

Message: 2
Date: Tue, 15 Jun 2010 11:06:32 -0400
From: Fnu Mahalakshmi 
Subject: [rules-users] Dynamic rule file uploading
To: "'rules-users@lists.jboss.org'" 
Message-ID:
<994758e35590274e955fa75763c5aa5002d01...@mtexmbxp01.ad.nyx.com>
Content-Type: text/plain; charset="us-ascii"

Hi guys,

I have : {R1.drl,R2.drl,R3.brl}
After conversion and loading I have {R1.drl,R2.drl,R3.brl,R3.drl} files in the 
same directory where all my rules are stored.

I am using:
File folder = new File("SRC/MAIN/RULES");
File[] listOfFiles = folder.listFiles();

for listing all the files in my rules directory.
Now is there anyway that I can just hold on to the required files whenever my 
rule files are updated rather than having to manually keeping deleting and 
updating my rules directory?
Is there a more better way to do it rather than just listing all the files in 
the directory??

Thanks,
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


-- next part --
An HTML attachment was scrubbed...
URL: 
http://lists.jboss.org/pipermail/rules-users/attach

[rules-users] Dynamic rule file uploading

2010-06-15 Thread Fnu Mahalakshmi
Hi guys,

I have : {R1.drl,R2.drl,R3.brl}
After conversion and loading I have {R1.drl,R2.drl,R3.brl,R3.drl} files in the 
same directory where all my rules are stored.

I am using:
File folder = new File("SRC/MAIN/RULES");
File[] listOfFiles = folder.listFiles();

for listing all the files in my rules directory.
Now is there anyway that I can just hold on to the required files whenever my 
rule files are updated rather than having to manually keeping deleting and 
updating my rules directory?
Is there a more better way to do it rather than just listing all the files in 
the directory??

Thanks,
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] Uploading rules dynamically

2010-06-15 Thread Fnu Mahalakshmi
Hi Guys,

How can I dynamically upload my rules? Can someone point me towards some 
documentation for the same??

Thank you.

M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


Re: [rules-users] Error with executing rules

2010-06-15 Thread Fnu Mahalakshmi
Hi Guys,
Thanks a lot for help!
Got it resolved! Feels good to get it working :)
But have no idea what the problem was :) I created a brand new rule and it 
worked!
Thanks
M

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
rules-users-requ...@lists.jboss.org
Sent: Tuesday, June 15, 2010 10:11 AM
To: rules-users@lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 72

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

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

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

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


Today's Topics:

   1. Re: Error with executing rules (PAYET, Manuel)
   2. Re: Error with executing rules (Giovanni Motta)


--

Message: 1
Date: Tue, 15 Jun 2010 16:08:40 +0200
From: "PAYET, Manuel" 
Subject: Re: [rules-users] Error with executing rules
To: Rules Users List 
Message-ID:
<5104f06b63e3164faeb2f42b920311654ccca...@corpmail05.corp.capgemini.com>

Content-Type: text/plain; charset="iso-8859-1"

a : A( modified == "false" ) ==> here "false" is a String
and a.setModified( true ); ==> here true is a boolean

from your use of modified, I presume that modified is of boolean type. If it 
is, you'd probably want to do something like

rule "Rule3"
  dialect "mvel"
  when
a : A( modified == false )
  then
a.setModified( true );
update( a );
end

because, modified will never be equal to "false" in your file cause it"s a 
String

________
De : rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] De la part de Fnu Mahalakshmi
Envoy? : mardi 15 juin 2010 16:03
? : 'rules-users@lists.jboss.org'
Objet : [rules-users] Error with executing rules

Hi guys,

I have few .drl rules and 1 .brl rule (which I converted into a .drl rule as 
guided by the documentation online)
All my rules get created and fired. But the converted .brl rule does not get 
executed only.
I am unable to understand why.
Anyway I can check how it is working??
I put in the most basic rule which should work:
The coverted .drl file looks like this:
rule "Rule3"
  dialect "mvel"
  when
a : A( modified == "false" )
  then
a.setModified( true );
update( a );
end

// A being my fact with attribute modified set to false in the beginning.

The import statements are in a rule.package in the same folder.

Please help me. I do not understand why this rule doesn't get executed. All 
others do!

Thanks
M



Please consider the environment before printing this email.

Visit our website at http://www.nyse.com
*
Note: The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure. If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited. If you have received this communication in error, please notify the 
sender immediately by replying to the message, and please delete it from your 
system. Thank you. NYSE Euronext.
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.
-- next part --
An HTML attachment was scrubbed...
URL: 
http://lists.jboss.org/pipermail/rules-users/attachments/20100615/c5d875f5/attachment.html
 

--

Message: 2
Date: Tue, 15 Jun 2010 16:10:27 +0200
From: Giovanni Motta 
Subject: Re: [rules-users] Error with executing rules
To: Rules Users List 
Message-ID:

Content-Type: text/plain; charset="windows-1252"

Is 'modified' a boolean field?
If so as it seems, i think you should write:
A( modified == false )

(no quotes)

Regards.

2010/6/15 Fnu Mahal

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

2010-06-15 Thread Fnu Mahalakshmi
Hi, 

Thanks for the quick response.
I sent you the converted .drl file.
It gets set like that automatically after conversion.
I just include false in the literal field not "false".
How else could I specify that?

Thanks 
M

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
rules-users-requ...@lists.jboss.org
Sent: Tuesday, June 15, 2010 10:11 AM
To: rules-users@lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 72

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

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

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

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


Today's Topics:

   1. Re: Error with executing rules (PAYET, Manuel)
   2. Re: Error with executing rules (Giovanni Motta)


--

Message: 1
Date: Tue, 15 Jun 2010 16:08:40 +0200
From: "PAYET, Manuel" 
Subject: Re: [rules-users] Error with executing rules
To: Rules Users List 
Message-ID:
<5104f06b63e3164faeb2f42b920311654ccca...@corpmail05.corp.capgemini.com>

Content-Type: text/plain; charset="iso-8859-1"

a : A( modified == "false" ) ==> here "false" is a String
and a.setModified( true ); ==> here true is a boolean

from your use of modified, I presume that modified is of boolean type. If it 
is, you'd probably want to do something like

rule "Rule3"
  dialect "mvel"
  when
a : A( modified == false )
  then
a.setModified( true );
update( a );
end

because, modified will never be equal to "false" in your file cause it"s a 
String

____________
De : rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] De la part de Fnu Mahalakshmi
Envoy? : mardi 15 juin 2010 16:03
? : 'rules-users@lists.jboss.org'
Objet : [rules-users] Error with executing rules

Hi guys,

I have few .drl rules and 1 .brl rule (which I converted into a .drl rule as 
guided by the documentation online)
All my rules get created and fired. But the converted .brl rule does not get 
executed only.
I am unable to understand why.
Anyway I can check how it is working??
I put in the most basic rule which should work:
The coverted .drl file looks like this:
rule "Rule3"
  dialect "mvel"
  when
a : A( modified == "false" )
  then
a.setModified( true );
update( a );
end

// A being my fact with attribute modified set to false in the beginning.

The import statements are in a rule.package in the same folder.

Please help me. I do not understand why this rule doesn't get executed. All 
others do!

Thanks
M



Please consider the environment before printing this email.

Visit our website at http://www.nyse.com
*
Note: The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure. If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited. If you have received this communication in error, please notify the 
sender immediately by replying to the message, and please delete it from your 
system. Thank you. NYSE Euronext.
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.
-- next part --
An HTML attachment was scrubbed...
URL: 
http://lists.jboss.org/pipermail/rules-users/attachments/20100615/c5d875f5/attachment.html
 

--

Message: 2
Date: Tue, 15 Jun 2010 16:10:27 +0200
From: Giovanni Motta 
Subject: Re: [rules-users] Error with executing rules
To: Rules Users List 
Message-ID:

Content-Type: text/plain; charset="windows-1252"

Is 'modified' a boolean field?
If so as it seems, i think you should wr

[rules-users] Error with executing rules

2010-06-15 Thread Fnu Mahalakshmi
Hi guys,

I have few .drl rules and 1 .brl rule (which I converted into a .drl rule as 
guided by the documentation online)
All my rules get created and fired. But the converted .brl rule does not get 
executed only.
I am unable to understand why.
Anyway I can check how it is working??
I put in the most basic rule which should work:
The coverted .drl file looks like this:
rule "Rule3"
  dialect "mvel"
  when
a : A( modified == "false" )
  then
a.setModified( true );
update( a );
end

// A being my fact with attribute modified set to false in the beginning.

The import statements are in a rule.package in the same folder.

Please help me. I do not understand why this rule doesn't get executed. All 
others do!

Thanks
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] Error uploading and reading rule files

2010-06-14 Thread Fnu Mahalakshmi
Hi Guys,

I have successfully converted my .brl file to a .drl file using the code below 
and added it to my rulebase.
The file gets created with the required .drl code (which resembles the view 
source of a guided business rule created in guvnor editor).

But the rule does not seem to be getting fired. I tried setting it to the most 
basic option which should work - doesn't work.
Please tell me if I am missing something.

My code is below:
  File file = new File("src/main/rules/Rule3.brl");
String brl = null;
String outputDRL =null;

  BRXMLPersistence read = (BRXMLPersistence) 
BRXMLPersistence.getInstance();
  BRDRLPersistence write = (BRDRLPersistence) 
BRDRLPersistence.getInstance();
  brl = FileUtils.readFileToString(file);
System.out.println("File content: " + brl);
outputDRL = write.marshal(read.unmarshal(brl));
String drlFilePath = "src/main/rules/drlFile.drl";
String path = "/drlFile.drl";
System.out.println("drlfile "+drlFilePath);
File drlFile = new File(drlFilePath);
FileUtils.writeStringToFile(drlFile, outputDRL);

Reader source = new InputStreamReader( 
RuleRunner.class.getResourceAsStream(path) );
addRulesToThisPackage.addPackageFromDrl(source);


The generated .drl file looks like this:

rule "Rule3"
  dialect "mvel"
  when
B( name == "xyz" )
  then
A fact0 = new a();
fact0.setModified( true );
insertLogical( fact0 );
end

I have my import statements in a file rule.package in the same directory as the 
rules files.

Please tell me if you can point out where my mistake is.?? I am clueless!

Thanks
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


Re: [rules-users] Error with conversion from .brl to .drl file

2010-06-14 Thread Fnu Mahalakshmi
Hi,

This is my exact code:
I added the missing BRXMLpackage again.
I have my .brl file in the current working directory with all the .drlfiles.
When I do: File file = new File(rulesFiles); => I get FileNotFound exception // 
I don't understand this as the file is in the correct path as other files

When I hardcode the path - I get the conversion to the XML format (which I 
printed to the console)- the new drl file gets formed - but not in the current 
working directory - it is in the main project directory.
Program again crashes at this line:
 addRulesToThisPackage.addPackageFromDrl(new

 
InputStreamReader(RuleRunner.class.getResourceAsStream(drlFilePath)));

I get error stack:


Exception in thread "main" java.lang.NullPointerException
at java.io.Reader.(Unknown Source)
at java.io.InputStreamReader.(Unknown Source)
at com.org.RuleRunner.loadRuleFile(RuleRunner.java:81)
at com.org.RuleRunner.loadRules(RuleRunner.java:43)
at com.org.RuleRunner.runStatelessRules(RuleRunner.java:104)
at com.org.RulesTest.main(RulesTest.java:40)

**
My code is as follows:


File file = new File(rulesFiles);

String brl = null;

try{

  BRXMLPersistence read = (BRXMLPersistence) 
BRXMLPersistence.getInstance();

  BRDRLPersistence write = (BRDRLPersistence) 
BRDRLPersistence.getInstance();

  brl = FileUtils.readFileToString(file);

System.out.println("File content: " + brl);

String outputDRL = write.marshal(read.unmarshal(brl));

String drlFilePath = "drlFile.drl";

File drlFile = new File(drlFilePath);

FileUtils.writeStringToFile(drlFile, outputDRL);

addRulesToThisPackage.addPackageFromDrl(new

 
InputStreamReader(RuleRunner.class.getResourceAsStream(drlFilePath)));

}catch (IOException e) {



  e.printStackTrace();

 }


Am I going wrong at some part


Please help,

Thanks
M

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
rules-users-requ...@lists.jboss.org
Sent: Monday, June 14, 2010 10:02 AM
To: rules-users@lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 69

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

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

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

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


Today's Topics:

   1. Re: Error with conversion from .brl to .drl file (Fnu Mahalakshmi)
   2. Re: Error with conversion from .brl to .drl file
  (Swindells, Thomas)
   3. Re: rules-users Digest, Vol 43, Issue 68 (Fnu Mahalakshmi)


------

Message: 1
Date: Mon, 14 Jun 2010 09:23:33 -0400
From: Fnu Mahalakshmi 
Subject: Re: [rules-users] Error with conversion from .brl to .drl
file
To: "'rules-users@lists.jboss.org'" 
Message-ID:
<994758e35590274e955fa75763c5aa5002d01...@mtexmbxp01.ad.nyx.com>
Content-Type: text/plain; charset="us-ascii"


Hi Giovanni,

The classpath shows the commons jar added under UserEntries.

I am getting another error when I try running the program now :

Exception in thread "main" java.lang.NoClassDefFoundError: 
org/drools/brms/server/util/BRXMLPersistence
at com.org.RulesTest.main(RulesTest.java:40)
Caused by: java.lang.ClassNotFoundException: 
org.drools.brms.server.util.BRXMLPersistence
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 1 more

This was not coming till now.
The exception come at the line when the .brl file is to  be processed.
I am not able to figure out. I tried googling the error. But no use!

Please help!
Thanks
M

--

Message: 2
Date: Mon, 14 Jun 2010 10:09:50 +0200
From: Giovanni Motta 
Subject: Re: [rules-users] Error with conversion from .brl to .drl
file
To: Rules Users List 
Message-ID:

Content-Type: te

Re: [rules-users] rules-users Digest, Vol 43, Issue 68

2010-06-14 Thread Fnu Mahalakshmi
Hi Kicho,

I could not find addPackageFromBRL() in Package Builder.

Any other options???

Thanks
M
-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
rules-users-requ...@lists.jboss.org
Sent: Monday, June 14, 2010 8:36 AM
To: rules-users@lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 68

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

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

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

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


Today's Topics:

   1. Re: running brl rules - error (kicho)
   2. Error using change-set (Raf)
   3. Re: Error using change-set (Esteban Aliverti)
   4. Re: Error using change-set (Raf)


--

Message: 1
Date: Mon, 14 Jun 2010 04:10:02 -0700 (PDT)
From: kicho 
Subject: Re: [rules-users] running brl rules - error
To: rules-users@lists.jboss.org
Message-ID: <1276513802820-894097.p...@n3.nabble.com>
Content-Type: text/plain; charset=us-ascii


Hi,

you should have a look at PackageBuilder javadoc. There is a method for
adding brl's:

public void addPackageFromBrl(Resource resource)
   throws DroolsParserException,
  IOException

Throws:
DroolsParserException
IOException


--
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/running-brl-rules-error-tp889521p894097.html
Sent from the Drools - User mailing list archive at Nabble.com.


--

Message: 2
Date: Mon, 14 Jun 2010 13:24:05 +0200
From: Raf 
Subject: [rules-users] Error using change-set
To: rules-users@lists.jboss.org
Message-ID:

Content-Type: text/plain; charset="iso-8859-1"

Hi,
I am trying to use a change-set file to load my DSL and DSLR resources, but
I am not able to get it working.

My first attempt was based on the snippet I found here:
http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/drools-expert/html/ch03.html#d0e933



   
  
  
   


but I received the following error:
(null: 4, 78): SchemaLocation: schemaLocation value = '
http://drools.org/drools-5.0/change-set.xsd' must have even number of URI's.
(null: 4, 78): cvc-elt.1: Cannot find the declaration of element
'change-set'.

Then, I found the following old post in the mailing list:
http://drools-java-rules-engine.46999.n3.nabble.com/changset-xml-error-when-running-Knowledge-Agent-td182469.html
where it was suggested to
"Just replace *xs:schemaLocation='**http://drools.org/drools-5.0/change-set.
xsd* *'* by *xs:schemaLocation
='http://drools.org/drools-5.0/change-set drools-change-set-5.0.xsd'*"

So I changed my file to:


   
  
  
   


but now I receive the following errors:
(null: 4, 100): schema_reference.4: Failed to read schema document
'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
document could not be read; 3) the root element of the document is not
.
(null: 4, 100): cvc-elt.1: Cannot find the declaration of element
'change-set'.
(null: 5, 9): schema_reference.4: Failed to read schema document
'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
document could not be read; 3) the root element of the document is not
.
(null: 6, 63): schema_reference.4: Failed to read schema document
'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
document could not be read; 3) the root element of the document is not
.
(null: 7, 65): schema_reference.4: Failed to read schema document
'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
document could not be read; 3) the root element of the document is not
.

What am I missing?

Thanks.
Raf
-- next part --
An HTML attachment was scrubbed...
URL: 
http://lists.jboss.org/pipermail/rules-users/attachments/20100614/50f99fee/attachment-0001.html

--

Message: 3
Date: Mon, 14 Jun 2010 08:50:28 -0300
From: Esteban Aliverti 
Subject: Re: [rules-users] Error using change-set
To: Rules Users List 
Message-ID:

Content-Type: text/plain; charset="iso-8859-1"

Hi,
The "null: 4, 78): SchemaLocation: schemaLocation value = '
http://drools.org/drools-5.0/change-set.xsd' must have even number of URI's.
(null: 4, 78): cvc-elt.1: Cannot find the declaration of element
'change-set'."  error is harmless. The agent should work anyway.
Please take a look at https://jira.jboss.org/browse/JBRULES-2377. Maybe you
are experiencing that error. I need to take a look at this is

Re: [rules-users] Error with conversion from .brl to .drl file

2010-06-14 Thread Fnu Mahalakshmi

Hi Giovanni,

The classpath shows the commons jar added under UserEntries.

I am getting another error when I try running the program now :

Exception in thread "main" java.lang.NoClassDefFoundError: 
org/drools/brms/server/util/BRXMLPersistence
at com.org.RulesTest.main(RulesTest.java:40)
Caused by: java.lang.ClassNotFoundException: 
org.drools.brms.server.util.BRXMLPersistence
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 1 more

This was not coming till now.
The exception come at the line when the .brl file is to  be processed.
I am not able to figure out. I tried googling the error. But no use!

Please help!
Thanks 
M

--

Message: 2
Date: Mon, 14 Jun 2010 10:09:50 +0200
From: Giovanni Motta 
Subject: Re: [rules-users] Error with conversion from .brl to .drl
file
To: Rules Users List 
Message-ID:

Content-Type: text/plain; charset="windows-1252"

Are you launching the application from within eclipse?
Have you checked the classpath of the launch configuration? You can see it
by right-clicking the .java file and then selecting "run as --> run
configurations..."
Does it show the commons jar?


2010/6/12 Fnu Mahalakshmi 

>  Hi,
>
> I just tried everything I could think of but still getting error.
>
> Using following code for converting from .brl file to .drl file:
>
>
>
> File file = *new* File(rulesFiles);
>
> String brl = *null*;
>
> *try*{
>
>   BRXMLPersistence read = (BRXMLPersistence)
> BRXMLPersistence.*getInstance*();
>
>   BRDRLPersistence write = (BRDRLPersistence)
> BRDRLPersistence.*getInstance*();
>
>   brl = FileUtils.*readFileToString*(file);
>
> System.*out*.println("File content: " + brl);
>
> String outputDRL = write.marshal(read.unmarshal(brl));
>
> String drlFilePath = "drlFile.drl";
>
> File drlFile = *new* File(drlFilePath);
>
> FileUtils.*writeStringToFile*(drlFile, outputDRL);
>
> addRulesToThisPackage.addPackageFromDrl(*new*
>
>  InputStreamReader(RuleRunner.*class*
> .getResourceAsStream(drlFilePath)));
>
> }*catch* (IOException e) {
>
>
>
>   e.printStackTrace();
>
>  }
>
>
>
> I have added the org.apache.commons .jar files to the classpath.
>
> It contains a FileUtils.java  file which I added to the classpath.
>
>
>
> Now the error I get when I run the program is :
>
> Exception in thread "main" java.lang.Error: Unresolved compilation problem:
>
>
>   FileUtils cannot be resolved
>
>
>
>   at com.org.RuleRunner.loadRuleFile(*RuleRunner.java:70*)//
>
>   at com.org.RuleRunner.loadRules(*RuleRunner.java:45*)
>
>   at com.org.RuleRunner.runStatelessRules(*RuleRunner.java:102*)
>
>   at com.org.RulesTest.main(*RulesTest.java:40*)
>
>
>
>
>
>
>
> I don?t understand why still I am getting the error.
>
> RuleRunner.java:70 is : brl = FileUtils.*readFileToString*(file);
>
> Is there any thing else I could use ?/ Could you give me a hint??
>
> Thank you
>
> M
>
> --
>
> *Please consider the environment before printing this email.*
>
> *Visit our website at http://www.nyse.com
> *
>
> Note: The information contained in this message and any attachment to it is
> privileged, confidential and protected from disclosure. If the reader of
> this message is not the intended recipient, or an employee or agent
> responsible for delivering this message to the intended recipient, you are
> hereby notified that any dissemination, distribution or copying of this
> communication is strictly prohibited. If you have received this
> communication in error, please notify the sender immediately by replying to
> the message, and please delete it from your system. Thank you. NYSE
> Euronext. *
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-

[rules-users] Error with conversion from .brl to .drl file

2010-06-11 Thread Fnu Mahalakshmi
Hi,
I just tried everything I could think of but still getting error.
Using following code for converting from .brl file to .drl file:

File file = new File(rulesFiles);
String brl = null;
try{
  BRXMLPersistence read = (BRXMLPersistence) 
BRXMLPersistence.getInstance();
  BRDRLPersistence write = (BRDRLPersistence) 
BRDRLPersistence.getInstance();
  brl = FileUtils.readFileToString(file);
System.out.println("File content: " + brl);
String outputDRL = write.marshal(read.unmarshal(brl));
String drlFilePath = "drlFile.drl";
File drlFile = new File(drlFilePath);
FileUtils.writeStringToFile(drlFile, outputDRL);
addRulesToThisPackage.addPackageFromDrl(new
 
InputStreamReader(RuleRunner.class.getResourceAsStream(drlFilePath)));
}catch (IOException e) {

  e.printStackTrace();
 }

I have added the org.apache.commons .jar files to the classpath.
It contains a FileUtils.java  file which I added to the classpath.

Now the error I get when I run the program is :
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
  FileUtils cannot be resolved

  at com.org.RuleRunner.loadRuleFile(RuleRunner.java:70)//
  at com.org.RuleRunner.loadRules(RuleRunner.java:45)
  at com.org.RuleRunner.runStatelessRules(RuleRunner.java:102)
  at com.org.RulesTest.main(RulesTest.java:40)



I don't understand why still I am getting the error.
RuleRunner.java:70 is : brl = FileUtils.readFileToString(file);
Is there any thing else I could use ?/ Could you give me a hint??
Thank you
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] Error loading .brl rules

2010-06-11 Thread Fnu Mahalakshmi
Hi,

I am getting an error reading .brl files.
Using this snippet of code for converting from brl to drl

import org.apache.commons.io.*;

String fileName = "GuidedRule.brl";

File file = new File(fileName);

String fileAsString = FileUtils.readFileToString(file);



BRXMLPersistence read = (BRXMLPersistence) BRXMLPersistence.getInstance();

BRDRLPersistence write = (BRDRLPersistence) BRDRLPersistence.getInstance();



String outputDRL = write.marshal(read.unmarshal(fileAsString));

 String drlFilePath = "drlFile.drl";

 File drlFile = new File(drlFilePath);

 FileUtils.writeStringToFile(drlFile, outputDRL);

 builder.addPackageFromDrl(new

InputStreamReader(RuleRunner.class.getResourceAsStream(drlFilePath)));


For this, I added commons-logging-1.1.1.jar file to my classpath. But still 
FileUtils is not getting resolved.
SO am unable to use FileUtils to convert input to String format.

Is there any other way to do this??? Why am I getting the error even after 
adding the jar to my classpath???

Please Help,
Thank you.
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


Re: [rules-users] error running .brl frules

2010-06-11 Thread Fnu Mahalakshmi
Hi,
I have {Rule1.drl,Rule2,drl,Rule3.brl}
Both the .drl rules run correctly but the .brl does not load and gives me the 
following error

I am loading my rules as follows:

private RuleBase loadRules(String[]  rules) throws Exception{

  PackageBuilder builder = new PackageBuilder();

  for ( int i = 0; i < rules.length; i++ ) {
  String rulesFiles = rules[i];
  //Check the type of rule file, then load it
  System.out.println("loading rule file : "+rulesFiles);
  loadRuleFile(rulesFiles,builder);

  }
  Package pkg = builder.getPackage();
  RuleBase localRuleBase = RuleBaseFactory.newRuleBase();
  localRuleBase.addPackage( pkg );

  return localRuleBase;
}
private void loadRuleFile(String rulesFiles,PackageBuilder 
addRulesToThisPackage ) throws DroolsParserException, IOException{
int len = rulesFiles.length();
if(rulesFiles.substring((len-4), len).equalsIgnoreCase(".brl")){
BRXMLPersistence read = (BRXMLPersistence) 
BRXMLPersistence.getInstance();
BRDRLPersistence write = (BRDRLPersistence) 
BRDRLPersistence.getInstance();
String brl = rulesFiles;
String outputDRL = write.marshal(read.unmarshal(brl));
rulesFiles = outputDRL;
}

Reader source = new InputStreamReader( 
RuleRunner.class.getResourceAsStream(rulesFiles) );

//Exception if rule files are not found
if(null==source){
throw new FileNotFoundException("Cannot find rule 
file:"+rulesFiles);
}
//Load the rules , no DSL
addRulesToThisPackage.addPackageFromDrl(source);


}
I get the following error:

[Fatal Error] :1:1: Content is not allowed in prolog.
Exception in thread "main" com.thoughtworks.xstream.io.StreamException:  : 
Content is not allowed in prolog.
at 
com.thoughtworks.xstream.io.xml.DomDriver.createReader(DomDriver.java:65)
at 
com.thoughtworks.xstream.io.xml.DomDriver.createReader(DomDriver.java:47)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:781)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:773)
at 
org.drools.brms.server.util.BRXMLPersistence.unmarshal(BRXMLPersistence.java:91)
at com.org.RuleRunner.loadRuleFile(RuleRunner.java:65)
at com.org.RuleRunner.loadRules(RuleRunner.java:42)
at com.org.RuleRunner.runStatelessRules(RuleRunner.java:90)
at com.org.RulesTest.main(RulesTest.java:40)
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at 
com.thoughtworks.xstream.io.xml.DomDriver.createReader(DomDriver.java:58)
... 8 more


Any Idea?
Thank you.
M






Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


-- next part --
An HTML attachment was scrubbed...
URL: 
http://lists.jboss.org/pipermail/rules-users/attachments/20100611/fd0893d9/attachment.html
 

--

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


End of rules-users Digest, Vol 43, Issue 63
***
Please consider the environment before printing this email.

Visit our website at http://www.nyse.com



Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.



[rules-users] running brl rules - error

2010-06-11 Thread Fnu Mahalakshmi
Hi,
I have {Rule1.drl,Rule2,drl,Rule3.brl}
Both the .drl rules run correctly but the .brl does not load and gives me the 
following error
Exception in thread "main" org.drools.rule.InvalidRulePackage: [1,0]: 
unknown:1:0 mismatched token: [...@0,0:0='<',<79>,1:0];
  at org.drools.rule.Package.checkValidity(Package.java:424)
  at 
org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:394)
  at com.org.RuleRunner.loadRules(RuleRunner.java:45)
  at com.org.RuleRunner.runStatelessRules(RuleRunner.java:79)
  at com.org.RulesTest.main(RulesTest.java:40)

I am loading my rules as follows:

private RuleBase loadRules(String[]  rules) throws Exception{

  PackageBuilder builder = new PackageBuilder();

  for ( int i = 0; i < rules.length; i++ ) {
  String rulesFiles = rules[i];
  //Check the type of rule file, then load it
  System.out.println("loading rule file : "+rulesFiles);
  loadRuleFile(rulesFiles,builder);

  }
  Package pkg = builder.getPackage();
  RuleBase localRuleBase = RuleBaseFactory.newRuleBase();
  localRuleBase.addPackage( pkg );

  return localRuleBase;
}

private void loadRuleFile(String rulesFiles,PackageBuilder 
addRulesToThisPackage ) throws DroolsParserException, IOException{
Reader source = new InputStreamReader( 
RuleRunner.class.getResourceAsStream(rulesFiles) );
//Load the rules , no DSL
addRulesToThisPackage.addPackageFromDrl(source); // is this wrong??? Is 
there another method that I should
be using???


}
The above code is where I get the error.
Is there some other way to load .brl and .drl files?? We cannot do it together??
I could not find any help on;line on loading and running .brl files.

Please help.
Thank you.
M






Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] error accessing repository

2010-06-11 Thread Fnu Mahalakshmi
Hi guys,

I am getting a really weird problem.
I am using eclipse for working on my drools project and I have installed the 
plugin for drools using the update link specified on the site.
It seemed to be working fine till yesterday.
But now I do not even get the option of importing from my guvnor repository. 
The guvnor option seems to not be there anywhere.
I tried reupdating using the link but that is fine.

Is there something I am missing over here???
Please help!

-M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


Re: [rules-users] Error using forAll() in

2010-06-10 Thread Fnu Mahalakshmi
Hi,

Thanks for the prompt response.
I just broke the information into 2 separate rules and it works great.
In 1 I modified it to check if the value of B is modified then that A value is 
modified
In the 2 rule I checked if A is modified then all the Bs referencing A is 
modified.
Removed the forAll completely.
Thanks for the help :)

-M
-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
rules-users-requ...@lists.jboss.org
Sent: Thursday, June 10, 2010 4:48 PM
To: rules-users@lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 58

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

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

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

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


Today's Topics:

   1. Error using forAll() in rules (Fnu Mahalakshmi)
   2. Re: Error using forAll() in rules (Wolfgang Laun)


--

Message: 1
Date: Thu, 10 Jun 2010 16:16:47 -0400
From: Fnu Mahalakshmi 
Subject: [rules-users] Error using forAll() in rules
To: "'rules-users@lists.jboss.org'" 
Message-ID:
<994758e35590274e955fa75763c5aa5002d01...@mtexmbxp01.ad.nyx.com>
Content-Type: text/plain; charset="us-ascii"

Hi,
I have a list of items which I want to modify if condition turns true. I tried 
forall but its not working::

A{
String Name
}
B{
A a,
}

Rule " modify B if A name = 'bob'"
when
forall($a : A()
  $b : B( a == $a)
  )
  then
modify($b){
seta($a.getName())};
I have many B objects pointing to same A object and when name of A is modified 
I want the rule to fire and all B to also be modified.

What is wrong above???
I tried this too:
when
forall($a : A()
  B( a == $a)
  )
  then
modify($b){   // but then I cannot do this step.which is 
required
seta($a.getName())};

Any Idea???


Thank you
M




Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


-- next part --
An HTML attachment was scrubbed...
URL: 
http://lists.jboss.org/pipermail/rules-users/attachments/20100610/874f04c7/attachment-0001.html
 

--

Message: 2
Date: Thu, 10 Jun 2010 22:47:31 +0200
From: Wolfgang Laun 
Subject: Re: [rules-users] Error using forAll() in rules
To: Rules Users List 
Message-ID:

Content-Type: text/plain; charset="windows-1252"

Your description of what you think you have to do does not agree with much
of the code you show.

- The rule name says that is depends on A.name == "bob", which isn't in the
condition.
- The RHS setA( $a.getName() ) is obviusly in error because B.a is an A, not
a String.
- Why should B be modified, if the change only concerns A.name.

It is sufficient to change A.name. All Bs referencing that one A will
continue to reference the modfied A.

-W


2010/6/10 Fnu Mahalakshmi 

>  Hi,
>
> I have a list of items which I want to modify if condition turns true. I
> tried forall but its not working::
>
>
>
> A{
>
> String Name
>
> }
>
> B{
>
> A a,
>
> }
>
>
>
> Rule ? modify B if A name = ?bob??
>
> *when*
>
> *forall*($a : A()
>
>   $b : B( a == $a)
>
>   )
>
>   *then*
>
> modify($b){
>
> seta($a.getName())};
>
> I have many B objects pointing to same A object and when name of A is
> modified I want the rule to fire and all B to also be modified.
>
>
>
> What is wrong above???
>
> I tried this too:
>
> *when*
>
> *for

[rules-users] Error using forAll() in rules

2010-06-10 Thread Fnu Mahalakshmi
Hi,
I have a list of items which I want to modify if condition turns true. I tried 
forall but its not working::

A{
String Name
}
B{
A a,
}

Rule " modify B if A name = 'bob'"
when
forall($a : A()
  $b : B( a == $a)
  )
  then
modify($b){
seta($a.getName())};
I have many B objects pointing to same A object and when name of A is modified 
I want the rule to fire and all B to also be modified.

What is wrong above???
I tried this too:
when
forall($a : A()
  B( a == $a)
  )
  then
modify($b){   // but then I cannot do this step.which is 
required
seta($a.getName())};

Any Idea???


Thank you
M




Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


Re: [rules-users] Error with Comparisons in rules

2010-06-10 Thread Fnu Mahalakshmi
Hi Giovanni,

Thanks for the quick response.
I tried what you suggested the alternate suggestion and solves all problems :)

Thanks so much.
I removed the salience factor which I had added. It somehow made sure that the 
rule doesn't get fired only :P
Just added a modify block to modify required data.

Thanks so much.
I am having one more problem with creating .brl files in eclipse. Could you 
help me on that?? 
When I create a Guided business rule in eclipse - the drop downs to choose the 
facts always turn out empty. I tried adding a .package with all my import 
statements, adding the .jar to the classpath everything. Nothing seems to work.
Importing it from guvnor gives following error stack:

com.thoughtworks.xstream.mapper.CannotResolveClassException: metadataList : 
metadataList

at 
com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:49)

at 
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)

at 
com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:76)

at 
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)

at 
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)

at 
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)

at 
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)

at 
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)

at 
com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:60)

at 
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)

at 
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)

at 
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)

at 
com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:76)

at 
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)

at 
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)

at 
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)

at 
com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:34)

at 
com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.determineType(AbstractReflectionConverter.java:296)

at 
com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:178)

at 
com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:125)

at 
com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:56)

at 
com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:45)

at 
com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:46)

at 
com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:117)

at 
com.thoughtworks.xstream.core.ReferenceByXPathMarshallingStrategy.unmarshal(ReferenceByXPathMarshallingStrategy.java:29)

at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:846)

at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:833)

at com.thoughtworks.xstream.XStream.fromXML(XStream.java:781)

at com.thoughtworks.xstream.XStream.fromXML(XStream.java:773)

at 
org.drools.brms.server.util.BRXMLPersistence.unmarshal(BRXMLPersistence.java:91)

at 
org.drools.eclipse.rulebuilder.editors.BrlPage.setModelXML(Unknown Source)

at 
org.drools.eclipse.rulebuilder.editors.RuleEditor.pageChange(Unknown Source)

at 
org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiPageEditorPart.java:1076)

at 
org.eclipse.ui.forms.editor.FormEditor.setActivePage(FormEditor.java:597)

at 
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:361)

at 
org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:662)

at 
org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:462)

at 
org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)

at 
org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:286)

at 
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2857)

at 
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2762)

at 
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2754)

[rules-users] Error with Comparisons in rules

2010-06-10 Thread Fnu Mahalakshmi
Hi guys,

Can we compare 2 attributes of an object in a rule??
Example:

A{
Object x,
Object y,
String status,
}
X{
String name
}
Y{
String name
}

Rule " check if x and y have same name in A"
When
$x : X()
$y :Y()
$a : A( x == $x, y == $y}//this part not working for me
Eval($x.name == $y.name)
Then
Modify($a){
setStatus("same")
};

End

Is there a better way to achieve this

Please help.

Thank you
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


Re: [rules-users] error with firing of rules and chainig rules

2010-06-10 Thread Fnu Mahalakshmi
Hi guys,
Thanks for the response.
When I store data as a collection the rules don't seem to get fired. I think 
the data is not being read.
I tried everything suggested.
So broke down the data storing them as individual java bean objects.

Is this a possibility??

Rule
When
$fire : Fire(room != null, status == true)
$sprinkler : Sprinkler(room != "")
Eval($sprinkler.getRoomId == $fire.getRoomId)  //this doesn't work. Anyway I
can 
compare 2 values in my  
rules

Then
Modify($sprinkler){
setSprinklerStatus(true);
}



I am trying to check if the fire for the room 1 is true then if sprinkler for 
that room exists then that is also set true.

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
rules-users-requ...@lists.jboss.org
Sent: Thursday, June 10, 2010 4:57 AM
To: rules-users@lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 53

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

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

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

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


Today's Topics:

   1. Re: error with firing of rules and chainig rules (Giovanni Motta)
   2. Re: depicting array in rules (Swindells, Thomas)


--

Message: 1
Date: Thu, 10 Jun 2010 09:59:27 +0200
From: Giovanni Motta 
Subject: Re: [rules-users] error with firing of rules and chainig
rules
To: Rules Users List 
Message-ID:

Content-Type: text/plain; charset="windows-1252"

When you update your objects, do you notify the session of the change?
If you do that, you should not take care of salience. The objects insertion
order is not relevant (or, at least, marginally).
To notify the session of an object change, you should either put your
modifications inside a 'modify' block (see the docs) or let your java beans
include a 'PropertyChangeSupport' field (see dynamic facts).
In your sample, when the room gets the 'fire' status, the session should be
notified of the change, and the sprinkler rule will fire.

Regards

2010/6/9 Fnu Mahalakshmi 

>  Hi,
>
>
>
> If you have multiple rules where its important that rule 1 be fired on the
> data first and then rule 2 how can we do this without specifying the
> salience factor?
>
> I do not want my rules to be dependant on each other as the data I am
> passing  differs from each other.
>
> Ex:
>
> Room{
>
> Name, Id,
>
> Status,
>
> }
>
> Fire{
>
> Room,
>
> FireType}
>
>
>
> Sprinkler{
>
> Room,
>
> SprinklerType
>
> status}
>
>
>
>
>
> I pass all data above into my working memory.
>
> I have rules:
>
> Rule 1: ?if fire exists update room status to ?fire??
>
> Rule 2: ?if room has status ?fire? update sprinkler status to ?room
> number??
>
>
>
> Now when I pass my javabean objects: if theobject of type sprinkler gets
> processed first it will never get the room number even if actually the room
> has status ?fire?
>
>
>
> If I specify salience feature then It will never work for my sprinkler
> objects and always be multichained.
>
> I don?t want chaining between my rules.
>
>
>
> Any suggestions???
>
> Thank you
>
> M
>
> --
>
> *Please consider the environment before printing this email.*
>
> *Visit our website at http://www.nyse.com
> *
>
> Note: The information contained in this message and any attachment to it is
> privileged, confidential and protected from disclosure. If the reader of
> this message is not the intended recipient, or an employee or agent
> responsible for delivering this message to the intended recipient, you are
> hereby notified that any dissemination, distribution or copying of this
> communication is strictly prohibited. If you have received this
> communication in error, please notify the sender immediately by replying to
> the message, and please delete it from your system. Thank you. NYSE
> Euronext. *
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/lis

[rules-users] Multiple relationship in rules problem

2010-06-09 Thread Fnu Mahalakshmi
Hi guys,

I want to work out a one to many relationship in my rules

I have 2 classes:
A{
ArrayListblist;
status
}
B{
Status}
If A points to {B1,B2,B3}
If B1 exists in A then B1 status = on and A status is on
And B2, B3 status is updated to on as it is also associated with A

I am unable to depict this in my rules.
How can I traverse through lists in my rules.

I tried this::
when
$a : A()
$b : bList from $A.ipList
exists (B( status == "on") from $b)
then
modify ($a) {setStatus("on")};
end

But above doesn't work. I guess its because $b is just a variable and I am 
passing a list.
But not knowing how to do it.

Please help!!! Or is there any other way to go about it???

Thank you.

M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] depicting array in rules

2010-06-09 Thread Fnu Mahalakshmi
Hi,

Is there any way I can represent an array of values in my rules??
I want to do this:
Fire{
Room,
Status}
Sprinkler{
Object [] Room = new Room[]{new Room(),new room()}
Status
}
Room{
Name,
Number}

Rule " if fire in room start sprinkler if room has sprinkler"
No-loop true
when

  Fire($room : room)
  $sprinkler : Sprinkler( room == $room) # how can I search through the 
array of room values here???
  then
modify($sprinkler){
  setStatus(true)
  };
End


Any Idea if that is possible to implement in rules???
I could do it with adding different instances of sprinkler and rooms. But I 
want to minimize the amount of repetition in data stored and loaded into the 
working memory.

Any idea??
Thank you,
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] error with firing of rules and chainig rules

2010-06-09 Thread Fnu Mahalakshmi
Hi,

If you have multiple rules where its important that rule 1 be fired on the data 
first and then rule 2 how can we do this without specifying the salience factor?
I do not want my rules to be dependant on each other as the data I am passing  
differs from each other.
Ex:
Room{
Name, Id,
Status,
}
Fire{
Room,
FireType}

Sprinkler{
Room,
SprinklerType
status}


I pass all data above into my working memory.
I have rules:
Rule 1: "if fire exists update room status to 'fire'"
Rule 2: "if room has status 'fire' update sprinkler status to 'room number'"

Now when I pass my javabean objects: if theobject of type sprinkler gets 
processed first it will never get the room number even if actually the room has 
status 'fire'

If I specify salience feature then It will never work for my sprinkler objects 
and always be multichained.
I don't want chaining between my rules.

Any suggestions???
Thank you
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] uploading rule files dynamically

2010-06-09 Thread Fnu Mahalakshmi
Hi,
Is there anyway that I can dynamically add rule files??
I am loading it like this as of now :
private static final String[] RULES_FILES = new String[]{ "Rule1.drl"};

new RuleRunner().runStatelessRules(RULE_FILES,null,list_of_data,null);


If I create new rule files, I will have to keep adding it to RULES_FILES.
Is there someway I can check dynamically if there are more rule files and get 
it added to my rulebase??

Thanks
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] error importing .brl files

2010-06-09 Thread Fnu Mahalakshmi
Hi guys,

Thanks for the help on Alerts.
I have trouble importing .brl files from my drools-guvnor editor.
When I import it I get the following error I get the error that the file cant 
be opened.

When I create it separately in my eclipse I do not get the drop down to choose 
from my facts. It shows empty drop down.
I imported the jar files to the classpath of my project - added the classes to 
the same directory - created a .package file where I added all the import 
statements.
But still not working. Any Idea what is the problem

Thank you
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] alerts in drools

2010-06-08 Thread Fnu Mahalakshmi
Hi,

Is there anyway I can create "alerts" in drools??
If there is any documentation for it could someone point me towards it??

Thank you
-m



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


Re: [rules-users] error getting values from working memory

2010-06-08 Thread Fnu Mahalakshmi
Hi,
Please disregard my previous question.
It was a stupid bug in my code.

Thank you
M




Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] error getting values from working memory

2010-06-08 Thread Fnu Mahalakshmi
Hi,

I am facing problem in getting modified data from my working memory to my 
output file.
I have added all my data to an ArrayList. Sent it to my Rules - modified the 
input.
Now I want it to display the data contained in the objects of my list.
Unable to do that as I can only map it to ArrayList
So I am not able to call the particular functions for displaying particular 
data.
I tried adding my data to a HashMap but then data does not get 
loaded in the working memory.

Please help!!!
Thank you
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] Multiple Files Problem

2010-06-08 Thread Fnu Mahalakshmi
Hi,

I need to load data contained in many Lists as my input.
In what way is it possible for me to load multiple lists in drools?
I am doing this currently:

public void runStatelessRules(String[] rulesFiles,String 
dslFileName,Collectional,
String ruleFlowFileName) throws Exception {
  RuleBase ruleBase = loadRules(rulesFiles);
StatelessSession workingMemory = ruleBase.newStatelessSession();
workingMemory.execute(al);

}


Collectional is my input. In this I have dumped data from multiple 
arrayLists.

All rules get processed accurately.
But creates a mess when I need to write to my output file.

Is it in some way possible for me to give separate lists to load to my working 
memory???

Please help. Thanks in advance.

-M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


Re: [rules-users] Multiple Object Referencing error

2010-06-08 Thread Fnu Mahalakshmi
Hi guys,

Thanks a lot for looking into it. I just solved it. There were multiple objects 
getting created of the same type due to which rules was not getting fired. The 
error shown was very misleading :(

Thanks again
M

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
rules-users-requ...@lists.jboss.org
Sent: Tuesday, June 08, 2010 11:37 AM
To: rules-users@lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 43

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

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

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

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


Today's Topics:

   1. Re: Multiple Object referencing error (Fnu Mahalakshmi)
   2. Re: Multiple Object referencing error (Swindells, Thomas)
   3. smooks query (Fnu Mahalakshmi)
   4. Re: Drools 5.1.0.M2 - BPMN2 process issue - Eclipse plugin.
  -- The method getTextContent() is undefined for the type Node
  (Vijay K Pandey)


--

Message: 1
Date: Tue, 8 Jun 2010 10:13:15 -0400
From: Fnu Mahalakshmi 
Subject: Re: [rules-users] Multiple Object referencing error
To: "'rules-users@lists.jboss.org'" 
Message-ID:
<994758e35590274e955fa75763c5aa5002d01...@mtexmbxp01.ad.nyx.com>
Content-Type: text/plain; charset="us-ascii"

Hi,
Sorry about not posting the code. My mistake.

Classes :

public class Room {
private String name
private int number;
// getter and setter methods here
}
public classs Sprinkler {
private Room room;
private boolean on;
// getter and setter methods here
}
public class Fire {
private Room room;
// getter and setter methods here
}


I load 2 input files: 1. with data of fire and Room { f1, r1;f2, r2}

 2. with data of sprinkler and Room {"n/a",r1,"n/a",r3}



I am writing rule " if fire exists in room start sprinkler" { so if f1 and r1 
in this case: I should get s1, r1 } But since no sprinkler in r2 , That data 
should not get outputted.
I want my ouput file to look like:
NameNumber
Xyz 1

# xyz is my room name and 1 is the room number : r1(xyz,1) . But I am unable to 
delete entries.Is there anyway I can do it?

#only this should appears as the other room does not have a sprinkler.

when

Fire($room : room)

$sprinkler : Sprinkler( room == $room, modified == false )

Then

$sprinkler.setmodified(true);

modify( $sprinkler ) { setSprinkle( "s1" ) };

end


Error:
I am getting the error at a place where I am trying to write back from my 
working memory to my output file.
It is happening because the second rule to turn on the sprinkler does not work 
and as a result a null value is getting stored.
Is it possible that there can exists 2 different Room() objects with the same 
room.name ??
Because the room objects are getting stored from different files to the working 
memory ??
Do you think it better to store room objects in a separate list??
I store all information into a list and load that into the memory.
Am I going wrong here?

Please help.

Thank you.
-M
Please consider the environment before printing this email.

Visit our website at http://www.nyse.com



Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.




--

Message: 2
Date: Tue, 8 Jun 2010 15:20:54 +0100
From: "Swindells, Thomas" 
Subject: Re: [rules-users] Multiple Object referencing error
To: Rules Users List 
Message-ID:

Content-Type: text/plain; charset="us-ascii"

You've still missed out the file which actually contains the main method which 
is where the exception is being thrown from...



> -----Original Message-
> From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
> boun...@lists.jboss.org] On Behalf Of Fnu Mahalakshmi
> Sent: 08 June 2010 15:13
> To: 'rules-users@lists.jboss.org'

[rules-users] smooks query

2010-06-08 Thread Fnu Mahalakshmi
Hi,

Can anyone point me towards a good documentation as to how smooks works with 
drools?
How does smooks transform non-XML(java) data?? I could not understand this 
part???

Thank you in advance,
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


Re: [rules-users] Multiple Object referencing error

2010-06-08 Thread Fnu Mahalakshmi
Hi,
Sorry about not posting the code. My mistake.

Classes :

public class Room {
private String name
private int number;
// getter and setter methods here
}
public classs Sprinkler {
private Room room;
private boolean on;
// getter and setter methods here
}
public class Fire {
private Room room;
// getter and setter methods here
}
 

I load 2 input files: 1. with data of fire and Room { f1, r1;f2, r2}

 2. with data of sprinkler and Room {"n/a",r1,"n/a",r3}

 

I am writing rule " if fire exists in room start sprinkler" { so if f1 and r1 
in this case: I should get s1, r1 } But since no sprinkler in r2 , That data 
should not get outputted.
I want my ouput file to look like:
NameNumber
Xyz 1

# xyz is my room name and 1 is the room number : r1(xyz,1) . But I am unable to 
delete entries.Is there anyway I can do it?

#only this should appears as the other room does not have a sprinkler.

when

Fire($room : room)

$sprinkler : Sprinkler( room == $room, modified == false )

Then

$sprinkler.setmodified(true); 

modify( $sprinkler ) { setSprinkle( "s1" ) };

end


Error:
I am getting the error at a place where I am trying to write back from my 
working memory to my output file.
It is happening because the second rule to turn on the sprinkler does not work 
and as a result a null value is getting stored.
Is it possible that there can exists 2 different Room() objects with the same 
room.name ??
Because the room objects are getting stored from different files to the working 
memory ??
Do you think it better to store room objects in a separate list?? 
I store all information into a list and load that into the memory.
Am I going wrong here?

Please help.

Thank you.
-M
Please consider the environment before printing this email.

Visit our website at http://www.nyse.com



Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


Re: [rules-users] Multiple Object Referencing problem

2010-06-08 Thread Fnu Mahalakshmi

Hi Esteban,

I am getting the error at a place where I am trying to write back from my 
working memory to my output file.
It is happening because the second rule to turn on the sprinkler does not work 
and as a result a null value is getting stored.
Is it possible that there can exists 2 different Room() objects with the same 
room.name ??
Because the room objects are getting stored from different files to the working 
memory ??
Do you think it better to store room objects in a separate list??
I store all information into a list and load that into the memory.
Am I going wrong here?

Please help.

Thank you.
-M
-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
rules-users-requ...@lists.jboss.org
Sent: Tuesday, June 08, 2010 8:40 AM
To: rules-users@lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 36

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

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

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

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


Today's Topics:

   1. Re: Multiple Object Referencing problem (Esteban Aliverti)
   2. Re: Exception using persistence (alan.gai...@tessella.com)


--

Message: 1
Date: Tue, 8 Jun 2010 09:25:47 -0300
From: Esteban Aliverti 
Subject: Re: [rules-users] Multiple Object Referencing problem
To: Rules Users List 
Message-ID:

Content-Type: text/plain; charset="windows-1252"

Look at the line 58 of RulesTest class and you will find the problem. Try to
always analyse the stacktrace if there are no drools classes involved, then
it is not a Drools error. And remember, the debugger is your friend ;)

Best,

2010/6/7 David Sinclair 

> This has nothing to do with Drools. It looks like you are giving Writer bad
> input perhaps??
>
> Exception in thread "main" *java.lang.NullPointerException*
>
>   at java.io.Writer.write(Unknown Source)
>
>   at com.org.RulesTest.main(*RulesTest.java:58*)
>
>
>
>
> 2010/6/7 Fnu Mahalakshmi 
>
>>  Hi,
>>
>>
>>
>> I am trying out this example from the book :
>>
>> public class Room {
>>
>> private String name
>>
>> // getter and setter methods here
>>
>> }
>>
>> public classs Sprinkler {
>>
>> private Room room;
>>
>> private boolean on;
>>
>> // getter and setter methods here
>>
>> }
>>
>> public class Fire {
>>
>> private Room room;
>>
>> // getter and setter methods here
>>
>> }
>>
>>
>>
>> I load 2 input files: 1. with data of fire and Room { f1, r1;f2, r2}
>>
>>2. with data of sprinkler and Room { ? ?, r1; ?
>> ? , r2}
>>
>>
>>
>> I am writing rule ? if fire exists in room start sprinkler? { so if f1 and
>> r1 in this case: I should get s1, r1 }
>>
>> when
>>
>> Fire($room : room)
>>
>> $sprinkler : Sprinkler( room == $room, modified == false )
>>
>> Then
>>
>> $sprinkler.setmodified(true);
>>
>> modify( $sprinkler ) { setSprinkle( ?s1? ) };
>>
>> end
>>
>>
>>
>> But this gives me error:
>>
>> Exception in thread "main" *java.lang.NullPointerException*
>>
>>   at java.io.Writer.write(Unknown Source)
>>
>>   at com.org.RulesTest.main(*RulesTest.java:58*)
>>
>>
>>
>> From what I observed this rule is not getting fired at all.
>>
>> I want this rule to be fired on the data in my second input file.
>>
>> The rules for my first input file get executed properly.
>>
>>
>>
>> Can any1 tell me where I am going wrong??
>>
>> Is there any way in which we can use the modified data { after rules are
>> fired on the first input data and it is  modified}to fire another set of
>> rules on the same input depending on the next input file???
>>
>>
>>
>> Thank you.
>>
>>
>>
>> -M
>>
>> --
>>
>> *Please consider the environment before printing this email.*
>>
>> *Visit our website at http://www.nyse.com
>> ***

Re: [rules-users] Multiple Object Referencing error

2010-06-07 Thread Fnu Mahalakshmi
Hi David,

I am giving it the input exactly as I put up. It seems to be fine.
Could it be because there are new objects of room formed even though the 
attributes they hold are similar???

Thank you
M
-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
rules-users-requ...@lists.jboss.org
Sent: Monday, June 07, 2010 5:12 PM
To: rules-users@lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 31

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

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

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

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


Today's Topics:

   1. Re: Exception using persistence (Robert)
   2. Multiple Object Referencing problem (Fnu Mahalakshmi)
   3. Re: Multiple Object Referencing problem (David Sinclair)


--

Message: 1
Date: Mon, 07 Jun 2010 20:49:45 +0200
From: Robert 
Subject: Re: [rules-users] Exception using persistence
To: "Rules Users List" , "Mark Proctor"
, "PAYET, Manuel" 
Message-ID: 
Content-Type: text/plain; charset=iso-8859-15; format=flowed;
delsp=yes

For additional information:

JPAKnowledgeService.newStatefulKnowledgeSession uses

org.drools.persistence.session.SingleSessionCommandService

where "java:comp/UserTransaction" is used (I checked the drools source
code). Looks like there is no way to change this.

I just wonder that I am the only one having this problem.

As I said "comp/UserTransaction" works, but "java:comp/UserTransaction"
doesn't, but in the docs "java:comp/UserTransaction" is used !?!?!?

Cheers, Rob.

Am 07.06.2010, 16:22 Uhr, schrieb PAYET, Manuel
:

> It's probably that your transaction manager, for an odd reason, doesn't
> bind with the good name;
> You can do the following workaround:
>
> Final InitialContext initContext = new InitialContext();
> initContext.bind("java:comp/UserTransaction",initContext.lookup("comp/UserTransaction"));
>
> And voila, those two jndi name should point to the same object.
>
> I stress the fact that what I've written hasn't been tested.
>
> -Message d'origine-
> De : rules-users-boun...@lists.jboss.org
> [mailto:rules-users-boun...@lists.jboss.org] De la part de Robert
> Envoy? : lundi 7 juin 2010 16:16
> ? : rules-users@lists.jboss.org; Mark Proctor
> Objet : Re: [rules-users] Exception using persistence
>
> Hi,
>
> still struggling with this one (see below),
>
> but I did a slide change in the test-code
>
>  try {
>val env = new java.util.Hashtable[String, String]
>env.put(Context.INITIAL_CONTEXT_FACTORY,
> "bitronix.tm.jndi.BitronixInitialContextFactory")
>val ctx = new InitialContext(env)
>val ut1 : UserTransaction = (ctx.lookup(
> "java:comp/UserTransaction")).asInstanceOf[UserTransaction]
>  } catch {
>case ex: Exception => ex.printStackTrace()
>  }
>
> (Sorry, code is in Scala, but should not be a problem to read it).
>
> Instead of "java:comp/UserTransaction" (as written in the docs) I wrote
> "comp/UserTransaction" and it works.
>
> But since this is some test-code and I am able to do the look-up as I
> want ("comp/UserTransaction"), as soon as I use
>
>
> JPAKnowledgeService.newStatefulKnowledgeSession( kbase, null, env )
>
>
> I have no influence anymore (its drools-code ;-) and it looks like its
> using internally "java:comp/UserTransaction".
>
>
> Is there any way to change this (setting it) ?
>
> Cheers, Rob
>
>
>
> Am 01.06.2010, 23:54 Uhr, schrieb Robert :
>
>> Well, I tried this but it does not work.
>>
>> Checking additionally the BitronixInitialContextFactory API where it
>> says:
>>
>> -
>> "Implementation of InitialContextFactory that allows lookup of
>> transaction manager and registered resources.
>>
>> The easiest way to use this provider is to create a jndi.properties
>> file in your classpath with this content:
>> java.naming.factory.initial=bitronix.tm.jndi.BitronixInitialContextFac
>> tory Alternatively, you can create a InitialContext object with an
>> environment pointing to this class:
>> 

[rules-users] Multiple Object Referencing problem

2010-06-07 Thread Fnu Mahalakshmi
Hi,

I am trying out this example from the book :

public class Room {

private String name

// getter and setter methods here

}

public classs Sprinkler {

private Room room;

private boolean on;

// getter and setter methods here

}

public class Fire {

private Room room;

// getter and setter methods here

}

I load 2 input files: 1. with data of fire and Room { f1, r1;f2, r2}
   2. with data of sprinkler and Room { " ", r1; " " , 
r2}

I am writing rule " if fire exists in room start sprinkler" { so if f1 and r1 
in this case: I should get s1, r1 }
when
Fire($room : room)
$sprinkler : Sprinkler( room == $room, modified == false )
Then
$sprinkler.setmodified(true);
modify( $sprinkler ) { setSprinkle( "s1" ) };
end

But this gives me error:
Exception in thread "main" java.lang.NullPointerException
  at java.io.Writer.write(Unknown Source)
  at com.org.RulesTest.main(RulesTest.java:58)

>From what I observed this rule is not getting fired at all.
I want this rule to be fired on the data in my second input file.
The rules for my first input file get executed properly.

Can any1 tell me where I am going wrong??
Is there any way in which we can use the modified data { after rules are fired 
on the first input data and it is  modified}to fire another set of rules on the 
same input depending on the next input file???

Thank you.

-M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


Re: [rules-users] Error Loading Input Files

2010-06-07 Thread Fnu Mahalakshmi

Hi Greg,

It was my mistake and a very basic java question. But you need not be rude for 
that.

-M
-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
rules-users-requ...@lists.jboss.org
Sent: Monday, June 07, 2010 10:44 AM
To: rules-users@lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 28

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

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

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

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


Today's Topics:

   1. Re: Error Loading Input Files. (Fnu Mahalakshmi)
   2. Re: Exception using persistence (Robert)
   3. Re: Exception using persistence (PAYET, Manuel)
   4. Re: Error Loading Input Files. (Greg Barton)


--

Message: 1
Date: Mon, 7 Jun 2010 10:01:23 -0400
From: Fnu Mahalakshmi 
Subject: Re: [rules-users] Error Loading Input Files.
To: "'rules-users@lists.jboss.org'" 
Message-ID:
<994758e35590274e955fa75763c5aa5002d01...@mtexmbxp01.ad.nyx.com>
Content-Type: text/plain; charset="us-ascii"

Hi Thomas,

Thanks a lot for the help.
I am also facing problem in uploading my modified working memory back to my 
output file.
Once the rules are fired and the data in my working memory is modified how do I 
reupload it to my text file?
I store all my data in a vector which loads it to the working memory.
Could you point me towards some documentation which explains it?

Thanks so much.
M

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
rules-users-requ...@lists.jboss.org
Sent: Monday, June 07, 2010 9:53 AM
To: rules-users@lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 26

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

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

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

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


Today's Topics:

   1. Re: Error Loading Multiple Input Files (Fnu Mahalakshmi)
   2. Re: Error Loading Multiple Input Files (Swindells, Thomas)


----------

Message: 1
Date: Mon, 7 Jun 2010 09:41:39 -0400
From: Fnu Mahalakshmi 
Subject: Re: [rules-users] Error Loading Multiple Input Files
To: "'rules-users@lists.jboss.org'" 
Message-ID:
<994758e35590274e955fa75763c5aa5002d01...@mtexmbxp01.ad.nyx.com>
Content-Type: text/plain; charset="us-ascii"

Hi Greg,

I have my input files inside the src directory of my eclipse project.

I am passing the files as follows:
private static final String DATA_INPUT_FILE = new String []{ "Input1.txt", 
"Input2.txt"};

private static final String DATA_OUTPUT_FILE = "Output.1.txt";

private static final String RULES_FILES = new String [] {"Rule1.drl", 
"Rules2.drl"};

public static void main(String[] args) throws Exception {
BufferedReader input =  new BufferedReader(new FileReader(DATA_INPUT_FILE));
   Converter c = new Converter(DATA_INPUT_FILE); // this reads my input 
files
  Vector v  = new Vector();
  v = c.getFactInput(); // loads all information 
contained in the input files

  new RuleRunner().runStatelessRules(RULES_FILES,null, v,null); 
  FileOutputStream output = new 
FileOutputStream(DATA_OUTPUT_FILE);


Error Log:

Exception in thread "main" java.io.FileNotFoundException: Input1.txt (The 
system cannot find the file specified)
  at java.io.FileInputStream.open(Native Method)
  at java.io.FileInputStream.(Unknown Source)
  at java.io.FileInputStream.(Unknown Source)
  at java.io.FileReader.(Unknown Source)
  at com.org.RulesTest.main(RulesTest.java:29)


Can you tell me why that happens??
The file is present.
Thanks.
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it 

Re: [rules-users] Error Loading Input Files.

2010-06-07 Thread Fnu Mahalakshmi
Hi Thomas,

Thanks a lot for the help.
I am also facing problem in uploading my modified working memory back to my 
output file.
Once the rules are fired and the data in my working memory is modified how do I 
reupload it to my text file?
I store all my data in a vector which loads it to the working memory.
Could you point me towards some documentation which explains it?

Thanks so much.
M

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
rules-users-requ...@lists.jboss.org
Sent: Monday, June 07, 2010 9:53 AM
To: rules-users@lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 26

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

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

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

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


Today's Topics:

   1. Re: Error Loading Multiple Input Files (Fnu Mahalakshmi)
   2. Re: Error Loading Multiple Input Files (Swindells, Thomas)


--

Message: 1
Date: Mon, 7 Jun 2010 09:41:39 -0400
From: Fnu Mahalakshmi 
Subject: Re: [rules-users] Error Loading Multiple Input Files
To: "'rules-users@lists.jboss.org'" 
Message-ID:
<994758e35590274e955fa75763c5aa5002d01...@mtexmbxp01.ad.nyx.com>
Content-Type: text/plain; charset="us-ascii"

Hi Greg,

I have my input files inside the src directory of my eclipse project.

I am passing the files as follows:
private static final String DATA_INPUT_FILE = new String []{ "Input1.txt", 
"Input2.txt"};

private static final String DATA_OUTPUT_FILE = "Output.1.txt";

private static final String RULES_FILES = new String [] {"Rule1.drl", 
"Rules2.drl"};

public static void main(String[] args) throws Exception {
BufferedReader input =  new BufferedReader(new FileReader(DATA_INPUT_FILE));
   Converter c = new Converter(DATA_INPUT_FILE); // this reads my input 
files
  Vector v  = new Vector();
  v = c.getFactInput(); // loads all information 
contained in the input files

  new RuleRunner().runStatelessRules(RULES_FILES,null, v,null); 
  FileOutputStream output = new 
FileOutputStream(DATA_OUTPUT_FILE);


Error Log:

Exception in thread "main" java.io.FileNotFoundException: Input1.txt (The 
system cannot find the file specified)
  at java.io.FileInputStream.open(Native Method)
  at java.io.FileInputStream.(Unknown Source)
  at java.io.FileInputStream.(Unknown Source)
  at java.io.FileReader.(Unknown Source)
  at com.org.RulesTest.main(RulesTest.java:29)


Can you tell me why that happens??
The file is present.
Thanks.
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


-- next part --
An HTML attachment was scrubbed...
URL: 
http://lists.jboss.org/pipermail/rules-users/attachments/20100607/cb3ee90b/attachment-0001.html
 

--

Message: 2
Date: Mon, 7 Jun 2010 14:51:54 +0100
From: "Swindells, Thomas" 
Subject: Re: [rules-users] Error Loading Multiple Input Files
To: Rules Users List 
Message-ID:

Content-Type: text/plain; charset="us-ascii"

This isn't really a Drools question just a basic java programming question.
You are trying to read your input files from the current working directory 
(which defaults to the root of your project in eclipse).
What you probably want to be doing is reading your files from the classpath 
instead.  Using ResourceFactory.newClassPathResource is the way I normally go 
about reading my files but you can do it with the standard class loader methods 
as well.

Thomas

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behal

Re: [rules-users] Error Loading Multiple Input Files

2010-06-07 Thread Fnu Mahalakshmi
Hi Greg,

I have my input files inside the src directory of my eclipse project.

I am passing the files as follows:
private static final String DATA_INPUT_FILE = new String []{ "Input1.txt", 
"Input2.txt"};

private static final String DATA_OUTPUT_FILE = "Output.1.txt";

private static final String RULES_FILES = new String [] {"Rule1.drl", 
"Rules2.drl"};

public static void main(String[] args) throws Exception {
BufferedReader input =  new BufferedReader(new FileReader(DATA_INPUT_FILE));
   Converter c = new Converter(DATA_INPUT_FILE); // this reads my input 
files
  Vector v  = new Vector();
  v = c.getFactInput(); // loads all information 
contained in the input files

  new RuleRunner().runStatelessRules(RULES_FILES,null, v,null); 
  FileOutputStream output = new 
FileOutputStream(DATA_OUTPUT_FILE);


Error Log:

Exception in thread "main" java.io.FileNotFoundException: Input1.txt (The 
system cannot find the file specified)
  at java.io.FileInputStream.open(Native Method)
  at java.io.FileInputStream.(Unknown Source)
  at java.io.FileInputStream.(Unknown Source)
  at java.io.FileReader.(Unknown Source)
  at com.org.RulesTest.main(RulesTest.java:29)


Can you tell me why that happens??
The file is present.
Thanks.
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] -Uploading modified output file

2010-06-04 Thread Fnu Mahalakshmi
Hi,

I have data from a text file (consists of 2 columns : A and B with data 
respectively)which is read and stored into a Vector .
I have multiple input files with 2 columns of data so used Vector.
This collection of data is loaded to my rule runner which loads data in the 
rulebase and  fires rules on that data.


 1.  how do I upload the modified data output into another text file? Should I 
reload it in a vector?
But whenever rule is fired and data is modified how can I store the modified 
data in another file? Because my input and output has different columns.


 1.  is using a vector a bad way?? Could I do it in any other better way?
 2.  how can I identify what my A and B columns are- to load the specific rule 
only?? As of now I am just reading its name and storing it.
Could I do it in a better way???

Please help!!
Thankyou.
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


Re: [rules-users] Object referencing error

2010-06-04 Thread Fnu Mahalakshmi
erti 
Subject: Re: [rules-users] Object Referencing Error
To: Rules Users List 
Message-ID:

Content-Type: text/plain; charset="windows-1252"

True, I forgot about the objectB field restriction.

2010/6/4 Swindells, Thomas 

>  In fact in your case you when condition doesn?t make any sense ? B will
> never equal the empty string as B isn?t a string.
>
> You probable want the following:
>
> rule ?foo?
>
> when
>$a :A(Type == "Prod" , objectB == null)
>
> then
>B bobject = new B();
>
>bobject.setType(?Prod?);
>
>bobject.setId($a.getNumber().getId());
>
>modify($a) {
>
>   setObjectB(bobject);
>
> };
>
> end
>
>
>
> This rule only executes when objectB  is null, this means you won?t get
> into the loop as once you have created objectB  the rule won?t evaluate to
> true again.
>
>
>
> Thomas
>
>
>
>   *From:* rules-users-boun...@lists.jboss.org [mailto:
> rules-users-boun...@lists.jboss.org] *On Behalf Of *Esteban Aliverti
> *Sent:* 03 June 2010 23:43
> *To:* Rules Users List
> *Subject:* Re: [rules-users] Object Referencing Error
>
>
>
> Yes, your rule entered in an infinite loop because when every time you
> insert/modify/retract a Fact, rules are reevaluated to check if the
> insertion/modification/retraction generates activations or not. In your
> case, your rule is being reevaluated every time you update your $a object,
> the evaluation ends firing the rule, and this starts an endless loop.
>
> If you only have this behavior with this rule, you can consider using the
> "no-loop" attribute. If your problem is multiple rules being re executed
> (and you don't wont that) you can use "lock-on-active" attribute. Try to
> read the documentation about these attributes for further information.
>
> It is very important for the people new in drools to understand the life
> cycle of a rule.
>
>
>
> Best,
>
> On Thu, Jun 3, 2010 at 7:33 PM, Fnu Mahalakshmi 
> wrote:
>
> Hi,
>
> I tried what you said but program goes into an infinite loop.
> It does not break out of the when loop only.
> I did exactly as you mentioned.
> In the test information I put in a.type = "Prod"
> And a.bObject(new B());
> Any idea whats wrong??
>
> Thanks,
> M
>
> -Original Message-
> From: rules-users-boun...@lists.jboss.org [mailto:
> rules-users-boun...@lists.jboss.org] On Behalf Of
> rules-users-requ...@lists.jboss.org
> Sent: Thursday, June 03, 2010 4:52 PM
> To: rules-users@lists.jboss.org
> Subject: rules-users Digest, Vol 43, Issue 15
>
> Send rules-users mailing list submissions to
>rules-users@lists.jboss.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>https://lists.jboss.org/mailman/listinfo/rules-users
> or, via email, send a message with subject or body 'help' to
>rules-users-requ...@lists.jboss.org
>
> You can reach the person managing the list at
>rules-users-ow...@lists.jboss.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of rules-users digest..."
>
>
> Today's Topics:
>
>   1. Re: Object Referencing error: (Esteban Aliverti)
>
>
> --
>
> Message: 1
> Date: Thu, 3 Jun 2010 17:51:10 -0300
> From: Esteban Aliverti 
> Subject: Re: [rules-users] Object Referencing error:
> To: Rules Users List 
> Message-ID:
>
> Content-Type: text/plain; charset="iso-8859-1"
>
> You can't modify bobject, becuase it doesn't exist inside the session. You
> just created it a few lines above. Maybe you need an insert() or maybe you
> need the bobject reference from the LHS. Something like this:
>
> *rule* "prod"
>
>
>
>  *when*
>
> $a :A(Type == "Prod" , objectB != "")
>
>  *then*
>
>   B bobject = *new* B();
>
> $a.getObjectB().setType( "Prod" );
>
> $a.getObjectB().setId($a.getNumber().getId());
>
> *update*($a);
>
> *  end*
>
> Note that you need to update $a and not B, because A is the inserted Fact
> in
> your session.
>
> Best,
>
>
> 2010/6/3 Fnu Mahalakshmi 
>
> >  Hi,
> >
> >
> >
> > I am getting the following error when I try to do complex object
> > referencing in drools:
> >
> > My class:
> >
> > A{
> >
> > String Type;
> >
> > B objectb;
> >
> > //getters and setters for above
&

[rules-users] -Doubt using HSSFWorkbook and multiple inputs

2010-06-04 Thread Fnu Mahalakshmi
Hi,

I have a real basic question about the working of drools.
I figured it to be this way:
We load our input data (our facts) - fire the rules on this data - get the 
modified out put in our output file.
Doubt:
I am reading all my input data from a text file.
1. How can I load all the data contained in my text file into the memory at the 
same time? Like we used HSSF workbook concept for the excel file?
And fire all the rules at the data at once.?
2. Again When I have multiple input files, Shouldn't I be loading all the input 
files in the memory and firing rules on them? How can I do that? I should have 
different test files for different input datasets?? (for example like the 
ExcelDataRulesTest.java file in the example)

I am still stuck with the procedural way of thinking- read lines and run rules 
and generate output.

Please help!!! I am really new to this and going round and round.

Thank you.
M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


Re: [rules-users] Object Referencing Error

2010-06-03 Thread Fnu Mahalakshmi
Hi,

I tried what you said but program goes into an infinite loop.
It does not break out of the when loop only.
I did exactly as you mentioned.
In the test information I put in a.type = "Prod"
And a.bObject(new B());
Any idea whats wrong??

Thanks,
M

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
rules-users-requ...@lists.jboss.org
Sent: Thursday, June 03, 2010 4:52 PM
To: rules-users@lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 15

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

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

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

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


Today's Topics:

   1. Re: Object Referencing error: (Esteban Aliverti)


--

Message: 1
Date: Thu, 3 Jun 2010 17:51:10 -0300
From: Esteban Aliverti 
Subject: Re: [rules-users] Object Referencing error:
To: Rules Users List 
Message-ID:

Content-Type: text/plain; charset="iso-8859-1"

You can't modify bobject, becuase it doesn't exist inside the session. You
just created it a few lines above. Maybe you need an insert() or maybe you
need the bobject reference from the LHS. Something like this:

*rule* "prod"



  *when*

 $a :A(Type == "Prod" , objectB != "")

  *then*

   B bobject = *new* B();

 $a.getObjectB().setType( "Prod" );

 $a.getObjectB().setId($a.getNumber().getId());

 *update*($a);

*  end*

Note that you need to update $a and not B, because A is the inserted Fact in
your session.

Best,


2010/6/3 Fnu Mahalakshmi 

>  Hi,
>
>
>
> I am getting the following error when I try to do complex object
> referencing in drools:
>
> My class:
>
> A{
>
> String Type;
>
> B objectb;
>
> //getters and setters for above
>
> }
>
>
>
> My rules:
>
>
>
> *rule* "prod"
>
>
>
>   *when*
>
>  $a :A(Type == "Prod" , objectB != "")
>
>   *then*
>
> B bobject = *new* B();
>
>  bobject.setType( "Prod" );
>
>  bobject.setId($a.getNumber().getId());
>
>  *update*(bobject);
>
>
>
> *end*
>
> * *
>
> *I want to basically output a file which has updated values of B (type,
> Id)
>
> *
>
> * *
>
> *Error:*
>
> *org.drools.spi.ConsequenceException*: *org.drools.FactException*: Update
> error: handle not found for object: com.org...@f42ad0. Is it in the
> working memory?
>
>   at
> org.drools.base.DefaultConsequenceExceptionHandler.handleException(*
> DefaultConsequenceExceptionHandler.java:13*)
>
>   at org.drools.common.DefaultAgenda.fireActivation(*
> DefaultAgenda.java:558*)
>
>   at org.drools.common.DefaultAgenda.fireNextItem(*
> DefaultAgenda.java:518*)
>
>   at org.drools.common.AbstractWorkingMemory.fireAllRules(*
> AbstractWorkingMemory.java:475*)
>
>   at org.drools.common.AbstractWorkingMemory.fireAllRules(*
> AbstractWorkingMemory.java:439*)
>
>   at com.org.DroolsTest.main(*DroolsTest.java:30*)
>
> Caused by: *org.drools.FactException*: Update error: handle not found for
> object: com.org...@f42ad0. Is it in the working memory?
>
>   at org.drools.base.DefaultKnowledgeHelper.update(*
> DefaultKnowledgeHelper.java:100*)
>
>   at com.org.Rule_Prod_Ip_0.consequence(*Rule_Prod_Ip_0.java:10*)
>
>   at com.org.Rule_Prod_Ip_0ConsequenceInvoker.evaluate(*
> Rule_Prod_Ip_0ConsequenceInvoker.java:22*)
>
>   at org.drools.common.DefaultAgenda.fireActivation(*
> DefaultAgenda.java:554*)
>
>   ... 4 more
>
>
>
> Please help! I am very new to drools! Not able to figure out why this
> error:
>
>
>
> I am using eclipse and working on Windows machine. Error above was
> generated on eclipse console.
>
>
>
> Thank you.
>
>
>
> M
>
> --
>
> *Please consider the environment before printing this email.*
>
> *Visit our website at http://www.nyse.com
> *
>
> Note: The information contained in this message and any attachment to it is
> privileged, confidential and protected from disclosure. If the reader of
> this message is

[rules-users] Object Referencing error:

2010-06-03 Thread Fnu Mahalakshmi
Hi,

I am getting the following error when I try to do complex object referencing in 
drools:
My class:
A{
String Type;
B objectb;
//getters and setters for above
}

My rules:

rule "prod"

  when
 $a :A(Type == "Prod" , objectB != "")
  then
B bobject = new B();
 bobject.setType( "Prod" );
 bobject.setId($a.getNumber().getId());
 update(bobject);

end

I want to basically output a file which has updated values of B (type, Id)


Error:
org.drools.spi.ConsequenceException: org.drools.FactException: Update error: 
handle not found for object: com.org...@f42ad0. Is it in the working memory?
  at 
org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:13)
  at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:558)
  at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:518)
  at 
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:475)
  at 
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:439)
  at com.org.DroolsTest.main(DroolsTest.java:30)
Caused by: org.drools.FactException: Update error: handle not found for object: 
com.org...@f42ad0. Is it in the working memory?
  at 
org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:100)
  at com.org.Rule_Prod_Ip_0.consequence(Rule_Prod_Ip_0.java:10)
  at 
com.org.Rule_Prod_Ip_0ConsequenceInvoker.evaluate(Rule_Prod_Ip_0ConsequenceInvoker.java:22)
  at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
  ... 4 more

Please help! I am very new to drools! Not able to figure out why this error:

I am using eclipse and working on Windows machine. Error above was generated on 
eclipse console.

Thank you.

M



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] Error reading brl files in eclipse

2010-06-03 Thread Fnu Mahalakshmi
Hi,

I know this is repeated again but I tried the solution mentioned in the 
previous posts and it doesn't work.
When I created a guided rule in eclipse, I get blank dropdowns when choosing 
the facts.
I added the jar file for the classes as an external reference
I also added a .package file to the directory where my rules are located. The 
package file contains import statements of the classes.
I also added the required classes in the same directory.
But nothing seems to work.
If I import my .brl rule from the guvnor repository I am unable to open it. 
Gives me an error.
I tried reading it in a text editor and shows me the correct xml format.

Please help!!!

Thank you.




Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


Re: [rules-users] rules-users Digest, Vol 43, Issue 7

2010-06-02 Thread Fnu Mahalakshmi
Hi,

Thanks a lot. I will try it out.
I had one more doubt. Is it anyway possible to pass the data I want to test my 
rules against in the guvnor editor itself??
I am using a text document as the input data set.

Thanks a ton!

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of 
rules-users-requ...@lists.jboss.org
Sent: Wednesday, June 02, 2010 12:00 PM
To: rules-users@lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 7

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

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

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

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


Today's Topics:

   1. Re: Doubt of object referencing in creating rules
  (Esteban Aliverti)


--

Message: 1
Date: Wed, 2 Jun 2010 11:59:35 -0300
From: Esteban Aliverti 
Subject: Re: [rules-users] Doubt of object referencing in creating
rules
To: Rules Users List 
Message-ID:

Content-Type: text/plain; charset="iso-8859-1"

You could do something like this:

   rule "something"
   when
  $c: Customer (name = "XX")
   then
  $c.getSales().setType("A");
  $c.getSales().setId(1);
   end

Did you read this?:
http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-expert/html_single/index.html

<http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-expert/html_single/index.html>
Best,

On Tue, Jun 1, 2010 at 11:37 AM, Fnu Mahalakshmi wrote:

> Hi,
>
> Can anyone tell me how I could deal with complex object referencing while
> creating rules?
> I have:
> Class Customer{
> String name;
> Sale sales;
> ..
> }
>
> When I create my rules:
> When customer.name = XXX
> Then sales.type = A
>sales.id = 1
>
>
> Above is what I want to do.
> I have 2 classes: Customer and sales.
> How could I effectively depict my rules to do the above??
>
> Please help.
>
> Thank you.
>
> Please consider the environment before printing this email.
>
> Visit our website at http://www.nyse.com
>
> 
>
> Note:  The information contained in this message and any attachment to it
> is privileged, confidential and protected from disclosure.  If the reader of
> this message is not the intended recipient, or an employee or agent
> responsible for delivering this message to the intended recipient, you are
> hereby notified that any dissemination, distribution or copying of this
> communication is strictly prohibited.  If you have received this
> communication in error, please notify the sender immediately by replying to
> the message, and please delete it from your system.  Thank you.  NYSE
> Euronext.
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 


Esteban Aliverti
-- next part --
An HTML attachment was scrubbed...
URL: 
http://lists.jboss.org/pipermail/rules-users/attachments/20100602/0bcf81fd/attachment-0001.html
 

--

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


End of rules-users Digest, Vol 43, Issue 7
**
Please consider the environment before printing this email.

Visit our website at http://www.nyse.com



Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] reading brl files in eclipse

2010-06-01 Thread Fnu Mahalakshmi
Hi,

How can we read .brl files in eclipse (when I import a business rule to 
eclipse)?
How can I create a guided rule in eclipse? I am unable to use the facts in my 
project like it appears with the guvnor editor?
Please help ..

Thank you.



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] Problem with poi.apache.usermodel.hssf file

2010-06-01 Thread Fnu Mahalakshmi
Hi,

I tried downloading the apache poi 3.6 files from the apache site but I could 
not find any .jar files which I could add.
I got all java files for hssf and I added it to my eclipse project as external 
reference>add external class folder.
But still it is not recognized and I get error when I try to do this:
import org.apache.poi.hssf.usermodel.HSSFCell;

I do not understand what to download or add to make it work?
Can someone please help!!
Thank you in advance.

Mahalakshmi



Please consider the environment before printing 
this email.
Visit our website at http://www.nyse.com";>http://www.nyse.com 

*

Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] Problem uploading project in eclipse

2010-06-01 Thread Fnu Mahalakshmi

Hi,

I have created my rules and test scenarios as per the drools tutorial & guide.
But I am having trouble uploading that project into my Eclipse IDE.
I just selected upload from Guvnor Repository and I can then only select 
certain files.
Again the .brl files do not open in eclipse.
how I can test my sample dataset (contained in an excel file) in the drools 
guvnor itself without uploading the whole project in eclipse?
Or do I need to write all the rules from a scratch in eclipse again for it to 
work? Then whats the whole point of using the guvnor guided editor??
Please help me out. Am new to drools.

Thank you. 
Please consider the environment before printing this email.

Visit our website at http://www.nyse.com



Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] Doubt of object referencing in creating rules

2010-06-01 Thread Fnu Mahalakshmi
Hi,

Can anyone tell me how I could deal with complex object referencing while 
creating rules?
I have:
Class Customer{
String name;
Sale sales;
..
}

When I create my rules:
When customer.name = XXX
Then sales.type = A
sales.id = 1

 
Above is what I want to do.
I have 2 classes: Customer and sales.
How could I effectively depict my rules to do the above??

Please help. 

Thank you.

Please consider the environment before printing this email.

Visit our website at http://www.nyse.com



Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


[rules-users] Problem uploading project in eclipse

2010-06-01 Thread Fnu Mahalakshmi
Hi,

I have created my rules and test scenarios as per the drools tutorial & guide.
But I am having trouble uploading that project into my Eclipse IDE.
I just selected upload from Guvnor Repository and I can then only select 
certain files.
Again the .brl files do not open in eclipse.
how I can test my sample dataset (contained in an excel file) in the drools 
guvnor itself without uploading the whole project in eclipse?
Or do I need to write all the rules from a scratch in eclipse again for it to 
work? Then whats the whole point of using the guvnor guided editor??
Please help me out. Am new to drools.

Thank you. 
Please consider the environment before printing this email.

Visit our website at http://www.nyse.com



Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.


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


Re: [rules-users] error running Test Scenarios

2010-05-28 Thread Fnu Mahalakshmi
Hi,
My Ovo does have a default constructor and all the other constructor and 
methods are public.
I have uploaded the jar file and then clicked on: Save & Validate and also 
'Build Package'.
I have 2 packages with classes in my .jar file. Could that be a problem in any 
way??
When I try to run 'RunAll Test Scenarios' the tests run but the rules do not 
run and I get the same constructor not found error!
Any idea? Please help.
Could it have anything to do with the path set for the environment variables of 
Java or MVN?? I set is as per the tutorial online.

Thanks
Jillika


Today's Topics:

   1. Re: error running test scenarios (Esteban Aliverti)


--

Message: 1
Date: Fri, 28 May 2010 18:11:34 -0300
From: Esteban Aliverti 
Subject: Re: [rules-users] error running test scenarios
To: Rules Users List 
Message-ID:

Content-Type: text/plain; charset="iso-8859-1"

Can you double check that you have a public non-args constructor in Ovo
class? Did you update your jar model and recompile the package in guvnor?

Best,

2010/5/28 Fnu Mahalakshmi 

>
>
>
>  ------
>
> *From:* Fnu Mahalakshmi
> *Sent:* Friday, May 28, 2010 3:43 PM
> *To:* 'rules-users-requ...@lists.jboss.org'
> *Subject:* error running test scenarios
>
>
>
>
>
> Hi,
>
>
>
>
>
> I am working on a drools application and I am getting the following error:
>
>
>
>  I import java files to my application and then create the rules + test
> scenarios to run them.
>
> Attaching a jar file of the java classes.
>
>
>
> My Test Case:
>
>
>
> Run scenario
>
>
>
>  GIVEN
>
>
>
> insert [Ovo]
>
>
>
> [TestOvoUseType]
>
> ipAddress:
>
>
>
>   useType:
>
>
>
>
>
>
>
>  EXPECT
>
>Use real date and time  Use a simulated date and time
>
>
>
>
>
>
>
>
>
> Expect rules
>
>
>
> Production Ips:
>
>  fired at least once  did not fire fired this many times: Choose...
>
>
>
>
>
> More...
>
>
>
>
>
> (configuration)
>
>  Allow these rules to fire:  Prevent these rules from firing: All rules
> may fire
>
>
>
>
>
>  (globals)
>
>
>
>
>
>  Test for checking Production Ips
>
>Title: [*ProdIp Test*]
>
> [show more info...]
>
>
>
>
>
> Rules case:
>
>
>
>
>
> WHEN
>
>
>
>
>
> Ovo
>
>   useType
>
>   --- please choose ---  is equal to is not equal to matches sounds like
>
>
>
>
>
>
>
>
>
>
>
> THEN
>
>
>
>
>
>
>
> Insert *Ip*
>
>  type
>
>
>
>
>
> (options)
>
>
>
>
>
>
>
>
>
>  * *
>
> *View source*
>
> * *
>
>
>
> * *
>
> *Validate*
>
> * *
>
>Ips in Ovo are Production Ips
>
>Title: [*Production Ips*]
>
> [show more info...]
>
>
>
> Error stack:
>
>
>
> 15:36:25,517 INFO  [STDOUT] ERROR 28-05 15:36:25,507
> (ServiceImplementation.java:runScenario:1942)   [Error: unable to find
> constructor for:
> org.servers.Ovo]
> [Near : {... new org.servers.Ovo( }]
> ^
> [Line: 1, Column:
> 0]
>
>
>
>
>
> I have defined the constructor in the Ovo class and Ip class respectively.
>
>
>
> Please let me know if you can throw some light on this.
>
>
>
> Thanks,
>
>
>
> Jillika
>
> --
>
> *Please consider the environment before printing this email.*
>
> *Visit our website at http://www.nyse.com
> *
>
> Note: The information contained in this message and any attachment to it is
> privileged, confidential and protected from disclosure. If the reader of
> this message is not the intended recipient, or an employee or agent
> responsible for delivering this message to the intended recipient, you are
> hereby notified that any dissemination, distribution or copying of this
> communication is strictly prohibited. If you have received this
> communication in error, please notify the sender immediately by replying to
> the message, and please delete it from your system. Thank you. NYSE
> Euronext. *
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 


Esteban Aliverti