[rules-users] [MVEL] the data converter does not work

2011-12-13 Thread kapokfly
Can someone tell why the data converter does not work at all and what is the
reason we make the data converter to value assignment statement only? 

  public void testDataConverter() throws Exception {
OptimizerFactory.setDefaultOptimizer(OptimizerFactory.SAFE_REFLECTIVE);

DataConversion.addConversionHandler(Date.class, new MyDateConverter());

Locale.setDefault(Locale.US);

Cheese cheese = new Cheese();
cheese.setUseBy(new
SimpleDateFormat(dd-MMM-).parse(10-Jul-1974));

MapString, Object variables = new HashMapString, Object();
variables.put(cheese, cheese);

Serializable compiledExpression = MVEL.compileExpression(cheese.useBy
== '10-Jul-1974');
boolean result = MVEL.executeExpression(compiledExpression, variables,
Boolean.class);
assertTrue(result);
  }


Here is what I can see from the code, at the end this method will be called,
would it be nice to allow the data converter here? 
private static Boolean safeEquals(final Object val1, final Object val2)
{
if (val1 != null) {
return val1.equals(val2) ? Boolean.TRUE : Boolean.FALSE;
}
else return val2 == null || (val2.equals(val1) ? Boolean.TRUE :
Boolean.FALSE);
}




-
Ivan, your Panda, forever
--
View this message in context: 
http://drools.46999.n3.nabble.com/MVEL-the-data-converter-does-not-work-tp3581797p3581797.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] [MVEL] the data converter does not work

2011-12-13 Thread kapokfly
For this particular cases, if I modify the safeEquals method to be something
like this, the test case would success, what is the disadvantage to add
converters like this, any hint? 

private static Boolean safeEquals(final Object val1, final Object val2)
{
if (val1 != null) {
if (DataConversion.canConvert(val2.getClass(), val1.getClass()))
{
return val2.equals(DataConversion.convert(val1,
val2.getClass()));
}
return val1.equals(val2) ? Boolean.TRUE : Boolean.FALSE;
}
else return val2 == null || (val2.equals(val1) ? Boolean.TRUE :
Boolean.FALSE);
}

-
Ivan, your Panda, forever
--
View this message in context: 
http://drools.46999.n3.nabble.com/MVEL-the-data-converter-does-not-work-tp3581797p3581928.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] [MVEL-Users]forum MVEL-Users have been created to discuss MVEL specific questions

2011-12-13 Thread kapokfly
Hi Mark,

Yes I tried, it does not work well, it told me I subscribed it successfully
but all the messages I sent to the mail list were ignored so thinking the
forum would be easier for posting/sharing/searching. 



-
Ivan, your Panda, forever
--
View this message in context: 
http://drools.46999.n3.nabble.com/MVEL-Users-forum-MVEL-Users-have-been-created-to-discuss-MVEL-specific-questions-tp3584309p3584495.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] [MVEL] the data converter does not work

2011-12-13 Thread kapokfly
Mark, can you share your insight on this?

-
Ivan, your Panda, forever
--
View this message in context: 
http://drools.46999.n3.nabble.com/MVEL-the-data-converter-does-not-work-tp3581797p3584585.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] [MVEL]Getting Null Context Object with MVEL Inteceptor

