Re: [rules-users] [Knowledge Agent Question
by Mahalakshmi
Hi,
Thanks so much for the info.
So then is there any way to actually add the dslr (created at runtime) files
to be detected by the program??
Because with eclipse we always need to keep refreshing the files everytime
which totally defeats the purpose of using business rules !! Until ofcourse
you have fixed set of rules!
Any other ideas?
Also is there a problem if we add multiple .dslr files to our rule base???
When I do that only the first .dslr files actually executes and the others
dont. I tried creating all the same files as .drl files and it works
perfectly fine.
Any idea why that happens??? I dont get any error stack.
Please help.
Thanks
M
2010/6/19 Esteban Aliverti <esteban.aliverti(a)gmail.com>
> If yo are using Kagent, you don't need to add the change set to kbuilder.
> The steps you need to implement should be something like this:
>
> 1. Start ResourceChangeScanner and ResourceChangeMonitor services
> 2. Create a changeset.xml file containing all the resources you want to add
> to the kagent's kbase
> 3. Create a new kagent
> 4. kagent.applyChangeSet() <-- The agent will process each resource the xml
> defines and add a monitor to detect further changes.
> 5. kagent.getKnowledgeBase() <-- the agen't kbase will contain all the
> rules now
>
> If you are looking for examples:
> http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-compiler...
>
> The bad new is that kagent can't manage dsl/dslr resouces yet. I'm working
> on that right now. Please follow these issues to be inform:
> https://jira.jboss.org/browse/JBRULES-2377 &
> https://jira.jboss.org/browse/JBRULES-2350
>
> Best,
>
>
> 2010/6/18 Fnu Mahalakshmi <FMahalakshmi(a)nyx.com>
>
>> 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
>> *****************************************************************************
>>
>> 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(a)lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>
>
> --
> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
>
> Esteban Aliverti
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
16 years
JBoss password required to connect a PKG via a Agent
by mmquelo massi
Hi everybody,
I am using Guvnor 501M2 on JBoss standalone.
I am accessing the PKG resource from my java code as follows:
ResourceBundle resourceBundle = ResourceBundle.getBundle("guvnoragent");
Properties props = new Properties();
props.setProperty("drools.resource.scanner.interval",
resourceBundle.getString("poll")); ResourceChangeScanner service =
ResourceFactory.getResourceChangeScannerService();
ResourceChangeScannerConfiguration rconf =
service.newResourceChangeScannerConfiguration(props); service.configure(
rconf ); //Agent Conf KnowledgeAgentConfiguration aconf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
aconf.setProperty("drools.agent.scanDirectories",
resourceBundle.getString("scanDir"));
aconf.setProperty("drools.agent.scanResources",
resourceBundle.getString("scanRsc")); BufferedReader bfr=null; try { bfr =
new BufferedReader(new FileReader(new File("......Changeset.xml"))); } catch
(Exception e) { ... } //Agent configurato e con Packages guvnor aggiunti
KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent("AgentPOC",
aconf); Resource csReader = ResourceFactory.newReaderResource(bfr);
kagent.applyChangeSet(csReader);<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Here I get the following exception:
*Caused by: java.io.IOException: Server returned HTTP response code: 401 for
URL:
http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/Test...
* at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1187)
at org.drools.io.impl.UrlResource.grabStream(UrlResource.java:194) at
org.drools.io.impl.UrlResource.getInputStream(UrlResource.java:130) at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:574)
... 7 more [2010:06:160 19:06:671:debug] KnowledgeAgent obtaining pkg
resource=[UrlResource path='
http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/Test...']
[2010:06:160 19:06:671:exception] java.lang.RuntimeException: KnowledgeAgent
exception while trying to deserialize KnowledgeDefinitionsPackage at
org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:829)
at
org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:627)
at
org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:513)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:145)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:130)
at
com.reply.alitalia.mm.poc.engine.RuleService.exeRules(RuleService.java:74)
at Main.main(Main.java:113)
*This is why the server is asking Java the JBoss credentials!!!*
How can I pass them?
Should I define them in the changeset.xml?
If it is so where can I fine the XSD file ???? I guess there is a tag or an
attribute like "password" or something
that will contain date that the Agent has to send to the server....
Should I remove the password check from JBoss?
Please let me know.
As far as I know there are other people on the IRC CHAT with the same issue.
Thank you 4 any help u can give me.
Bye,
Massi.
16 years
MVEL strict mode -- when, why?
by Barry Kaplan
I have never gotten any of my rules to compile using mvel strict mode. If I
leave the default I get spews of error messages that I can't make any sense
of. For example with:
---
package systeminsights.plugin.core.schedule
rule "foo"
when
eval(true)
then
// noop
end
---
I get messages like
[Error: Failed to compile: 3 compilation error(s):
- (1,21) unqualified type in strict mode for: plugin
- (1,26) unqualified type in strict mode for: core
- (1,35) unqualified type in strict mode for: schedule]
[Near : {... Unknown ....}]
^
[Line: 1, Column: 0]
If I set strict mode to false all is good.
So, what is actually going on with strict mode? And how does one interpret
messages such as the above?
-barry
--
View this message in context: http://n3.nabble.com/MVEL-strict-mode-when-why-tp95666p95666.html
Sent from the Drools - User mailing list archive at Nabble.com.
16 years
Knowledge Agent Question
by 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
</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>
16 years
Problems with OR
by skasab2s
Hello,
we are using Drools Expert. We have a rule which should fire if at least one
of the object attributes are not empty. This is my pattern:
( TblVersichKlinik(versicherung != null, versicherung != " ")
or
(TblVersichKlinik(zusatzversicherung !=null, zusatzversicherung != " ")) )
The problem is the following: when BOTH conditions are fulfilled, the rule
fires twice, so I get redundant results in my final result, and this is not
wanted.
Is there a way to solve the problem? Any ideas ?
Thanks a lot and many regards!
skasab2s
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Problems-with-OR-tp90...
Sent from the Drools - User mailing list archive at Nabble.com.
16 years
jBPM and Drools Flow
by Hitoshi Ozawa
Hi,
With changes in jBPM team and a new announcement on jBPM 5 being more
compatible with Drools Flow,
would appreciate if someone can tell me the current stance on Drools
Flow. Will the two join or remain
separate.
H.Ozawa
16 years
Knowledge Builder Question
by 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
</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>
16 years