Re: [rules-users] Large number of rules in Drools

2012-01-09 Thread Wolfgang Laun
Salience is just one way to force the evaluation of a condition before
others. In fact, using salience throughout is just a way of re-creating a
sequence of plain old if statements using a rules engine.

I'm not going to waste my time and yours by elaborating on possible
alternatives unless you come up with a detailed description of your rules,
and how you run your rules engine: fact insertion, calls to fire, etc.

-W

2012/1/10 Shweta1986 

> I am not sure I understand that. What is the other option for this case.
> Why would simple rules not work for 20 K rules. Am I missing something. I
> cannot use database to store my rules. Drools also gives me salience which
> I need for my usecase.
>
> On Thu, Jan 5, 2012 at 11:29 PM, laune [via Drools] <[hidden 
> email]
> > wrote:
>
>> 2012/1/6 Shweta1986 <[hidden 
>> email]
>> >
>>
>>> And my rules are very simple it is like if string comparison then set
>>> that's it..
>>>
>> This doesn't really warrant the use of a rule based system. If keeping
>> this logic out of the application or an easy maintenance of these if-then's
>> are your main goals, there are other ways. I've already hinted at this,
>> with the idea of providing the information embedded in similar rules as
>> data.
>> -W
>>
>>
>>
>> ___
>> rules-users mailing list
>> [hidden email] 
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>> --
>>  If you reply to this email, your message will be added to the
>> discussion below:
>>
>> http://drools.46999.n3.nabble.com/Large-number-of-rules-in-Drools-tp3630385p3637255.html
>>  To start a new topic under Drools: User forum, email [hidden 
>> email]
>> To unsubscribe from Drools: User forum, click here.
>> NAML
>>
>
>
> --
> View this message in context: Re: [rules-users] Large number of rules in
> Drools
> Sent from the Drools: User forum mailing list 
> archiveat 
> Nabble.com.
>
> ___
> 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


Re: [rules-users] API's used for loading process in Eclipse

2012-01-09 Thread Manohar Kokkula
 Esteban, Sorry for the delay,

Yes, I compiled binary package in Guvnor,
I am getting same Exceptions if I keep kbase.getProcess():

java.lang.NullPointerException
    at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1090)
    at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:301)
    at com.simple.Mainclass.main(Mainclass.java:30)


Thanks and regards,Manohar KokkulaMailto: manohar.kokk...@tcs.com-rules-users-boun...@lists.jboss.org wrote: -To: Rules Users List From: Esteban Aliverti Sent by: rules-users-boun...@lists.jboss.orgDate: 01/09/2012 08:34PMSubject: Re: [rules-users] API's used for loading process in EclipseHave you compiled your package in Guvnor?What is the result of kbase.getProcesses() ?Best Regards,Esteban Aliverti- Developer @ http://www.plugtree.com 

- Blog @ http://ilesteban.wordpress.com
2012/1/9 Manohar Kokkula 

 Conten in ProcessChangeSet.xml:

    xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'    xs:schemaLocation='http://drools.org/drools-5.0/change-set /home/manohar/Desktop/ChangeSet/ProcessExample-xsd/change-set-1.0.0.xsd' >

     

    I downloaded change-set-1.0.0.xsd and kept in the folder ChangeSet.

Thanks and regards,Manohar KokkulaMailto: manohar.kokk...@tcs.com

-rules-users-boun...@lists.jboss.org wrote: -

To: Rules Users List 

From: Esteban Aliverti Sent by: rules-users-boun...@lists.jboss.orgDate: 01/09/2012 08:16PMSubject: Re: [rules-users] API's used for loading process in Eclipse

What is the content of com/simple/ProcessChangeSet.xml?Best Regards,Esteban Aliverti- Developer @ http://www.plugtree.com 



- Blog @ http://ilesteban.wordpress.com
2012/1/9 Manohar Kokkula 



 Hi I am using Drool-5.2.0 final, Guvnor 5.2.0 final and designer-2.0-jboss.war in Drools-Guvnor.In Designer, I created simple process with start node, one task node, and end node. I made Task type of task node as "Script". I entered simple java code as System.out.print("Hi "); in the Script option of the task node. 



Sorry I dont know API's used for loading this process in Eclipse.So can any one tell me the API's used for loading this process in Eclipse.? I tried alot, but i am getting exceptions as:java.lang.NullPointerException



    at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1090)    at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:301)    at com.simple.Mainclass.main(Mainclass.java:30)



I am also sending my code:package com.simple;import org.drools.KnowledgeBase;import org.drools.agent.KnowledgeAgent;import org.drools.agent.KnowledgeAgentFactory;import org.drools.io.Resource;



import org.drools.io.ResourceFactory;import org.drools.rule.FactType;import org.drools.runtime.StatefulKnowledgeSession;public class Mainclass {    /**     * @param args     */    public static void main(String[] args) {



        // TODO Auto-generated method stub        try        {            KnowledgeBase kbase=readBase();            StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();       



            ksession.startProcess("sayhi"); //ID of the process which is created in Designer                       // ksession.fireAllRules();                        ksession.dispose();            



                    }        catch(Throwable t)        {                        t.printStackTrace();                                }    }    private static KnowledgeBase readBase()



    {                KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent("AccountAgent");                Resource changeset = ResourceFactory.newClassPathResource("com/simple/ProcessChangeSet.xml");



                        kagent.applyChangeSet(changeset);                KnowledgeBase kbase = kagent.getKnowledgeBase();      return kbase;                        }}



Please guide me in proper way.Thanks in advance.



Thanks and regards,Manohar KokkulaSub Focus Area Product Expert - BPM/BRE



CEG - Open Source Technology GroupYantraPark,Thane(West)



MumbaiPh:- +91 8793839453Mailto: manohar.kokk...@tcs.com



Website: http://www.tcs.com___



Experience certainty:  IT Services                                        Business Solutions                                        Outsourcing



=-=-=



Notice: The information contained in this e-mailmessage and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the 



information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have receiv

[rules-users] Where could I get drools binary or source versioning 5.3.2.final?

2012-01-09 Thread Miles Wen
Hello,
I submitted some issues to the issue tracker and browsed the issue tracker
site. Found that there is a bug fix version for drools 5.3 final which
named '5.3.2.final'. But I can't find where to download it.I searched for
the droolsjbpm/drools github repos too, but still couldn't find.
So if somebody knows where to find the drools 5.3.2.final version, please
tell me.
Thanks.

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


Re: [rules-users] Large number of rules in Drools

2012-01-09 Thread Davide Sottara
What Wolfgang was hinting at (assuming I understood correctly the thread of
the discussion) is the difference between a set of rules like this:

... 

rule "n-th test"
when
  $b : Bean( field == "x_n" )
then
  $b.setSomething( "y_n" )
end

...



and rule-base like this:

declare Holder
  selector : Object
  target : Object
  sal : int
end