2011-12-04 Thread kapokfly

  public void testMyInterceptors() {

// Avoid MVEL OOM issue: http://jira.codehaus.org/browse/MVEL-252
// This also disables JIT compilre
// At this time, MVEL does not support per instance configuration of the
JIT due to performance constraints.
OptimizerFactory.setDefaultOptimizer(OptimizerFactory.SAFE_REFLECTIVE);

Interceptor testLeftInterceptor = new Interceptor() {
  public int doBefore(ASTNode node,
  VariableResolverFactory factory) {
System.out.println(BEFORE left Node:  + node.getName());
System.out.println(BEFORE left Node: node.getClass():  +
node.getClass());
//node.setAsLiteral();
//node.setLiteralValue(Ivan);
System.out.println(BEFORE left Node:  + node.getLiteralValue());
node.setAccessor(new MetaDataAccessor());
return 0;
  }

  public int doAfter(Object val,
 ASTNode node,
 VariableResolverFactory factory) {
System.out.println(AFTER left Node:  + node.getName());
System.out.println(AFTER left Node: node.getLiteralValue():  +
node.getLiteralValue());
return 0;
  }
};

Interceptor testRightInterceptor = new Interceptor() {

  public int doBefore(ASTNode node,
  VariableResolverFactory factory) {
System.out.println(BEFORE right Node:  + node.getName());
System.out.println(BEFORE right Node: node.getClass():  +
node.getClass());
return 0;
  }

  public int doAfter(Object val,
 ASTNode node,
 VariableResolverFactory factory) {
System.out.println(AFTER right Node:  + node.getName());
return 0;
  }
};

MapString, Interceptor interceptors = new HashMapString,
Interceptor();
interceptors.put(testLeft, testLeftInterceptor);
interceptors.put(testRight, testRightInterceptor);

String expression = (@testLeft emailMessage.from == @testRight 'Mark'
|| @testLeft myBean.var == 1);
//compileExpression(expression, null, interceptors);
MapString, Object contextObjects = new HashMapString, Object();
EmailMessage emailMessage = new EmailMessage();
emailMessage.setFrom(Mark);
contextObjects.put(emailMessage, emailMessage);

MyBean myBean = new MyBean();
myBean.setVar(1);
contextObjects.put(myBean, myBean);

boolean evaluationResult =
executeExpression(compileExpression(expression, null, interceptors),
contextObjects, Boolean.class);
System.out.println(evaluationResult);
  }


public class MetaDataAccessor implements Accessor{
  public Object getValue(Object ctx, Object elCtx, VariableResolverFactory
variableFactory) {
return null;  //To change body of implemented methods use File |
Settings | File Templates.
  }

  public Object setValue(Object ctx, Object elCtx, VariableResolverFactory
variableFactory, Object value) {
return null;  //To change body of implemented methods use File |
Settings | File Templates.
  }

  public Class getKnownEgressType() {
return null;  //To change body of implemented methods use File |
Settings | File Templates.
  }
}


When the MetaDataAccessor's geValue was invoked, the ctx and elCtx were
Null, however I am expecting the correct expression and context object
presents? 

What is wrong with my codes? 

I would expect the value reduce process can be done by my accessor in some
cases but apparently it is not. 



-
Ivan, your Panda, forever
--
View this message in context: 
http://drools.46999.n3.nabble.com/MVEL-Getting-Null-Context-Object-with-MVEL-Inteceptor-tp3559057p3559057.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] [MVEL]how to intercept all ASTNode without annotation?

2011-12-04 Thread kapokfly
To be able to intercept against each node, I have to manually update the
expression String to register some interceptors like below, is there any
convenient API can make this enabled without adding such interceptors? 

  public void testMyInterceptors() {

// Avoid MVEL OOM issue: http://jira.codehaus.org/browse/MVEL-252
// This also disables JIT compilre
// At this time, MVEL does not support per instance configuration of the
JIT due to performance constraints.
OptimizerFactory.setDefaultOptimizer(OptimizerFactory.SAFE_REFLECTIVE);

Interceptor testLeftInterceptor = new Interceptor() {
  public int doBefore(ASTNode node,
  VariableResolverFactory factory) {
System.out.println(BEFORE left Node:  + node.getName());
System.out.println(BEFORE left Node: node.getClass():  +
node.getClass());
//node.setAsLiteral();
//node.setLiteralValue(Ivan);
System.out.println(BEFORE left Node:  + node.getLiteralValue());
//node.setAccessor(new MetaDataAccessor());
return 0;
  }

  public int doAfter(Object val,
 ASTNode node,
 VariableResolverFactory factory) {
System.out.println(AFTER left Node:  + node.getName());
System.out.println(AFTER left Node: node.getLiteralValue():  +
node.getLiteralValue());
return 0;
  }
};

Interceptor testRightInterceptor = new Interceptor() {

  public int doBefore(ASTNode node,
  VariableResolverFactory factory) {
System.out.println(BEFORE right Node:  + node.getName());
System.out.println(BEFORE right Node: node.getClass():  +
node.getClass());
return 0;
  }

  public int doAfter(Object val,
 ASTNode node,
 VariableResolverFactory factory) {
System.out.println(AFTER right Node:  + node.getName());
return 0;
  }
};

MapString, Interceptor interceptors = new HashMapString,
Interceptor();
interceptors.put(testLeft, testLeftInterceptor);
interceptors.put(testRight, testRightInterceptor);

String expression = (@testLeft emailMessage.from == @testRight 'Mark 1'
|| @testLeft myBean.var == 1);
//compileExpression(expression, null, interceptors);
MapString, Object contextObjects = new HashMapString, Object();
EmailMessage emailMessage = new EmailMessage();
emailMessage.setFrom(Mark);
contextObjects.put(emailMessage, emailMessage);

MyBean myBean = new MyBean();
myBean.setVar(1);
contextObjects.put(myBean, myBean);

boolean evaluationResult =
executeExpression(compileExpression(expression, null, interceptors),
contextObjects, Boolean.class);
System.out.println(evaluationResult);
  }

