Re: [rules-users] Using CGLIB BeanGenerator generated instance as fact object

2010-09-30 Thread kpandey

Digging further I found that 5.x version supports Declared Types.
However it seems that it is only limited to primitives and Classes  right
now.

I got a simple sample with primitives working.
However I have a need to pass an array of string as a instance variable.

Is this possible right now?

Thanks
Kumar
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Using-CGLIB-BeanGenerator-generated-instance-as-fact-object-tp1608370p1611068.html
Sent from the Drools - User 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 Flow Events Not Working - FIXED

2010-09-30 Thread drooRam

just updating the subject to Fixed, so that it wud be helpful for other users
to directly look for solution.

-drooRam
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-Events-Not-Working-tp1453738p1610992.html
Sent from the Drools - User 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 Flow process question...

2010-09-30 Thread drooRam

another example:

http://drools-java-rules-engine.46999.n3.nabble.com/Drools-flow-variables-don-t-get-passed-to-sub-process-td1609297.html#a1609297


he mentioned that he is using the variable in subflow  you can set it
using IN/OUT param, registered variable thus can be passed to subflow in
this way.

-drooRam
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-process-question-tp1589567p1610967.html
Sent from the Drools - User 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 Flow process question...

2010-09-30 Thread drooRam

Hmm that one, i believe to persist the variables during the process flow. so
you can work later on the persisted variable based on your use case.

sometime you need to halt the process for any approval or some other event,
then resume it once the event is triggered, so that time you would be using
this registered/persisted variable back to process flow. 

-drooRam
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-process-question-tp1589567p1610943.html
Sent from the Drools - User 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] 5.1.1 import com.sun.tools.xjc

2010-09-30 Thread Barry Kaplan

If I don't explicitly add those jars to the classpath I get
NoDefClassFoundError for the jaxb Option class, which is used (I think) in
configuring the decision tables.
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/5-1-1-import-com-sun-tools-xjc-tp1608932p1609687.html
Sent from the Drools - User 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] 5.1.1 import com.sun.tools.xjc

2010-09-30 Thread Mark Proctor
  On 30/09/2010 16:19, Barry Kaplan wrote:
> It seems that KnowledgeBuilderFactory in api now has a dependency on these
> sun packages. However the pom declares them as "provided". This seems to
> imply that drools will only be run in some kind of app-server?? I had to
> manually add a bunch of dependencies just to get my drools app to compile.
> What is the rational behind this?
I think the rational was more to make it easy to work with JAXB, in 
theory if you aren't using JAXB you shouldn't need the dependency. If 
that's not working, we might have to look into an alternative way to add 
in the abstraction.

Mark
>


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


Re: [rules-users] Drools flow variables don't get passed to sub process?

2010-09-30 Thread jawa

Figured it out it was an easy one, it needs in/out parameter mapping.

Thanks
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Drools-flow-variables-don-t-get-passed-to-sub-process-tp1609297p1609409.html
Sent from the Drools - User 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 Flow Events Not Working

2010-09-30 Thread jawa

Finally I've fixed the problem

Exception in thread "main" java.lang.NoSuchMethodError:
org.drools.runtime.StatefulKnowledgeSession.execute(Lorg/drools/command/Command;)Lorg/drools/runtime/ExecutionResults;
 

It was caused because I was compiling my code against drools version 5.1.0
and was running it against 5.1.1 :(

Thanks to all who replied.
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-Events-Not-Working-tp1453738p1609303.html
Sent from the Drools - User 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] Drools flow variables don't get passed to sub process?

2010-09-30 Thread jawa

Hi,

I've a drools flow which has sub flow node in it. I've create a drools flow
variable both in main flow and sub flow with the same name. Then I use that
variable to set Parameter Mappings of a work item with in my main flow and
in sub flow. The work items in main flow get it fine and works perfectly but
the sub flow work items complain that it couldn't fine parameter. Here is
what i get in logs:

16:43:59,379 ERROR [STDERR] Could not find variable scope for variable
myvo.comment
16:43:59,380 ERROR [STDERR] when trying to execute Work Item My Workitem
16:43:59,380 ERROR [STDERR] Continuing without setting parameter.

In my code i start main flow with a map of parameter called "myvo" and I
assumed that the same variable will be passed to sub flow automatically but
it didn't. Does anyone know how can i pass the parameter to my sub flow ?

Thank you

-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Drools-flow-variables-don-t-get-passed-to-sub-process-tp1609297p1609297.html
Sent from the Drools - User 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] 5.1.1 import com.sun.tools.xjc

2010-09-30 Thread Barry Kaplan

It seems that KnowledgeBuilderFactory in api now has a dependency on these
sun packages. However the pom declares them as "provided". This seems to
imply that drools will only be run in some kind of app-server?? I had to
manually add a bunch of dependencies just to get my drools app to compile.
What is the rational behind this?