rule "meta"
salience $sal
when
  $b : Bean( $f : field )
  Holder( selector == field, $tgt : target, $sal : sal )
then
  $b.setSomething( $tgt );
end

rule "init"
when
then
  // for j ...
  insert( new Holder( x[j], y[j], j ) );
end  



Of course, which approach is better would depend on the actual problem. If
you could share a few rules and highlight any patterns, that would be
helpful. 
For example, consider that one of the advantages of RETE-based systems is
the possibility to share evaluations between rules. 
So if your rules are all checking different fields for different values,
then maybe you should consider the latter approach.
Best
Davide

--
View this message in context: 
http://drools.46999.n3.nabble.com/Large-number-of-rules-in-Drools-tp3630385p3646521.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Large number of rules in Drools

2012-01-09 Thread Shweta1986
I am not sure I understand that. What is the other option for this case.
Why would simple rules not work for 20 K rules. Am I missing something. I
cannot use database to store my rules. Drools also gives me salience which
I need for my usecase.

On Thu, Jan 5, 2012 at 11:29 PM, laune [via Drools] <
ml-node+s46999n3637255...@n3.nabble.com> wrote:

> 2012/1/6 Shweta1986 <[hidden 
> email]
> >
>
>> And my rules are very simple it is like if string comparison then set
>> that's it..
>>
> This doesn't really warrant the use of a rule based system. If keeping
> this logic out of the application or an easy maintenance of these if-then's
> are your main goals, there are other ways. I've already hinted at this,
> with the idea of providing the information embedded in similar rules as
> data.
> -W
>
>
>
> ___
> rules-users mailing list
> [hidden email] 
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> --
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://drools.46999.n3.nabble.com/Large-number-of-rules-in-Drools-tp3630385p3637255.html
>  To start a new topic under Drools: User forum, email
> ml-node+s46999n47000...@n3.nabble.com
> To unsubscribe from Drools: User forum, click 
> here
> .
> NAML
>


--
View this message in context: 
http://drools.46999.n3.nabble.com/Large-number-of-rules-in-Drools-tp3630385p3646449.html
Sent from the Drools: User forum mailing list archive at Nabble.com.___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools Rules Mysql Configuration

2012-01-09 Thread kavitha sethu
Thanks for the reply Mike &  Esteban Aliverti. Using the webdav i was able
to see the xml format of the rule through
http://localhost:8081/guvnor/org.drools.guvnor.Guvnor/webdav/packages/edu.arizona/Lowers.brl.
Can anyone provide me simple example of how to pass this URL to Grails
Application Or any of the similar example..

Thanks.

On Mon, Jan 9, 2012 at 1:06 PM, Michael Anstis wrote:

> Guvnor uses JCR (Jackrabbit or Modeshape).
>
> JCR can be configured to store it's binary data in a database.
>
> The configuration you make to Guvnor to use a database configures JCR.
>
> The resulting tables are of JCRs requirements and needs. As you have
> discovered JCR has no knowledge of "rules".
>
> You cannot therefore expect to find plain-text rules in a database table
> used by JCR.
>
> Other people use the RSS feed and REST API to retrieve plain-text rules
> from Guvnor.
>
> With kind regards,
>
> Mike
>
>
> On 9 January 2012 19:03, kavita  wrote:
>
>> Hi,
>>
>> I want to write the rules from drools to my mysql database. Using
>> Repository
>> configuration, i have configured my drools guvnor to write to mysql
>> database. But, i am not seeing any tables which has rules in a readable
>> format? Can anyone tel me which table and field to look for?
>>
>> Am a beginner to drools guvnor. Please help.
>>
>> Thanks,
>> Kavitha.
>>
>> --
>> View this message in context:
>> http://drools.46999.n3.nabble.com/Drools-Rules-Mysql-Configuration-tp3645470p3645470.html
>> Sent from the Drools: User forum mailing list archive at Nabble.com.
>> ___
>> 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
>
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools Rules Mysql Configuration

2012-01-09 Thread Michael Anstis
Guvnor uses JCR (Jackrabbit or Modeshape).

JCR can be configured to store it's binary data in a database.

The configuration you make to Guvnor to use a database configures JCR.

The resulting tables are of JCRs requirements and needs. As you have
discovered JCR has no knowledge of "rules".

You cannot therefore expect to find plain-text rules in a database table
used by JCR.

Other people use the RSS feed and REST API to retrieve plain-text rules
from Guvnor.

With kind regards,

Mike

On 9 January 2012 19:03, kavita  wrote:

> Hi,
>
> I want to write the rules from drools to my mysql database. Using
> Repository
> configuration, i have configured my drools guvnor to write to mysql
> database. But, i am not seeing any tables which has rules in a readable
> format? Can anyone tel me which table and field to look for?
>
> Am a beginner to drools guvnor. Please help.
>
> Thanks,
> Kavitha.
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Drools-Rules-Mysql-Configuration-tp3645470p3645470.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> 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


Re: [rules-users] Drools Rules Mysql Configuration

2012-01-09 Thread Esteban Aliverti
Guvnor relies on JCR to persist its data. Maybe there is a way to configure
Jackrabbit (the JCR implementation that Guvnor uses by default), but I
don't know.
Webdav is another way to access the assets inside guvnor. Using a webdav
browser (I think Internet Explorer is one. Another one is Nautilus) you can
browse and get the content of the assets stored inside Guvnor:
http://docs.jboss.org/drools/release/5.4.0.Beta1/drools-guvnor-docs/html_single/index.html#d0e2870

Another way to access the rules inside Guvnor is to use REST-API:
http://docs.jboss.org/drools/release/5.4.0.Beta1/drools-guvnor-docs/html_single/index.html#d0e2327

Best Regards,



Esteban Aliverti
- Developer @ http://www.plugtree.com
- Blog @ http://ilesteban.wordpress.com


On Mon, Jan 9, 2012 at 8:42 PM, kavita  wrote:

> Thanks for the reply. Can you tel me what is webdav? Also, is there any way
> that i can change format of JCR? Because right now, i see a table called as
> versioning_pm_refs under my guvnor database which has some kind of data
> something like this in the field node_id. When i tried adding a new rule,
> it
> is creating a new row in this with some junk values like this
>
> ' ½ lÓ®H™ªÑ', ''
> 'pà %®nDD»F¹~', ''
>
> Thanks,
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Drools-Rules-Mysql-Configuration-tp3645470p3645568.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
>
> ___
> 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


Re: [rules-users] Drools Rules Mysql Configuration

2012-01-09 Thread kavita
Thanks for the reply. Can you tel me what is webdav? Also, is there any way
that i can change format of JCR? Because right now, i see a table called as
versioning_pm_refs under my guvnor database which has some kind of data
something like this in the field node_id. When i tried adding a new rule, it
is creating a new row in this with some junk values like this

'½lÓ®H™ªÑ', ''
'pà%®nDD»F¹~', ''

