What is RegistrationDeregistrationPersistence?<br><br>Is it a Fact to be reasoned over or a verification service?<br><br>If a verification service I *would* use this as a global changing your rule to:-<br><br>rule "User Name validation check rule"<br>
when<br>
$serviceContext : ServiceContext()<br>
eval( myService.validateUserName( $serviceContext ) )<br><div class="im">
then<br>
throw new Error("USER ID is invalid");<br>
end<br>
</div><br>Where "myService" is a global called "myService" of type RegistrationDeregistrationPersistence.<br><br>I removed the "<= -1" but you could include it (IMO the service should return true or false).<br>
<br><div class="gmail_quote">On 15 December 2011 16:59, Venkat <span dir="ltr"><<a href="mailto:ven12344@yahoo.com">ven12344@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Manstis, can you please tell me what is wrong with this rule<br>
<div class="im"><br>
<br>
rule "User Name validation check rule"<br>
</div><div class="im"> when<br>
$serviceContext : ServiceContext()<br>
RegistrationDeregistrationPersistence( eval( validateUserName(<br>
$serviceContext ) <= -1 ) ) // condition<br>
then<br>
throw new Error("USER ID is invalid"); // consequence<br>
end<br>
<br>
<br>
</div>I am getting this RuntimeException<br>
<br>
<br>
<br>
java.lang.RuntimeException: Rule Compilation error : [Rule name='User Name<br>
validation check rule']<br>
<br>
com/ge/energy/drms/external/integration/service/impl/Rule_User_Name_validation_check_rule.java<br>
(9:1042) : The method validateUserName(ServiceContext) is undefined for the<br>
type Rule_User_Name_validation_check_rule<br>
<br>
<br>
at<br>
com.ge.energy.drms.external.integration.service.impl.PANDeviceRegistrationServiceImpl.createKnowledgeBase(PANDeviceRegistrationServiceImpl.java:142)<br>
at<br>
com.ge.energy.drms.external.integration.service.impl.PANDeviceRegistrationServiceImpl.provisionPANDevice(PANDeviceRegistrationServiceImpl.java:77)<br>
at<br>
com.ge.energy.drms.external.integration.service.impl.test.ProvisionPanDeviceRequestValidationTest.testCustomerAndServiceContext(ProvisionPanDeviceRequestValidationTest.java:39)<br>
<div><div class="h5"> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
at<br>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>
at<br>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>
at java.lang.reflect.Method.invoke(Method.java:597)<br>
at junit.framework.TestCase.runTest(TestCase.java:168)<br>
at junit.framework.TestCase.runBare(TestCase.java:134)<br>
at junit.framework.TestResult$1.protect(TestResult.java:110)<br>
at junit.framework.TestResult.runProtected(TestResult.java:128)<br>
at junit.framework.TestResult.run(TestResult.java:113)<br>
at junit.framework.TestCase.run(TestCase.java:124)<br>
at junit.framework.TestSuite.runTest(TestSuite.java:232)<br>
at junit.framework.TestSuite.run(TestSuite.java:227)<br>
at<br>
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)<br>
at<br>
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)<br>
at<br>
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)<br>
at<br>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)<br>
at<br>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)<br>
at<br>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)<br>
at<br>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)<br>
<br>
<br>
</div></div>Thanks,<br>
<span class="HOEnZb"><font color="#888888">Venkat.<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Eval0Invoker-java-lang-NullPointerException-tp3586222p3589227.html" target="_blank">http://drools.46999.n3.nabble.com/Eval0Invoker-java-lang-NullPointerException-tp3586222p3589227.html</a><br>
</font></span><div class="HOEnZb"><div class="h5">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>
</div></div></blockquote></div><br>