-
Ivan, your Panda, forever
--
View this message in context: 
http://drools.46999.n3.nabble.com/MVEL-how-to-intercept-all-ASTNode-without-annotation-tp3559064p3559064.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] [MVEL]why compileExpression returns Serializable not ExecutableStatement and a few more other interface design?

2011-12-04 Thread kapokfly
Hi Mark, 

Few questions to confirm with you, or anyone else who are familiar with
MVEL's design?

1) What is the design intention to not returning ExecutableStatement when
trying to compile an expression? 

2) How the 'Safe' interface is being used? Why MVEL has both
ExecutableAccessorSafe and ExecutableAccessor? Which one should be used? 

3) What is the major differences between ASTNode.getReducedValueAccelerated
and getReducedValue? 

4) What is the major purpose of debugSymbols? (looks like it has to be used
with a source file specified?)

-
Ivan, your Panda, forever
--
View this message in context: 
http://drools.46999.n3.nabble.com/MVEL-why-compileExpression-returns-Serializable-not-ExecutableStatement-and-a-few-more-other-interfa-tp3559079p3559079.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] How to let a rule run only one time

2011-12-04 Thread kapokfly
you may check drools experts online documents section 5.8.1, Rule Attributes
like no-loop or activation-group or agenda-group.

-
Ivan, your Panda, forever
--
View this message in context: 
http://drools.46999.n3.nabble.com/How-to-let-a-rule-run-only-one-time-tp3550555p3559127.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] [MVEL]user typed in free format expression and advanced property/expression handler integration issue

2011-12-03 Thread kapokfly
I have been trying and evaluating MVEL in past few days and in general, I
love this small kids but with 1 doubt needs ask for suggestions here. 

The key scenario is, we have an UI to allow users type in free format
expression and we have a couple of custom property/variable even expression
handler classes needs to be integrated with. 

Example sub-expression: 
1) person.name.isVisiable -- Please note, the isVisisble is not a java
property of name (it is name field's meta data which requires a quite
different resolver other than how we resolve the person and how we resolve
to name field). 
2) person.name -- normal property resolver. 

Now with the user typed in expression:
 (person.name.isVisiable == true)  (person.name == Joe Wang), what is
the best way to utilize MVEL to be able to parse/compile and execute this
expression? 

the first thing the API needs to know is whether it is a meta field
evaluation or a normal java property evaluation, there is no such clue on
user typed in expression unless we can parse the expression and scan its
full text like 'person.name.isVisiable'

The thing I am currently looking at is @Interceptor or custom function, and
looking for a way to be able to translate the expression into an easier
format like (@meta person.name.isVisiable == true)  (person.name == Joe
Wang). 

Is there any API in MVEL exists can make such transformation easier? Or
maybe we can use a hidden field on UI to append @meta tag when user types
in? 

Once 1st question is satisfied, the next one should be how we should proceed
@meta interceptor with the ASTNode passed in. 

Looking forward to your comments. 

Thanks.

-
Ivan, your Panda, forever
--
View this message in context: 
http://drools.46999.n3.nabble.com/MVEL-user-typed-in-free-format-expression-and-advanced-property-expression-handler-integration-issue-tp3557472p3557472.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] MVEL expression