Thanks,

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-Rules-Mysql-Configuration-tp3645470p3645568.html
Sent from the Drools: User forum mailing list archive at Nabble.com.

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


Re: [rules-users] Drools Rules Mysql Configuration

2012-01-09 Thread Esteban Aliverti
Even if you have configured a database to store your rules, JCR is using
its internal format to store them. Not sure if you will be able to see them
in any readable way.
Did you try using webdav?

Best Regards,



Esteban Aliverti
- Developer @ http://www.plugtree.com
- Blog @ http://ilesteban.wordpress.com


On Mon, Jan 9, 2012 at 8:03 PM, kavita  wrote:

> Hi,
>
> I want to write the rules from drools to my mysql database. Using
> Repository
> configuration, i have configured my drools guvnor to write to mysql
> database. But, i am not seeing any tables which has rules in a readable
> format? Can anyone tel me which table and field to look for?
>
> Am a beginner to drools guvnor. Please help.
>
> Thanks,
> Kavitha.
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Drools-Rules-Mysql-Configuration-tp3645470p3645470.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> 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


[rules-users] Fresh Guvnor Install throws ClassNotFoundException

2012-01-09 Thread Mike Key
Hi all,

I have installed Guvnor 5.3.0-Final on a fresh Tomcat 7.0.12.  I am able to
import existing rules I have, however when I try to upload my fact model I
get an error in the localhost log file:

SEVERE: Servlet.service() for servlet [AssetFileServlet] in context with
path [/guvnor-5.3.0.Final-tomcat-6.0] threw exception [Servlet execution
threw an exception] with root cause
java.lang.ClassNotFoundException: org.osgi.framework.BundleActivator
>...at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
>...at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
>...at java.lang.Class.forName0(Native Method)
>...at java.lang.Class.forName(Class.java:247)
>...at
org.drools.rule.MapBackedClassLoader.loadClass(MapBackedClassLoader.java:109)
>...at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
>...at java.lang.ClassLoader.defineClass1(Native Method)
>...at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
>...at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
>...at
org.drools.rule.MapBackedClassLoader.fastFindClass(MapBackedClassLoader.java:86)
>...at
org.drools.rule.MapBackedClassLoader.loadClass(MapBackedClassLoader.java:104)
>...at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
>...at
org.drools.guvnor.server.contenthandler.ModelContentHandler.isClassVisible(ModelContentHandler.java:183)
>...at
org.drools.guvnor.server.contenthandler.ModelContentHandler.getImportsFromJar(ModelContentHandler.java:148)
>...at
org.drools.guvnor.server.contenthandler.ModelContentHandler.onAttachmentAdded(ModelContentHandler.java:66)
>...at
org.drools.guvnor.server.files.FileManagerUtils.attachFileToAsset(FileManagerUtils.java:115)
>...at
org.drools.guvnor.server.files.FileManagerUtils.attachFile(FileManagerUtils.java:87)
>...at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>...at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>...at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>...at java.lang.reflect.Method.invoke(Method.java:597)
>...at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
>...at
org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
>...at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
>...at
org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
>...at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
>...at
org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
>...at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
>...at
org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
>...at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
>...at
org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:163)
>...at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
>...at
org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
>...at
org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
>...at
org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)

I am attempting to upload a jar with all dependencies it uses (which
includes JPA annotations and JAXB annotations).  I have verified that the
jar contains all its proper dependencies.  This message seems to indicate I
am missing some OSGi jar or something that I would have expected to be
delivered with Guvnor.  Do I need some sort of global libraries for OSGi to
run Guvnor or to use my model when it has these external dependencies in
the jar?

Any help on this is greatly appreciated.

Cheers.

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


Re: [rules-users] does "dialect" really have an effect?

2012-01-09 Thread Mark Proctor
"dialect" is for areas explicitely marked with "eval" and for the 
consequence.

Over time we have improved the capabilities of the parser and thus the 
pattern language, so that much more can be done without the need of 
using an eval, the stuff outside of the eval is not related to the 
"dialect" attribute.

Mark
On 09/01/2012 18:34, ronalbury wrote:
> Also - I just confirmed that getFoo1AsBoolean() returns null.  I appreciate
> that as part of Drools null protection I don't get an error on that ...
> however, I am curious why the rest of the expression (the right hand side of
> the&&) is even evaluated.
>
> --
> View this message in context: 
> http://drools.46999.n3.nabble.com/does-dialect-really-have-an-effect-tp3645365p3645379.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> 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


[rules-users] Drools Rules Mysql Configuration

2012-01-09 Thread kavita
Hi,

I want to write the rules from drools to my mysql database. Using Repository
configuration, i have configured my drools guvnor to write to mysql
database. But, i am not seeing any tables which has rules in a readable
format? Can anyone tel me which table and field to look for?

Am a beginner to drools guvnor. Please help.

Thanks,
Kavitha.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-Rules-Mysql-Configuration-tp3645470p3645470.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] does "dialect" really have an effect?

2012-01-09 Thread ronalbury
Also - I just confirmed that getFoo1AsBoolean() returns null.  I appreciate
that as part of Drools null protection I don't get an error on that ...
however, I am curious why the rest of the expression (the right hand side of
the &&) is even evaluated.

--
View this message in context: 
http://drools.46999.n3.nabble.com/does-dialect-really-have-an-effect-tp3645365p3645379.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] does "dialect" really have an effect?

2012-01-09 Thread ronalbury
Drools 5.3

Given the following rule:
rule "EasyApp Family Term Rider Max Value"
dialect "java"
#ruleflow-group "values-group"
when
$ea : EasyApp(
getFoo1AsBoolean()==true
&& (getFoo2AsInt() > 25000
|| getFoo2AsInt() > 
getFoo3().getCurrentAmtAsInt()/5))
) 
then
$ea.addError(drools.getRule().getName());
end

The method getFoo3().getCurrentAmtAsInt() returns null, and so I get a null
pointer error.  I can accept that. However, the traceback shows I am deep in
MVEL code:
Caused by: java.lang.NullPointerException
at org.mvel2.ast.IntDiv.getReducedValueAccelerated(IntDiv.java:16)
at
org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:38)
at
org.mvel2.ast.Substatement.getReducedValueAccelerated(Substatement.java:43)
at
org.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:116)
at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:31)
at org.mvel2.MVELRuntime.execute(MVELRuntime.java:87)
at
org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:122)
at
org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:115)
at org.mvel2.MVEL.executeExpression(MVEL.java:930)
at
org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:100)
at
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:291)
... 17 more

I know you can use java syntax inside MVEL ... does Drools even look at the
dialect, or does it always just run everything in MVEL?

--
View this message in context: 
http://drools.46999.n3.nabble.com/does-dialect-really-have-an-effect-tp3645365p3645365.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Template Key in DSL

2012-01-09 Thread FrankVhh
Hi,

Sorry to have kept you waiting.

If you use plain DRL, you have 1 source of information. If you use DSL, you
add an extra source of information by inserting the data in it. Adding DSL
on top of that, adds a third source of information in the form of a
vocabulary.

