Re: [rules-users] Validation flow - defer expression evaluation

2011-10-25 Thread peters
Hi,

I have added a subprocess to the flow, but the exception still occurs:

Caused by: [Error: null pointer or function not found: getName]
[Near : {... manager.getName().equals("tes }]
Would anyone have suggestions or know about best practices for handling this
kind of scenario? 

Thanks

--
View this message in context: 
http://drools.46999.n3.nabble.com/Validation-flow-defer-expression-evaluation-tp3447883p3450960.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] Validation flow - defer expression evaluation

2011-10-25 Thread peters
putting "$var: user.?manager.name" to avoid nullpointer in the business rule 
defeats the purpose of a sanity check upfront, as execution should fail if
the relation is empty. 
Nullpointers are not an elegant way to fail, and the stack trace gives no
clue in which rule the error occurred.

I was thinking of starting a seperate session to run validation. This is
cumbersome however, en I would like to find a way to solve this problem with
a process(rule) flow. I guess it's about rule activation occuring.
Is there a way to activate the business rules only when validation rules
have passed?

I will try starting a subprocess, and see if this activates the business
rules at the appropriate time in the flow.

Any suggestions to avoid this trial and error approach are most welcome.  

--
View this message in context: 
http://drools.46999.n3.nabble.com/Validation-flow-defer-expression-evaluation-tp3447883p3450736.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] Validation flow - defer expression evaluation

2011-10-24 Thread peters
Hi,

I was wondering which is the proper way to do sanity checks (not null
etc...) on a fact  before starting the actual business rules.
I have created a a ruleflow with a validation node (VALRFG) and a business
rule node (BRRFG) to determine execution order.
If in the validation node a not null constraint is violated, the session is
aborted (drools.halt()).
Problem with this approach is that assertions defined in rules of the
ruleflow-group "BRRFG" are validated before the validation rules execute. 
The engine throws exception  at
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:298)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:130).
...
at
org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:101)
at
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:291)

How can I make sure that the validation rules are executed before the mvel
expressions in the business rules are being evaluated? 


Thanks for feedback,


--
View this message in context: 
http://drools.46999.n3.nabble.com/Validation-flow-defer-expression-evaluation-tp3447883p3447883.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