2011-12-03 Thread kapokfly
the LHS when is not MVEL, it's DRL Pattern language, it's just that some
things we translate to MVEL for execution. Our pattner language does not
support casting, no. However MVEL itself does support casting, and you can
do that on a RHS then which is full MVEL.
Sorry that's not quite true, if you use an EVAL thats pure MVEL a cast
should work inside of that, as evals are like black boxes to the rule engine
and they are executed directly by java or mvel depending on the dialect you
chose.


Finally I found something 'official' :--) It was confusing me why Drools
does not support transparent type casting while MVEL has a very good support
on that, now it explains... 

Hi Mark,
Is this still true with the latest Drools 5.3? BTW, great work on MVEL, we
like it :-)




-
Ivan, your Panda, forever
--
View this message in context: 
http://drools.46999.n3.nabble.com/MVEL-expression-tp50062p3557491.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 drools support Class type parameter? myService(Class objectType)

2011-11-17 Thread kapokfly
does drools support Class type parameter? 

In java:
ServiceLocator.java:
void myService(Class objectType);

In Drools:
serviceLocator.myService(Person.class)

It always complains 'unable to resolve method using strict-mode'.

Change to other type like String will get it through. 

-
Ivan, your Panda, forever
--
View this message in context: 
http://drools.46999.n3.nabble.com/does-drools-support-Class-type-parameter-myService-Class-objectType-tp3515507p3515507.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 drools support Class type parameter? myService(Class objectType)

2011-11-17 Thread kapokfly
our existing java implementation using reflection which requires Class. 

Are you saying invoking java code with a Class type parameter from DRL is
not supported?

-
Ivan, your Panda, forever
--
View this message in context: 
http://drools.46999.n3.nabble.com/does-drools-support-Class-type-parameter-myService-Class-objectType-tp3515507p3515712.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] MVEL, Spring EL, JXEL, which one you like/dislike, and why?

2011-11-17 Thread kapokfly
Can someone share their opinion on these expression languages and what you
like, what you dislike with each?

MVEL, Spring EL, JXEL and even JBoss EL? 

-
Ivan, your Panda, forever
--
View this message in context: 
http://drools.46999.n3.nabble.com/MVEL-Spring-EL-JXEL-which-one-you-like-dislike-and-why-tp3516055p3516055.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] Building our own UI for Drools

2011-11-16 Thread kapokfly
Thanks for the information. 

Deploy multiple GUNVOR instances can't resolve our issue as we have
thousands of companies as our customer, each company will share the common
part of our applications and meantime they can customize objects/fields they
have permission with, this will be terrible if we go with the
separate/dedicate deployment and basically we think that will be not
manageable... 

What we are looking for is, be able to share a common collection of ruleset
and at the same time, be able to define their custom rules with their
customization. 

Ivan

-
Ivan, your Panda, forever
--
View this message in context: 
http://drools.46999.n3.nabble.com/Building-our-own-UI-for-Drools-tp3508849p3512037.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] Building our own UI for Drools

2011-11-16 Thread kapokfly
Hi GPatel,

Maybe separate by package is something can be tried, but do you see the
functionality of what Gunvor provided is good enough for your usage? 

For us it is still missing some necessary functions:
given a condition, 'a = b', 
1) we would like the 'b' part could be an expression/reference to another
field, not only a value
2) we would like to be able to redefine the dot notation so it can refer to
not only a property but also its meta data information so the meta data
value can also be used as part of the rule 
3) for existing none object graph traverse we also would like to register
our own property resolver so it can load related objects into the proper
context 

Also are you able to tweak the UI to comply with your own application's
style?
And does your object also share a common rulesets across different
customers? How you design this part in your POC so any potential upgrade
could be easier? 

Ivan

-
Ivan, your Panda, forever
--
View this message in context: 
http://drools.46999.n3.nabble.com/Building-our-own-UI-for-Drools-tp3508849p3512962.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] Property access on Java Beans (POJO's)

2011-11-16 Thread kapokfly
Hi Mark,

Any comment with drools how we can register our own property resolver and
able to delegate the actual work back to drools default implementation if
necessary? 

And why you say the MVEL is far better than Spring EL? How about JXEL? Do
you also have kind of comparison table available? 