In theory, the more disperse your information, the more difficult it will be
to maintain. 

Until now, I debugged all templates in the same way. Expand them all
completely and have them outputted to a real DRL file. Than, debug the
outputted file and make corrections in your template accordingly. Here,
imho, there is not much difference in a DSLR template and a DRL template,
provided that you have a stable DSL. This is not a debugging method that I
particullary like, but it gets the job done.

If you assess the difference between a DSLR and a DRL template, the only
differentiator is the DSL. In that case it comes down to the question
whether you have a stable DSL or not. If your DSL is mature, I would prefer
DSLR over DRL for reasons of understandability to non-technical users.
Unless your template is meant to be hidden from the user.

Regards,
Frank


laune wrote
> 
> OK, thanks for the confirmation.
> 
> Do you have any comments w.r.t. to usability during development
> (debugging?!) and maintenance? The example is simple enough, but what's
> your feeling?
> 
> -W
> 
> On 6 January 2012 08:46, FrankVhh  wrote:
> 
>>
>> laune wrote
>> >
>> > What I suggested is a non-standard way of rule authoring, and I just
>> think
>> > that it is possible - I've never tried it.
>> >
>>
>> This should work. I tried it once with Drools 5.0, so I assume it is
>> still
>> OK.
>>
>> http://drools.46999.n3.nabble.com/file/n3637269/voc.dsl voc.dsl
>> http://drools.46999.n3.nabble.com/file/n3637269/Sample.dst Sample.dst
>> http://drools.46999.n3.nabble.com/file/n3637269/DroolsTest.java
>> DroolsTest.java
>>
>> --
>> View this message in context:
>> http://drools.46999.n3.nabble.com/Template-Key-in-DSL-tp3634710p3637269.html
>> Sent from the Drools: User forum mailing list archive at Nabble.com.
>> ___
>> rules-users mailing list
>> rules-users@.jboss
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
> 
> ___
> rules-users mailing list
> rules-users@.jboss
> https://lists.jboss.org/mailman/listinfo/rules-users
> 


--
View this message in context: 
http://drools.46999.n3.nabble.com/Template-Key-in-DSL-tp3634710p3644953.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Instantiate fact class declared only in drl

2012-01-09 Thread Wolfgang Laun
Yeah, I'm aware of that. Still, I find it easier, even for a unit test, to
write a DRL snippet

rule "initTest"
when
then
SomeFact sf = ...
insert( sf );
end

and add this in the setup, possibly even compiled from a java.lang.String.

YMMV.
-W

2012/1/9 Esteban Aliverti 

> There is a full api that let you instantiate and manipulate declared types
> in Java code:
> http://docs.jboss.org/drools/release/5.4.0.Beta1/drools-expert-docs/html_single/index.html#d0e3750
>
> Best Regards,
>
> 
>
> Esteban Aliverti
> - Developer @ http://www.plugtree.com
> - Blog @ http://ilesteban.wordpress.com
>
>
>
> On Mon, Jan 9, 2012 at 4:20 PM, MarcoMojana wrote:
>
>> Ok laune, but I would like to create this objects inside a junit test (so
>> in
>> a method defined in a *.java file), not from the drl itself. Were you
>> suggesting a workaround?
>>
>> --
>> MM
>>
>>
>> laune wrote
>> >
>> > I've found that creating objects and facts from DRL-declared classes is
>> > easily done in DRL, in RHS code.
>> > -W
>> >
>>
>>
>> --
>> View this message in context:
>> http://drools.46999.n3.nabble.com/Instantiate-fact-class-declared-only-in-drl-tp3644780p3644822.html
>> Sent from the Drools: User forum mailing list archive at Nabble.com.
>> ___
>> 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
>
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Instantiate fact class declared only in drl

2012-01-09 Thread MarcoMojana
Thanks Esteban: this is exactly what I was looking for!

--
MM


Esteban wrote
> 
> There is a full api that let you instantiate and manipulate declared types
> in Java code:
> http://docs.jboss.org/drools/release/5.4.0.Beta1/drools-expert-docs/html_single/index.html#d0e3750
> 


--
View this message in context: 
http://drools.46999.n3.nabble.com/Instantiate-fact-class-declared-only-in-drl-tp3644780p3644872.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Instantiate fact class declared only in drl

2012-01-09 Thread Esteban Aliverti
There is a full api that let you instantiate and manipulate declared types
in Java code:
http://docs.jboss.org/drools/release/5.4.0.Beta1/drools-expert-docs/html_single/index.html#d0e3750

Best Regards,



Esteban Aliverti
- Developer @ http://www.plugtree.com
- Blog @ http://ilesteban.wordpress.com


On Mon, Jan 9, 2012 at 4:20 PM, MarcoMojana wrote:

> Ok laune, but I would like to create this objects inside a junit test (so
> in
> a method defined in a *.java file), not from the drl itself. Were you
> suggesting a workaround?
>
> --
> MM
>
>
> laune wrote
> >
> > I've found that creating objects and facts from DRL-declared classes is
> > easily done in DRL, in RHS code.
> > -W
> >
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Instantiate-fact-class-declared-only-in-drl-tp3644780p3644822.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> 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


Re: [rules-users] Instantiate fact class declared only in drl

2012-01-09 Thread MarcoMojana
Ok laune, but I would like to create this objects inside a junit test (so in
a method defined in a *.java file), not from the drl itself. Were you
suggesting a workaround?

--
MM


laune wrote
> 
> I've found that creating objects and facts from DRL-declared classes is
> easily done in DRL, in RHS code.
> -W
> 


--
View this message in context: 
http://drools.46999.n3.nabble.com/Instantiate-fact-class-declared-only-in-drl-tp3644780p3644822.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Instantiate fact class declared only in drl

2012-01-09 Thread Wolfgang Laun
I've found that creating objects and facts from DRL-declared classes is
easily done in DRL, in RHS code.
-W

On 9 January 2012 16:06, MarcoMojana  wrote:

> Hi,
> I have declared a fact in a drl file as follows:
>
> package a.b.c
> declare MyFact
>vehicle : Vehicle
> end
>
> The corresponding class file doesn't exists: it is created on the fly by
> drools at runtime. The class name should be a.b.c.MyFact, but the
> classloader cannot find it by using:
> Class c = Class.forName("a.b.c.MyFact");
>
> Is it possible to do that and how? I don't want to create the class because
> it is used only by rules inside the drl file, but I would like to write a
> test case for them.
>
> Thank you
>
> --
> MM
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Instantiate-fact-class-declared-only-in-drl-tp3644780p3644780.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> 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


[rules-users] Instantiate fact class declared only in drl

2012-01-09 Thread MarcoMojana
Hi,
I have declared a fact in a drl file as follows:

package a.b.c
declare MyFact
vehicle : Vehicle
end

