Smooks error
by 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
</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
how to write a single constraint in split node
by eyal edri
Hi,
i'm kind of new to Drools and still trying to build a simple process.
I'm trying to understand if (and how) it is possible to write a 'rule'
constraint inside a split node that won't require
writing the opposite rule for the 2nd target node.
for e.g. if i have a split node with 2 target nodes,
and my 1st constraint is "Url( score > 90)" -> this will take me to target
node 1.
i want that split node will know to go target node 2 in case the score is
less or equal to 90,
without the need to explicitly write the 2nd constraint as "Url (score <=
90)".
is that possible?
--
Eyal Edri
14 years, 5 months
Re: [rules-users] rules-users Digest, Vol 43, Issue 117
by amit bhardwaj
Is anyone have working example with drool decision table. Please provide the
example
On Sat, Jun 19, 2010 at 11:08 PM, <rules-users-request(a)lists.jboss.org>wrote:
> Send rules-users mailing list submissions to
> rules-users(a)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-request(a)lists.jboss.org
>
> You can reach the person managing the list at
> rules-users-owner(a)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: MVEL strict mode -- when, why? (Barry Kaplan)
> 2. Re: JBoss password required to connect a PKG via a Agent
> (Jervisliu)
> 3. Connection with Active Directory multiple organizational
> units (G3)
> 4. Re: [Knowledge Agent Question (Mahalakshmi)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 19 Jun 2010 09:08:06 -0700 (PDT)
> From: Barry Kaplan <groups1(a)memelet.com>
> Subject: Re: [rules-users] MVEL strict mode -- when, why?
> To: rules-users(a)lists.jboss.org
> Message-ID: <1276963686581-907803.post(a)n3.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
> Hey Edson,
>
> If I don't explicitly set strict to false my rules fail to compile. I will
> create a simple example. Or maybe this two phase is post 5.0.1?
>
> -barry
> --
> View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/MVEL-strict-mode-when...
> Sent from the Drools - User mailing list archive at Nabble.com.
>
>
> ------------------------------
>
> Message: 2
> Date: Sun, 20 Jun 2010 00:47:43 +0800
> From: Jervisliu <jliu(a)redhat.com>
> Subject: Re: [rules-users] JBoss password required to connect a PKG
> via a Agent
> To: Rules Users List <rules-users(a)lists.jboss.org>
> Message-ID: <4C1CF4AF.5010503(a)redhat.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> You can include username/pwd in your ChangeSet, see below:
>
> <add>
> <resource
> source='
> http://localhost:8081/jboss-brms/org.drools.guvnor.Guvnor/package/default...
> '
> type='PKG' basicAuthentication='enabled' username='admin' password='pwd'/>
> </add>
>
> Details can be found from
>
> http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-compiler...
>
> Cheers,
> Jervis
>
> mmquelo massi wrote:
> > 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.
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users(a)lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
>
>
>
> ------------------------------
>
> Message: 3
> Date: Sat, 19 Jun 2010 10:17:51 -0700 (PDT)
> From: G3 <charmz05(a)gmail.com>
> Subject: [rules-users] Connection with Active Directory multiple
> organizational units
> To: rules-users(a)lists.jboss.org
> Message-ID: <1276967871426-907892.post(a)n3.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
> I am able to authenticate with Active Directory but with only a single
> organizational unit but not with users of multiple organizational units
> This is my organizational structure
> +cn=test,cn=con
> --+ou=Sample1
> -----uid:user1,uid:user2
> --+ou=Sample2
> -----uid:user3,uid:user4
> --+roles
> -----admin:uid:user1,user3
> -----user:uid:user2,user4
>
> I have set the admin rights accordingly in Guvnor.
> I am using Jboss Guvnor standalone 4.2.3 and I am trying to connect
> multiple organizational units using JAAS
> my login-config.xml
> ---------------------
> <application-policy name="adConnection">
> <authentication>
> <login-module code="org.jboss.security.auth.spi.LdapExtLoginModule"
> flag="required" >
> <module-option
> name="java.naming.provider.url">ldap://c.test.com:389/</module-option>
> <module-option
> name="java.naming.security.authentication">simple</module-option>
> <module-option
> name="bindDN">CN=Administrator,CN=Users,dc=test,dc=com</module-option>
> <module-option name="bindCredential">password</module-option>
> <module-option name="baseCtxDN">OU=Sample1,dc=test,dc=com</module-option>
> <module-option name="baseFilter">(CN={0})</module-option>
> <module-option name="rolesCtxDN">OU=roles,dc=test,dc=com</module-option>
> <module-option name="uidAttributeID">member</module-option>
> <module-option name="matchOnUserDN">true</module-option>
> <module-option name="roleFilter">(member={1})</module-option>
> <module-option name="roleAttributeID">CN</module-option>
> <module-option name="roleRecursion">-1</module-option>
> </login-module>
> <login-module code="org.jboss.security.auth.spi.LdapExtLoginModule"
> flag="required" >
> <module-option
> name="java.naming.provider.url">ldap://c.test.com:389/</module-option>
> <module-option
> name="java.naming.security.authentication">simple</module-option>
> <module-option
> name="bindDN">CN=Administrator,CN=Users,dc=test,dc=com</module-option>
> <module-option name="bindCredential">password</module-option>
> <module-option name="baseCtxDN">OU=Sample2,dc=test,dc=com</module-option>
> <module-option name="baseFilter">(CN={0})</module-option>
> <module-option name="rolesCtxDN">OU=roles,dc=test,dc=com</module-option>
> <module-option name="uidAttributeID">member</module-option>
> <module-option name="matchOnUserDN">true</module-option>
> <module-option name="roleFilter">(member={1})</module-option>
> <module-option name="roleAttributeID">CN</module-option>
> <module-option name="roleRecursion">-1</module-option>
> </login-module>
> </authentication>
> </application-policy>
>
> and my component.xml
> -------------------------
> <security:identity authenticate-method="#{authenticator.authenticate}"
> jaas-config-name="adConnection"/>
>
> I donot get any errors in server console during deployment but when login
> ,I cannot login into Guvnor and I get password or user name incorrect.Can
> some one help me out
>
>
>
> --
> View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/Connection-with-Activ...
> Sent from the Drools - User mailing list archive at Nabble.com.
>
>
> ------------------------------
>
> Message: 4
> Date: Sat, 19 Jun 2010 13:38:26 -0400
> From: Mahalakshmi <mr2809(a)nyu.edu>
> Subject: Re: [rules-users] [Knowledge Agent Question
> To: Rules Users List <rules-users(a)lists.jboss.org>
> Message-ID:
> <AANLkTilLuK0xGcaRKmihD-VY4meA_Pg_d13hoyHmvTyy(a)mail.gmail.com>
> Content-Type: text/plain; charset="windows-1252"
>
> 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
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.jboss.org/pipermail/rules-users/attachments/20100619/9c5f98c...
>
> ------------------------------
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> End of rules-users Digest, Vol 43, Issue 117
> ********************************************
>
--
Amit Bhardwaj
14 years, 5 months
Smooks error
by Mahalakshmi
Hi guys,
I am using Smooks for XML parsing.
I have created my smooks-config file and downloaded smooks v.1.3 from the
site and added all the .jar files to my classpath.
Also, I used eclipse plugin for Smooks and updated it.
Still I am unable to resolve DroolsSmooksConfiguration. It does not seem to
be present.
I do not understand which other dependencies should I account for??
I am using latest eclispe for jave EE developers.
my code is as follows:
Smooks smooks = new Smooks("smooks-config.xml");
DroolsSmooksConfiguration conf = new
DroolsSmooksConfiguration("order",null);
DroolsSmooksStatelessSession smooksSession = new
DroolsSmooksStatelessSession(session,smooks,conf);
I was able to import org.milyn.Smooks. not the others. I have
drools-compiler,drools-core and eclipse.jdt.core jar files already in my
classpath.
Please help!!!
Thank you.
M
14 years, 5 months
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
>
>
14 years, 5 months
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.
14 years, 5 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.
14 years, 5 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>
14 years, 5 months