It is likely that we will not adopt Drools however an expression language
would be necessary for us.  

Ivan

-
Ivan, your Panda, forever
--
View this message in context: 
http://drools.46999.n3.nabble.com/Property-access-on-Java-Beans-POJO-s-tp3509973p3514445.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] Building our own UI for Drools

2011-11-15 Thread kapokfly
Thanks Mike, I will take a look of the Drools Expert fluent API. 

We can't benefit from the Gunvor's rest API as there are some key issues we
are trying to resolve with our own UI:

1) unified user interface. 
2) work with our meta data and current engineering model seamlessly,
especially we want their patch lifecycle same as the rules. 
3) we have our own in application version control and would like the rule
object follows the same
4) we don't want to host another dedicate application outside our core
application, especially we are using jboss 4.x which I also did not find a
supported Gunvor war file. 
5) The guvnor's approach works with single company but does not work with a
SAAS environment where end user is able to customize each object and writing
rules against their own properties. 
6) It is easier for us to write adapter model within our application rather
than expose meta data into gunvor which is hosted separately. 
7)... 


Ivan

-
Ivan, your Panda, forever
--
View this message in context: 
http://drools.46999.n3.nabble.com/Building-our-own-UI-for-Drools-tp3508849p3509332.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] Property access on Java Beans (POJO's)

2011-11-15 Thread kapokfly
This is what is documented 
/
Any bean property can be used directly. A bean property is exposed using a
standard Java bean getter: a method getMyProperty() (or isMyProperty() for a
primitive boolean) which takes no arguments and return something. For
example: the age property is written as age in DRL instead of the getter
getAge():

Person( age == 50 )

// this is the same as:
Person( getAge() == 50 )
Drools uses the standard JDK Introspector class to do this mapping, so it
follows the standard Java bean specification.
/

Apparently this is from Spring:
The StandardEvaluationContext is where you may specify the root object to
evaluate against via the method setRootObject() or passing the root object
into the constructor. You can also specify variables and functions that will
be used in the expression using the methods setVariable() and
registerFunction(). The use of variables and functions are described in the
language reference sections Variables and Functions. The
StandardEvaluationContext is also where you can register custom
ConstructorResolvers, MethodResolvers, and PropertyAccessors to extend how
SpEL evaluates expressions. Please refer to the JavaDoc of these classes for
more details.
 

Can drools do the same to allow custom resolver, which would be quite useful
in our use cases. 

Ivan


-
Ivan, your Panda, forever
--
View this message in context: 
http://drools.46999.n3.nabble.com/Property-access-on-Java-Beans-POJO-s-tp3509973p3509973.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] Property access on Java Beans (POJO's)