The corresponding class file doesn't exists: it is created on the fly by
drools at runtime. The class name should be a.b.c.MyFact, but the
classloader cannot find it by using:
Class c = Class.forName("a.b.c.MyFact");

Is it possible to do that and how? I don't want to create the class because
it is used only by rules inside the drl file, but I would like to write a
test case for them.

Thank you

--
MM

--
View this message in context: 
http://drools.46999.n3.nabble.com/Instantiate-fact-class-declared-only-in-drl-tp3644780p3644780.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] API's used for loading process in Eclipse

2012-01-09 Thread Esteban Aliverti
Have you compiled your package in Guvnor?
What is the result of kbase.getProcesses() ?

Best Regards,



Esteban Aliverti
- Developer @ http://www.plugtree.com
- Blog @ http://ilesteban.wordpress.com


2012/1/9 Manohar Kokkula 

>  Conten in ProcessChangeSet.xml:
>
>
>  xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
> 
> xs:schemaLocation='http://drools.org/drools-5.0/change-set/home/manohar/Desktop/ChangeSet/ProcessExample-xsd/change-set-1.0.0.xsd'
>  >
> 
>   type='PKG' />
> 
> 
>
> I downloaded change-set-1.0.0.xsd and kept in the folder ChangeSet.
>
>
> Thanks and regards,
> Manohar Kokkula
> Mailto: manohar.kokk...@tcs.com
>
>
>
> -rules-users-boun...@lists.jboss.org wrote: -
>
> To: Rules Users List 
> From: Esteban Aliverti **
> Sent by: rules-users-boun...@lists.jboss.org
> Date: 01/09/2012 08:16PM
> Subject: Re: [rules-users] API's used for loading process in Eclipse
>
>
> What is the content of com/simple/ProcessChangeSet.xml?
>
> Best Regards,
>
> 
>
> Esteban Aliverti
> - Developer @ http://www.plugtree.com
> - Blog @ http://ilesteban.wordpress.com
>
>
> 2012/1/9 Manohar Kokkula 
>
>>  Hi
>>
>> I am using Drool-5.2.0 final, Guvnor 5.2.0 final and
>> designer-2.0-jboss.war in Drools-Guvnor.
>> In Designer, I created simple process with start node, one task node, and
>> end node. I made Task type of task node as "Script". I entered simple java
>> code as System.out.print("Hi "); in the Script option of the task node.
>> Sorry I dont know API's used for loading this process in Eclipse.
>> So can any one tell me the API's used for loading this process in
>> Eclipse.?
>>
>> I tried alot, but i am getting exceptions as:
>>
>> java.lang.NullPointerException
>> at
>> org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1090)
>> at
>> org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:301)
>> at com.simple.Mainclass.main(Mainclass.java:30)
>>
>>
>> I am also sending my code:
>>
>>
>> package com.simple;
>>
>> import org.drools.KnowledgeBase;
>> import org.drools.agent.KnowledgeAgent;
>> import org.drools.agent.KnowledgeAgentFactory;
>> import org.drools.io.Resource;
>> import org.drools.io.ResourceFactory;
>> import org.drools.rule.FactType;
>> import org.drools.runtime.StatefulKnowledgeSession;
>>
>> public class Mainclass {
>>
>> /**
>>  * @param args
>>  */
>> public static void main(String[] args) {
>> // TODO Auto-generated method stub
>>
>> try
>> {
>> KnowledgeBase kbase=readBase();
>> StatefulKnowledgeSession ksession =
>> kbase.newStatefulKnowledgeSession();
>>
>> ksession.startProcess("sayhi"); //ID of the process which is
>> created in Designer
>>
>>// ksession.fireAllRules();
>>
>> ksession.dispose();
>>
>>
>> }
>> catch(Throwable t)
>> {
>>
>> t.printStackTrace();
>>
>>
>> }
>>
>> }
>> private static KnowledgeBase readBase()
>> {
>>
>> KnowledgeAgent kagent =
>> KnowledgeAgentFactory.newKnowledgeAgent("AccountAgent");
>>
>> Resource changeset =
>> ResourceFactory.newClassPathResource("com/simple/ProcessChangeSet.xml");
>>
>>
>> kagent.applyChangeSet(changeset);
>>
>> KnowledgeBase kbase = kagent.getKnowledgeBase();
>>
>> return kbase;
>>
>>
>> }
>>
>> }
>>
>>
>>
>> Please guide me in proper way.
>> Thanks in advance.
>>
>>
>>
>>
>> Thanks and regards,
>> Manohar Kokkula
>> Sub Focus Area Product Expert - BPM/BRE
>> CEG - Open Source Technology Group
>> YantraPark,Thane(West)
>> Mumbai
>> Ph:- +91 8793839453
>> Mailto: manohar.kokk...@tcs.com
>> Website: http://www.tcs.com
>> ___
>> Experience certainty:  IT Services
>> Business Solutions
>> Outsourcing
>> 
>>
>> =-=-=
>>
>>
>>
>> Notice: The information contained in this e-mail
>> message and/or attachments to it may contain
>> confidential or privileged information. If you are
>> not the intended recipient, any dissemination, use,
>> review, distribution, printing or copying of the
>>
>>
>>
>> information contained in this e-mail message
>> and/or attachments to it are strictly prohibited. If
>> you have received this communication in error,
>> please notify us by reply e-mail or telephone and
>> immediately and permanently delete the message
>>
>>
>>
>> and any attachments. Thank you
>>
>>
>>
>> ___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
> ___
> rules-users mailing 
> listrules-users@lists.jboss.orghttps:

Re: [rules-users] API's used for loading process in Eclipse

2012-01-09 Thread Manohar Kokkula
 Conten in ProcessChangeSet.xml:    xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'    xs:schemaLocation='http://drools.org/drools-5.0/change-set /home/manohar/Desktop/ChangeSet/ProcessExample-xsd/change-set-1.0.0.xsd' >         I downloaded change-set-1.0.0.xsd and kept in the folder ChangeSet.Thanks and regards,Manohar KokkulaMailto: manohar.kokk...@tcs.com-rules-users-boun...@lists.jboss.org wrote: -To: Rules Users List From: Esteban Aliverti Sent by: rules-users-boun...@lists.jboss.orgDate: 01/09/2012 08:16PMSubject: Re: [rules-users] API's used for loading process in EclipseWhat is the content of com/simple/ProcessChangeSet.xml?Best Regards,Esteban Aliverti- Developer @ http://www.plugtree.com 

- Blog @ http://ilesteban.wordpress.com
2012/1/9 Manohar Kokkula 

 Hi I am using Drool-5.2.0 final, Guvnor 5.2.0 final and designer-2.0-jboss.war in Drools-Guvnor.In Designer, I created simple process with start node, one task node, and end node. I made Task type of task node as "Script". I entered simple java code as System.out.print("Hi "); in the Script option of the task node. 

