You would write rules for checking the fields of Employes, e.g.,<br><br>rule "must have department"<br>when<br> $e: Employee( department == null )<br>then<br> Errors e = new Errors();<br> e.setFieldName( "department" );<br>
e.setMessage( "missing value" );<br> e.setEmployee( $e );<br> insert( e );<br>end<br><br>You might not have to insert e. You might want to retract the Employee fact.<br>-W<br><br><div class="gmail_quote">
On 6 May 2012 20:46, Ini <span dir="ltr"><<a href="mailto:inder.14@gmail.com" target="_blank">inder.14@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Laune...Thanks for the quick reply..i believe i was not clear about my<br>
while asking....let me give an example..<br>
say i have an employee bean with properties the name, id, age, department<br>
etc and i have an error bean say Errors with properties like fieldName,<br>
message, expectedValue etc..<br>
Now as per my requirement i have to validate all the properties of my<br>
employee bean and in case some properties don't meet the expectation then<br>
update the Errors object with suitable values and use the update Errors bean<br>
for different purposes...<br>
<br>
I could not see any example on this line..<br>
Hope i am making some sense here<br>
<br>
How can i achieve above mentioned scenario.<br>
<br>
Thanks in advance..<br>
Ini<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Updating-a-user-defined-error-object-using-drools-tp3966631p3966753.html" target="_blank">http://drools.46999.n3.nabble.com/Updating-a-user-defined-error-object-using-drools-tp3966631p3966753.html</a><br>
Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div><br>