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.
15 years, 8 months
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.
15 years, 8 months
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>
15 years, 8 months
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.
15 years, 8 months
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
15 years, 8 months
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>
15 years, 8 months
Re: [rules-users] creating and integrating a specific output using drools
by 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" <TSwindells(a)nds.com>
Subject: Re: [rules-users] creating and integrating a specific output
using drools
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<DAC86F5F3B84F14088F0DB16092558CA090238F5E7(a)UKMA1.UK.NDS.COM>
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.
15 years, 8 months