Sorry I dont know API's used for loading this process in Eclipse.So can any one tell me the API's used for loading this process in Eclipse.? I tried alot, but i am getting exceptions as:java.lang.NullPointerException

    at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1090)    at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:301)    at com.simple.Mainclass.main(Mainclass.java:30)

I am also sending my code:package com.simple;import org.drools.KnowledgeBase;import org.drools.agent.KnowledgeAgent;import org.drools.agent.KnowledgeAgentFactory;import org.drools.io.Resource;

import org.drools.io.ResourceFactory;import org.drools.rule.FactType;import org.drools.runtime.StatefulKnowledgeSession;public class Mainclass {    /**     * @param args     */    public static void main(String[] args) {

        // TODO Auto-generated method stub        try        {            KnowledgeBase kbase=readBase();            StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();       

            ksession.startProcess("sayhi"); //ID of the process which is created in Designer                       // ksession.fireAllRules();                        ksession.dispose();            

                    }        catch(Throwable t)        {                        t.printStackTrace();                                }    }    private static KnowledgeBase readBase()

    {                KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent("AccountAgent");                Resource changeset = ResourceFactory.newClassPathResource("com/simple/ProcessChangeSet.xml");

                        kagent.applyChangeSet(changeset);                KnowledgeBase kbase = kagent.getKnowledgeBase();      return kbase;                        }}

Please guide me in proper way.Thanks in advance.

Thanks and regards,Manohar KokkulaSub Focus Area Product Expert - BPM/BRE

CEG - Open Source Technology GroupYantraPark,Thane(West)

MumbaiPh:- +91 8793839453Mailto: manohar.kokk...@tcs.com

Website: http://www.tcs.com___

Experience certainty:  IT Services                                        Business Solutions                                        Outsourcing

=-=-=

Notice: The information contained in this e-mailmessage and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the 

information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message 

and any attachments. Thank you
___
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
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Unable to do Guvnor Authentiation with MySQL

2012-01-09 Thread Sumeet Karawal

Hi All,

I am trying to enable authentication in Guvnor using MySQL. I am using
MySQL 5.1, Guvnor 5.2 and JBoss AS 5.0.4

I searched over a lot of docs and tried to do as mentioned below :

   I have created a GuvnorDB in MySQL with two tables
create table Principals(principal_id VARCHAR(64),password VARCHAR
(64));
create table roles(principal_id VARCHAR(64),user_role VARCHAR
(64),role_group VARCHAR(64));

and have entered some values accordingly (admin, admin123)  and (admin,
admin, admin);

   My components.xml in drools-guvnor.war is as follows :


http://jboss.com/products/seam/components";
xmlns:core="http://jboss.com/products/seam/core";
xmlns:security="http://jboss.com/products/seam/security";
xmlns:web="http://jboss.com/products/seam/web";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:transaction="http://jboss.com/products/seam/transaction";
xsi:schemaLocation="http://jboss.com/products/seam/core
http://jboss.com/products/seam/core-2.0.xsd
 http://jboss.com/products/seam/security
http://jboss.com/products/seam/security-2.0.xsd
 http://jboss.com/products/seam/components
http://jboss.com/products/seam/components-2.0.xsd
 http://jboss.com/products/seam/web
http://jboss.com/products/seam/web-2.0.xsd
 http://jboss.com/products/seam/transaction
http://jboss.com/products/seam/transaction-2.0.xsd";>











org.drools.repository.configuratororg.drools.repository.jackrabbit.JackrabbitRepositoryConfigurator










   






true





   I have also changed my login-config.xml accordingly and added a
   application policy :


 
 
 java:/MySqlDS
 select password from principals
where principal_id=?
 select user_role,'Roles' from roles
where principal_id=?

 
 
 


   I have also created a mysql-ds.xml and saved it in the default/deploy
   folder; its contents :




MySqlDS
jdbc:mysql://localhost:3306/GuvnorDB
com.mysql.jdbc.Driver
root


org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker

mySQL

getting an exceptiogetting


   After all these changes, when I run guvnor and try to login, I am
   getting an exception thrown at the console:

01:36:41,212 INFO  [STDOUT] INFO  10-01 01:36:41,211
(SecurityServiceImpl.java:login:57)  Logging in user [admin]
01:36:41,360 INFO  [STDOUT] ERROR 10-01 01:36:41,357
(SecurityServiceImpl.java:login:77)  Unable to login.
javax.security.auth.login.FailedLoginException: Password Incorrect/Password
Required
at org.jboss.security.auth.spi.UsernamePasswordLoginModule.login
(UsernamePasswordLoginModule.java:213)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at javax.security.auth.login.LoginContext.invoke
(LoginContext.java:784)
at javax.security.auth.login.LoginContext.access$000
(LoginContext.java:203)
at javax.security.auth.login.LoginContext$4.run
(LoginContext.java:698)
at javax.security.auth.login.LoginContext$4.run
(LoginContext.java:696)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv
(LoginContext.java:695)
at javax.security.auth.login.LoginContext.login
(LoginContext.java:594)
at org.jboss.seam.security.Identity.authenticate(Identity.java:335)
at org.jboss.seam.security.Identity.authenticate(Identity.java:324)
at org.drools.guvnor.server.security.SecurityServiceImpl.login
(SecurityServiceImpl.java:75)
at org.drools.guvnor.server.SecurityServiceServlet.login
(SecurityServiceServlet.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:57)..
.


I tried a lot but not getting through on how to do this.

It would really helpful if somebody could guide me on this.

Thanks & Regards,
Sumeet
Mailto: sumeet.kara...@tcs.com

=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you



___
rules-users mailing list
rules-users@lists.jboss.org
http

Re: [rules-users] API's used for loading process in Eclipse

2012-01-09 Thread Esteban Aliverti
What is the content of com/simple/ProcessChangeSet.xml?

Best Regards,



Esteban Aliverti
- Developer @ http://www.plugtree.com
- Blog @ http://ilesteban.wordpress.com


2012/1/9 Manohar Kokkula 