2011-11-15 Thread kapokfly
From the article provided I do see this, now the question is just how it
(register our own property resolver which is responsible to resolve some
special cases only, and in most cases our property resolver would delegate
the call to Drools' implementation) can be used with Drools together? Any
hint?  

/Other Features

*

  Property Handlers
  o

Allows registration of getter/setter handlers for a given class
type. Once registered all getter/setter invocation is delegated to this
instance.
*

  Pluggable Data Converters
  o

Data converters can be registered to handle to/from data
conversions between any class type.
/




-
Ivan, your Panda, forever
--
View this message in context: 
http://drools.46999.n3.nabble.com/Property-access-on-Java-Beans-POJO-s-tp3509973p3511446.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] Building our own UI for Drools

2011-11-14 Thread kapokfly
Due to some reasons (for example, build a consistent UI within our own
application, easier to work with our own meta data, don't want SSO etc), we
are considering to build our own UI to generate Drools rule file basing on
the user input via the UI , has anyone tried this before? Is there any
library shipped within Drools Gunvor can be used to be easier to work with
Drools rule syntax? 

Thanks,
Ivan

-
Ivan, your Panda, forever
--
View this message in context: 
http://drools.46999.n3.nabble.com/Building-our-own-UI-for-Drools-tp3508849p3508849.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] [rule engine advantage?]Logic and Data Separation - how to archieve the transparent domain/fact object insertion?

2011-11-13 Thread kapokfly
Logic and Data Separation
Your data is in your domain objects, the logic is in the rules. This is
fundamentally breaking the
OO coupling of data and logic, which can be an advantage or a disadvantage
depending on
your point of view. The upshot is that the logic can be much easier to
maintain as there are
changes in the future, as the logic is all laid out in rules. This can be
especially true if the logic
is cross-domain or multi-domain logic. Instead of the logic being spread
across many domain
objects or controllers, it can all be organized in one or more very distinct
rules files.


The current practice we are following demonstrate a strong relationship
between fact objects and the rule files itself, the rule needs to understand
what fact object available in the working memory and the working memory may
also consider what kind of rules can be written against objects in memory
thus the application developers need insert/write rules carefully and better
to be done by 1 developer (or we can say, depends on how the rule is
written, it will impact what objects/how objects are being inserted into the
working memory). 

Can someone share their experiences how to make the knowledge session/fact
object maintenance work as transparent as possible? how to decouple the fact
object maintenance work from the rules? At which layer you usually insert
fact object to the work memory? 

Ivan   




-
Ivan, your Panda, forever
--
View this message in context: 
http://drools.46999.n3.nabble.com/rule-engine-advantage-Logic-and-Data-Separation-how-to-archieve-the-transparent-domain-fact-object-i-tp3506131p3506131.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] Can't enter debug view with JBoss Developer Studio 4.1.0.GA on ubuntu

2011-11-12 Thread kapokfly
Does anyone has same problem? 

The debug breakpoint put on THEN part of a drools never gets entered with
JBoss Developer Studio 4.1.0.GA on Ubuntu...

-
Ivan, your Panda, forever
--
View this message in context: 
http://drools.46999.n3.nabble.com/Can-t-enter-debug-view-with-JBoss-Developer-Studio-4-1-0-GA-on-ubuntu-tp3502257p3502257.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] Showstopper issues for Drools Adoption in our organization

2011-11-11 Thread kapokfly
Not sure if these are also your questions you might have with the rule engine
adoption, but we have seen 2 showstopper issues for drools adoption in our
organization, or it is just because we are lack of some necessary knowledge. 

Issue 1) : pattern match for large data 

There are cases in a rule we need find matched records against a large
population of data and perform some actions.

Example:
From 2 millions employee directory, find those belongs to Depart1 and
with salary increased by 10% last year. 

Inserting all these employee's data into WorkingMemory is HUGE and
mission impossible, we can't simply load the entire db into the working
memory, do we have any other approach to accomplish or this is just not a
use case can be resolved by a rule engine?


Issue 2): Map business object to real engineering implementation

What we are trying to do is to build a rule UI which a business user without
engineering background of our codebase can work with; the business object we
show on the UI might be different with the real engineering objects already
in system, for example, on the UI a user might be able to able to see
something like person.address.addressLine1 but the actually implementation
might not be an object traverse implementation. 

Example, the model could be Long Person.addressId ; then referring to his
address we need another lookup and we want to hide such complexity to the
end user. 

The approach we took is to design a translation layer to translate the user
input to drools rule string, is this the right approach?

If not, any suggestions? I know Drools is mainly designed for developers but
just trying to see if there is any way we can work it around. 

Thanks and looking forward to your recommendations. 

Ivan








-
Ivan, your Panda, forever
--
View this message in context: 
http://drools.46999.n3.nabble.com/Showstopper-issues-for-Drools-Adoption-in-our-organization-tp3499367p3499367.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] Showstopper issues for Drools Adoption in our organization

2011-11-11 Thread kapokfly
Hi Edson, 

Thanks for the informative reply. Will take a look and see how we can
proceed and share our thought with you. 

Best wishes...

Ivan

-
Ivan, your Panda, forever
--
View this message in context: 
http://drools.46999.n3.nabble.com/Showstopper-issues-for-Drools-Adoption-in-our-organization-tp3499367p3499901.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] Security test cases for Drools

2011-11-10 Thread kapokfly
Thanks Thomas. 

We are in the middle to design both the strategy to secure ourselves and the
test cases need to be covered, do you have some kind of references available
for us otherwise we will work out our version. 





-
Ivan, your Panda, forever
--
View this message in context: 
http://drools.46999.n3.nabble.com/Security-test-cases-for-Drools-tp3494072p3496169.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] How to write Drools rule basing on a changed property?