-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/5-1-1-import-com-sun-tools-xjc-tp1608932p1608932.html
Sent from the Drools - User 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] Using CGLIB BeanGenerator as fact object

2010-09-30 Thread Kumar Pandey
I'm exploring the possibility of using a dynamic bean as fact object  as my
fact object is very dynamic in nature.
I came across posts where people had recommended using  BeanGenerator from
CGLIB.

This blog does a very good job of  explaining the details of classloader
etc.

http://blog.athico.com/2006/12/dynamically-generated-class-beans-as.html

>From what I can gather ( I'm new to both CGLIB and drools ) CGLIB seems to
have the lowest lerning curve to achieve this.

I have the below sample on creating a dynamic bean with CGLIB

BeanGenerator bg = new BeanGenerator();
bg.setSuperclass(FactContextPlaceHolder.class);
bg.setNamingPolicy(new net.sf.cglib.core.NamingPolicy() {
  public String getClassName(String prefix, String source, Object key,
Predicate names) {
return prefix + "Impl";
  }
});


 bg.addProperty("foo", Double.TYPE);
 g.addProperty("bar", String.class);
 FactContextPlaceHolder beanInst = (FactContextPlaceHolder)bg.create();


Here com.drools.test.FactContextPlaceHolder is set as super class and the
generated class is obtained as com.drools.test.FactContextPlaceHolderImpl

I have  two basic question I am unable to find some answers on.

1) Once I create an object, how do I actually set the state of this object
with fact values before setting it as fact object to drools session?
In the above example how do I set value of foo to "foot-test1" and value of
bar to "bar-test1" on the beanInst.

2) In DRL if I set the package to some path say com.drools.test
  Should I then use FactContextPlaceHolderImpl as my fact Object?


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


Re: [rules-users] Few inquiries about Drools

2010-09-30 Thread Wolfgang Laun
2010/9/30 Nirmal Fernando 

> Hi,
>
> We are thinking of using Drools rules engine, for our application. But we
> have few questions, that we would really happy to get explanations about.
>
> 1) Is the latest version Drools 5.1 supports backward chaining? If so since
> which release you started to support backward chaining?
>

Drools 5 supports backward chaining; Drools 4 does not.


>
> 2) Are you using "Crisp Logic"? (we can only insert "facts" that are
> true/false)
>

There is no fuzzy logic. Facts, represented by Java objects (usually
JavaBean style) are, by definition, true; you never insert data representing
a false proposition.


>
> 3) Whether Drools allow to intermingle the RuleBase and the WorkingMemory?
>

Please explain what you mean by "intermingle". A Rule Base (preferably now:
Knowledge Base) contains rules; you create any number of sessions from that,
and each of these has its own Working Memory.

-W

>
> Hope to hear from you!
>
> Thanks.
> --
> Best Regards,
> Nirmal
>
> C.S.Nirmal J. Fernando
> Department of Computer Science & Engineering,
> Faculty of Engineering,
> University of Moratuwa,
> Sri Lanka.
>
> Blog: http://nirmalfdo.blogspot.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] Matching strings in two arrays

2010-09-30 Thread Wolfgang Laun
You could define a new operator (similar to "contains" or "memberOf") that
tests whether a field - a set of values - is a subset of a another set of
values.

See my home page for a full recipe:  http://members.inode.at/w.laun/

The code given there is for both sides being java.util.Collection. Handling
of
arrays could be added. But you should also consider providing the sets for
the rules as static auxiliary facts.

-W

On 29 September 2010 20:47, kpandey  wrote:

>
> This works great for the case where all entries in fact matches all entries
> in rule.
>
> I have a case where a subset of facts can exist in the set of rule.
>
> How would I construct the rule in this case without using the exits and
> from
> as I did initially?
>
> so MyContext.classes has subset "TStr1", "TStr2", "TStr3" and rule has set
> "TStr1", "TStr2", "TStr3", "TStr4","TStr5",
>
> The rule should pass in this case as classes values are subset of rules.
>
> Thanks
> Kumar
> --
> View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/Matching-strings-in-two-arrays-tp1602511p1604185.html
> Sent from the Drools - User 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] import data model to eclipse

2010-09-30 Thread fionali

resolved.

need specify 'import com.sample.aes.cpm.sample' rather than 'import
com.sample.aes.cpm.*'

-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/import-data-model-to-eclipse-tp1606966p1607163.html
Sent from the Drools - User 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] import data model to eclipse

2010-09-30 Thread fionali

Hi all,

I am new to drools. and now I have created a data model jar file and want to
import to eclipse.  I had added the jar at build path(by configuring build
path, import the library), and added the imports to drools.package. the
issue is that I still can not create guided rule for it can not get fact
from the model (at the guided editor, click WHEN, no fact is avaliable to be
selected). 

I suffered a lof from it and had searched the forum,no answer found.

Could anyboy kinderly help me? Thanks a lot!
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/import-data-model-to-eclipse-tp1606966p1606966.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users