>  Hi
>
> I am using Drool-5.2.0 final, Guvnor 5.2.0 final and
> designer-2.0-jboss.war in Drools-Guvnor.
> In Designer, I created simple process with start node, one task node, and
> end node. I made Task type of task node as "Script". I entered simple java
> code as System.out.print("Hi "); in the Script option of the task node.
> Sorry I dont know API's used for loading this process in Eclipse.
> So can any one tell me the API's used for loading this process in
> Eclipse.?
>
> I tried alot, but i am getting exceptions as:
>
> java.lang.NullPointerException
> at
> org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1090)
> at
> org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:301)
> at com.simple.Mainclass.main(Mainclass.java:30)
>
>
> I am also sending my code:
>
>
> package com.simple;
>
> import org.drools.KnowledgeBase;
> import org.drools.agent.KnowledgeAgent;
> import org.drools.agent.KnowledgeAgentFactory;
> import org.drools.io.Resource;
> import org.drools.io.ResourceFactory;
> import org.drools.rule.FactType;
> import org.drools.runtime.StatefulKnowledgeSession;
>
> public class Mainclass {
>
> /**
>  * @param args
>  */
> public static void main(String[] args) {
> // TODO Auto-generated method stub
>
> try
> {
> KnowledgeBase kbase=readBase();
> StatefulKnowledgeSession ksession =
> kbase.newStatefulKnowledgeSession();
>
> ksession.startProcess("sayhi"); //ID of the process which is
> created in Designer
>
>// ksession.fireAllRules();
>
> ksession.dispose();
>
>
> }
> catch(Throwable t)
> {
>
> t.printStackTrace();
>
>
> }
>
> }
> private static KnowledgeBase readBase()
> {
>
> KnowledgeAgent kagent =
> KnowledgeAgentFactory.newKnowledgeAgent("AccountAgent");
>
> Resource changeset =
> ResourceFactory.newClassPathResource("com/simple/ProcessChangeSet.xml");
>
>
> kagent.applyChangeSet(changeset);
>
> KnowledgeBase kbase = kagent.getKnowledgeBase();
>
> return kbase;
>
>
> }
>
> }
>
>
>
> Please guide me in proper way.
> Thanks in advance.
>
>
>
>
> Thanks and regards,
> Manohar Kokkula
> Sub Focus Area Product Expert - BPM/BRE
> CEG - Open Source Technology Group
> YantraPark,Thane(West)
> Mumbai
> Ph:- +91 8793839453
> Mailto: manohar.kokk...@tcs.com
> Website: http://www.tcs.com
> ___
> Experience certainty:  IT Services
> Business Solutions
> Outsourcing
> 
>
> =-=-=
>
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain
> confidential or privileged information. If you are
> not the intended recipient, any dissemination, use,
> review, distribution, printing or copying of the
>
> information contained in this e-mail message
> and/or attachments to it are strictly prohibited. If
> you have received this communication in error,
> please notify us by reply e-mail or telephone and
> immediately and permanently delete the message
>
> and any attachments. Thank you
>
>
>
> ___
> 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


[rules-users] API's used for loading process in Eclipse

2012-01-09 Thread Manohar Kokkula
 Hi I am using Drool-5.2.0 final, Guvnor 5.2.0 final and designer-2.0-jboss.war in Drools-Guvnor.In Designer, I created simple process with start node, one task node, and end node. I made Task type of task node as "Script". I entered simple java code as System.out.print("Hi "); in the Script option of the task node. Sorry I dont know API's used for loading this process in Eclipse.So can any one tell me the API's used for loading this process in Eclipse.? I tried alot, but i am getting exceptions as:java.lang.NullPointerException    at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1090)    at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:301)    at com.simple.Mainclass.main(Mainclass.java:30)I am also sending my code:package com.simple;import org.drools.KnowledgeBase;import org.drools.agent.KnowledgeAgent;import org.drools.agent.KnowledgeAgentFactory;import org.drools.io.Resource;import org.drools.io.ResourceFactory;import org.drools.rule.FactType;import org.drools.runtime.StatefulKnowledgeSession;public class Mainclass {    /**     * @param args     */    public static void main(String[] args) {        // TODO Auto-generated method stub        try        {            KnowledgeBase kbase=readBase();            StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();                   ksession.startProcess("sayhi"); //ID of the process which is created in Designer                       // ksession.fireAllRules();                        ksession.dispose();                                }        catch(Throwable t)        {                        t.printStackTrace();                                }    }    private static KnowledgeBase readBase()    {                KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent("AccountAgent");                Resource changeset = ResourceFactory.newClassPathResource("com/simple/ProcessChangeSet.xml");                        kagent.applyChangeSet(changeset);                KnowledgeBase kbase = kagent.getKnowledgeBase();      return kbase;                        }}Please guide me in proper way.Thanks in advance.Thanks and regards,Manohar KokkulaSub Focus Area Product Expert - BPM/BRECEG - Open Source Technology GroupYantraPark,Thane(West)MumbaiPh:- +91 8793839453Mailto: manohar.kokk...@tcs.comWebsite: http://www.tcs.com___Experience certainty:  IT Services                                        Business Solutions                                        Outsourcing=-=-=Notice: The information contained in this e-mailmessage and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] xls decisiontable -> unable to resolve method using strict-mode

2012-01-09 Thread Olle Martensson
Thanks for your answer.

I have now tried to load the XLS without the KnowledgeAgent(see 
createKnowledgeBase() below).
This time I got class loading problems( see stack trace below).
This only happens when I load a XLS decision table, If I load a DRL rules file 
it runs fine without classloading issues.
I use a custom classloader that is configured with the 
KnowledgeBaseConfiguration, I can see that drools is trying to load the rule 
classes from the custom classloader when I run DTABLE but not when I run DRL.
>From the stacktrace it seems as if it's using CompositeClassLoader though.

### STACKTRACE ###

java.lang.ClassNotFoundException: Unable to load 
classA_rules_test.Rule_print_the_incoming_query_9
at org.drools.util.CompositeClassLoader.loadClass:110
at org.drools.rule.JavaDialectRuntimeData$PackageClassLoader.loadClass:540
at java.lang.ClassLoader.loadClass:247
at 
A_rules_test.Rule_print_the_incoming_query_9DefaultConsequenceInvoker.evaluate
at org.drools.common.DefaultAgenda.fireActivation:1091
at org.drools.common.DefaultAgenda.fireNextItem:1029
at org.drools.common.DefaultAgenda.fireAllRules:1251
at org.drools.common.AbstractWorkingMemory.fireAllRules:708
at org.drools.common.AbstractWorkingMemory.fireAllRules:672
at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules:218

### CREATION OF KNOWLEDGEBASE ###


private void createKnowledgeBase()

{

KnowledgeBaseConfiguration kBaseConfig = KnowledgeBaseFactory

.newKnowledgeBaseConfiguration(null, context.getClassLoader());

kBaseConfig.setOption(EventProcessingOption.STREAM);

   //kBaseConfig.setOption(MultithreadEvaluationOption.YES);

   
//kBaseConfig.setOption(MaxThreadsOption.get(Runtime.getRuntime().availableProcessors()
 * 2));

KnowledgeBase kBase = KnowledgeBaseFactory

.newKnowledgeBase(kBaseConfig);


KnowledgeBuilderConfiguration bconf = KnowledgeBuilderFactory

.newKnowledgeBuilderConfiguration(null,

context.getClassLoader());

bconf.setProperty("drools.dialect.java.compiler", "ECLIPSE");

bconf.setProperty("drools.dialect.java.lngLevel", "1.6");



DecisionTableConfiguration dtableconfiguration =

KnowledgeBuilderFactory.newDecisionTableConfiguration();

dtableconfiguration.setInputType( DecisionTableInputType.XLS );




PackageBuilderConfiguration pconf = (PackageBuilderConfiguration) bconf;

pconf.setClassLoaderCacheEnabled(true);



MVELDialectConfiguration conf = 
(MVELDialectConfiguration)pconf.getDialectConfiguration("mvel");

conf.setStrict(false);



String compilerDumpDir = context.getCompilerDumpDir();

if (compilerDumpDir != null && !compilerDumpDir.isEmpty())

{

pconf.setDumpDir(new File(compilerDumpDir));

}



KnowledgeBuilder kbuilder = 
KnowledgeBuilderFactory.newKnowledgeBuilder(kBase, bconf);



kbuilder.add(ResourceFactory.newFileResource("/tmp/templatetest.xls"),

  ResourceType.DTABLE,

  dtableconfiguration);

}