2011-11-09 Thread kapokfly
Requirement: 

1) 
 Rule 
 When
 Person.address.address1 is changed 
 THEN 

2) Ideally we should have 2 objects, 1 for the old person instance, the
other for the new person instance so contextually the LHS equals to
oldPerson.address.address1 != newPerson.address.address1. 

A properties change listener might not be the best solution as it might span
multiple calls and the property change could be done on the web layer which
is out of the JBoss Drools knowledge session. 

Ivan

--
View this message in context: 
http://drools.46999.n3.nabble.com/How-to-write-Drools-rule-basing-on-a-changed-property-tp3492926p3492926.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] How to write Drools rule basing on a changed property?

2011-11-09 Thread kapokfly
Thanks, when I am saying person address is changed, our app only concerns
about its initial value and its final value, any change in the middle, we
don't care. 

Examples: 
   person.address.address1 starts with 'my addr1'
   
   later a couple of changes were made, say its final value is 'my addr1',
we treat it as no change and no middle rules should be fired. 

Even for the 2 objects approach, how I can write the rules to get the old
and new object matched correctly? 

They are both Person instances without any identity to tell which one is the
old which one is the new one, unless I enable some kinds of map/or list in
the rule and one structure to host only new objects and the other one hosts
only the old values?



--
View this message in context: 
http://drools.46999.n3.nabble.com/How-to-write-Drools-rule-basing-on-a-changed-property-tp3492926p3492979.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] How to write Drools rule basing on a changed property?

2011-11-09 Thread kapokfly
Yes, that is a Map base approach I am thinking. 

Now more questions:
 
global MapObject, Object oldObjectContext

WHEN
  $person: Person() 
  eval(((Person)oldObjectContext[$name]).jobTitle == $person.name)
THEN

Q1: without eval, the compiler will report error
Q2: without type cast, the compiler will also report error

Any suggestion how we can make it easier? 

Thanks...

--
View this message in context: 
http://drools.46999.n3.nabble.com/How-to-write-Drools-rule-basing-on-a-changed-property-tp3492926p3493956.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] Security test cases for Drools

2011-11-09 Thread kapokfly
Not sure if anyone can share their experiences what kind of test cases on
Drools security should be developed and ensured? 

As the rule is just a piece of codes in String format which can be hooked
into JVM, we can assume that might open some holes and necessary security
test cases need to be designed against. 

Anyone can share their experiences on this? 

Thanks... 

--
View this message in context: 
http://drools.46999.n3.nabble.com/Security-test-cases-for-Drools-tp3494072p3494072.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] integrate guvnor UI into your own application

2011-11-09 Thread kapokfly
Anyone tried to integrate the guvnor UI into your own application? 

Basically we want to have a integrated, uniformed UI with our application
rather than a separate one like Drools Guvnor does...

--
View this message in context: 
http://drools.46999.n3.nabble.com/integrate-guvnor-UI-into-your-own-application-tp3494093p3494093.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] integrate guvnor UI into your own application

2011-11-09 Thread kapokfly
Nice, will give a try. 

Another 2 questions you might be able to help:
1) The Guvnor UI is basing on technical models which is hard for a business
user to understand, especially when the current technical models
implementation is not so good (for example, not straightforward relationship
etc), is it possible to plugin another translation layer which allows
business user to see a nice business model and define rules as they like,
the system internally map to the technical models? 

2) Looks like the Guvnor UI editor does not support field expression in
value field, for example, person.name == person.aliasName, are we able to
enhance that? 

With your experience, do you see any major functionality Drools Guvnor is
missing? 

Thanks again...

--
View this message in context: 
http://drools.46999.n3.nabble.com/integrate-guvnor-UI-into-your-own-application-tp3494093p3494161.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] Security test cases for Drools

2011-11-09 Thread kapokfly
Thanks Edson.

We are developing a web based UI (if possible embed guvnor into our
application) and open the ability to customers to define their own rules, so
a company policy on this won't work. 

Will evaluate other concern points and have more discussions on this. 

Ivan

--
View this message in context: 
http://drools.46999.n3.nabble.com/Security-test-cases-for-Drools-tp3494072p3494170.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