Re: [rules-users] result of one rule to another rule
by Greg Barton
Yes. When you modify an existing working memory object or insert a new one the resulting objects can be matched by another rule. This in effect "passes" the data to the next rule, but it's not direct like a procedure call.
GreG
On Jun 17, 2010, at 11:03 PM, surabhi soni <surabhi.soni.4(a)gmail.com> wrote:
hiiii
can we pass result of one rule to another rule as input
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
14 years, 5 months
Loading .brl files
by 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
</pre>
<P><hr size=1></P>
<P><STRONG><font color=green>Please consider the environment before printing this email.</font></STRONG></P>
<P><STRONG>Visit our website at <a href="http://www.nyse.com">http://www.nyse.com</a> <br>
*****************************************************************************
<br>
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.
</STRONG></P><pre>
14 years, 5 months
Knowledge Builder error
by 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
</pre>
<P><hr size=1></P>
<P><STRONG><font color=green>Please consider the environment before printing this email.</font></STRONG></P>
<P><STRONG>Visit our website at <a href="http://www.nyse.com">http://www.nyse.com</a> <br>
*****************************************************************************
<br>
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.
</STRONG></P><pre>
14 years, 5 months
Potential Job Opening for Core Drools Developer around Guvnor
by Mark Proctor
We are just finalising the details, but it looks like we may have a job
opening for a mid to senior java developer, to work with the Drools team
around Guvnor. I'm particulary interested in a London based developer,
who can work directly with me.
I'll post more details and a reference to the online details once they
become available. In the mean time, if you think you have what it takes,
send me an email.
Mark
14 years, 5 months
Working with DSL
by 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.
14 years, 5 months
dsl error- please help
by 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.<init>(Unknown Source)
at java.io.InputStreamReader.<init>(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
</pre>
<P><hr size=1></P>
<P><STRONG><font color=green>Please consider the environment before printing this email.</font></STRONG></P>
<P><STRONG>Visit our website at <a href="http://www.nyse.com">http://www.nyse.com</a> <br>
*****************************************************************************
<br>
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.
</STRONG></P><pre>
14 years, 5 months
smooks terrible error
by 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,Collection<Object>al,
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
</pre>
<P><hr size=1></P>
<P><STRONG><font color=green>Please consider the environment before printing this email.</font></STRONG></P>
<P><STRONG>Visit our website at <a href="http://www.nyse.com">http://www.nyse.com</a> <br>
*****************************************************************************
<br>
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.
</STRONG></P><pre>
14 years, 5 months
specific rules
by 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
</pre>
<P><hr size=1></P>
<P><STRONG><font color=green>Please consider the environment before printing this email.</font></STRONG></P>
<P><STRONG>Visit our website at <a href="http://www.nyse.com">http://www.nyse.com</a> <br>
*****************************************************************************
<br>
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.
</STRONG></P><pre>
14 years, 5 months
Guvnor importing model error
by Mylene
Hi,
I get errors after I import my (JAXB-generated) model in Guvnor.
The original schemas are rather complicated, and thus the generated model
depends heavily on inheritance. Could that be the problem?
The message I get is: Unable to validate package configuration (eg, DSLs,
models) for [my_package]. Suggestion completions may not operate correctly
for graphical editors for this package.
I don't get any completions... (but I guess that is to be expected after
this error)
I'm using drools-5.0-guvnor-standalone, Java 1.6 and JAXB version 2.2.1
Can anyone point me in the right direction?
Thanks
--
Mylene
14 years, 5 months
Global Variables and Business rules
by 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
</pre>
<P><hr size=1></P>
<P><STRONG><font color=green>Please consider the environment before printing this email.</font></STRONG></P>
<P><STRONG>Visit our website at <a href="http://www.nyse.com">http://www.nyse.com</a> <br>
*****************************************************************************
<br>
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.
</STRONG></P><pre>
14 years, 5 months