From: Michael Anstis mailto:michael.ans...@gmail.com>>
Reply-To: Rules Users List 
mailto:rules-users@lists.jboss.org>>
Date: Mon, 9 Jan 2012 09:18:51 +0100
To: Rules Users List 
mailto:rules-users@lists.jboss.org>>
Subject: Re: [rules-users] xls decisiontable -> unable to resolve method using 
strict-mode

Have you tried load the XLS into a KnowledgeBase without using a KnowledgeAgent?

Trying to narrow down where the issue might be will help (everyone) 
tremendously.

On 5 January 2012 16:40, ollem 
mailto:olle.martens...@digitalroute.com>> 
wrote:
Hello!

I'm using a knowledgeagent to point out a changeset XML which contains the
following DTABLE:

...

...

when I compile I get the following error:

Unable to Analyse Expression request == "/":
[Error: unable to resolve method using strict-mode:
ultra.Default.ultra.MYHTTPD.request()]
[Near : {... request == "/" }]
^
[Line: 7, Column: 10] : [Rule name='print the incoming query_9']

The weird this is that MYHTTPD class is a javabean and contains getRequest
and setRequest methods.
notice that it tries a no getter method
ultra.Default.ultra.MYHTTPD.request().
If I do the same logic from a normal DRL rules file it works fine.
MYHTTPD is generated so I cannot past the source here, but it's correct and
as I mentioned working in DRL files.

this is how the XSL file looks like:

RuleSet A rules test
Import  ultra.Default.ultra.MYHTTPD

RuleTableprint the incoming query
CONDITIONACTION
MYHTTPD
request  System.out.println($param);
Matcher  Logger
/"webserver root"

Anybody who knows what this is about?

Thanks // Olle






--
View this message in context: 
http://drools.46999.n3.nabble.com/xls-decisiontable-unable-to-resolve-method-using-strict-mode-tp3635460p3635460.html
Sent fr

Re: [rules-users] FactType returns null when creating a java client on Eclipse invoking a rule in Guvnor

2012-01-09 Thread Andre Fonseca
hi Michael,

 My environment is like below

 droools expert 5.3.0 final
 guvnor 5.3.0 final - guvnor-5.3.0.Final-tomcat-6.0.war
 Eclipse Helios - JBoss Drools Workbench 4.0.7 plugin

 I am not using authentication in guvnor, using guest user

 Actually I think I resolved the issue!

 I think I was missing to build the package! Now it works, below the test code 
I used

 Java Class 

 Resource xml = ResourceFactory.newClassPathResource("changeset.xml");
 KnowledgeAgent kAgent = KnowledgeAgentFactory.newKnowledgeAgent("myagent");
 kAgent.applyChangeSet(xml);
 KnowledgeBase kBase = kAgent.getKnowledgeBase();
 FactType fType = kBase.getFactType("mypackage", "MyObject");

 
 
 
 
 
 Thanks for all!
- Original Message -
From: Michael Anstis
Sent: 01/09/12 06:13 AM
To: Rules Users List
Subject: Re: [rules-users] FactType returns null when creating a java client on 
Eclipse invoking a rule in Guvnor

 What version of Drools Expert and Guvnor are you using?

 On 9 January 2012 00:47, kachaps4u < kachananidha...@gmail.com > wrote:
 Exactly my error too!!! I too followed their documentation.. some one had to
 find it. My project has ESB in it too.. So I went to the next step in
 running the uri from an ESB and it was successful. But the thing is I
 uploaded the POJO jars and wrote rules. I didn't test creating FACT in BRMS
 and running the same because I couldn't solve this error. let me see whether
 i can do something. I will update if i get any positive result.

 --
 View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-FactType-returns-null-when-creating-a-java-client-on-Eclipse-invoking-a-rule-in-Guvnor-tp3642559p3643345.html
 

 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 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


Re: [rules-users] xls decisiontable -> unable to resolve method using strict-mode

2012-01-09 Thread Michael Anstis
Have you tried load the XLS into a KnowledgeBase without using a
KnowledgeAgent?

Trying to narrow down where the issue might be will help (everyone)
tremendously.

On 5 January 2012 16:40, ollem  wrote:

> Hello!
>
> I'm using a knowledgeagent to point out a changeset XML which contains the
> following DTABLE:
>
> ...
> 
> ...
>
> when I compile I get the following error:
>
> Unable to Analyse Expression request == "/":
> [Error: unable to resolve method using strict-mode:
> ultra.Default.ultra.MYHTTPD.request()]
> [Near : {... request == "/" }]
> ^
> [Line: 7, Column: 10] : [Rule name='print the incoming query_9']
>
> The weird this is that MYHTTPD class is a javabean and contains getRequest
> and setRequest methods.
> notice that it tries a no getter method
> ultra.Default.ultra.MYHTTPD.request().
> If I do the same logic from a normal DRL rules file it works fine.
> MYHTTPD is generated so I cannot past the source here, but it's correct and
> as I mentioned working in DRL files.
>
> this is how the XSL file looks like:
>
> RuleSet A rules test
> Import  ultra.Default.ultra.MYHTTPD
>
> RuleTableprint the incoming query
> CONDITIONACTION
> MYHTTPD
> request  System.out.println($param);
> Matcher  Logger
> /"webserver root"
>
> Anybody who knows what this is about?
>
> Thanks // Olle
>
>
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/xls-decisiontable-unable-to-resolve-method-using-strict-mode-tp3635460p3635460.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> 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


Re: [rules-users] FactType returns null when creating a java client on Eclipse invoking a rule in Guvnor

2012-01-09 Thread Michael Anstis
What version of Drools Expert and Guvnor are you using?

On 9 January 2012 00:47, kachaps4u  wrote:

> Exactly my error too!!! I too followed their documentation.. some one had
> to
> find it. My project has ESB in it too.. So I went to the next step in
> running the uri from an ESB and it was successful. But the thing is I
> uploaded the POJO jars and wrote rules. I didn't test creating FACT in BRMS
> and running the same because I couldn't solve this error. let me see
> whether
> i can do something. I will update if i get any positive result.
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/rules-users-FactType-returns-null-when-creating-a-java-client-on-Eclipse-invoking-a-rule-in-Guvnor-tp3642559p3643345.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> 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