[rules-users] BuildError: Unable to Analyse Expression BUT WORKING, how can I remove error

grules gshrestha at tmghealth.com
Thu Mar 27 13:41:03 EDT 2014


Yes, claimIdentificationInfo.claimType is String..
[cid:image001.png at 01CF49C2.1C7311A0]
Ok, I will re-read it.

Thanks Joe

From: Joe White-3 [via Drools] [mailto:ml-node+s46999n4028998h81 at n3.nabble.com]
Sent: Thursday, March 27, 2014 1:26 PM
To: Gopu Shrestha
Subject: Re: [rules-users] BuildError: Unable to Analyse Expression BUT WORKING, how can I remove error

Is claimIdentificationInfo.claimType a String? I bet not. You're trying to ask the rule if some arbitrary object is in a list of Strings. Which you can't do and is an error. I highly recommend reading or re-reading the main drools core docs. I don't think you understand how the logical statements you're trying to make map to your Java objects.

From: [hidden email]</user/SendEmail.jtp?type=node&node=4028998&i=0> [mailto:[hidden email]</user/SendEmail.jtp?type=node&node=4028998&i=1>] On Behalf Of grules
Sent: Thursday, March 27, 2014 11:13 AM
To: [hidden email]</user/SendEmail.jtp?type=node&node=4028998&i=2>
Subject: Re: [rules-users] BuildError: Unable to Analyse Expression BUT WORKING, how can I remove error

Same code with same dialect "MVEL", eclipse.ini also set as -Ddrools.dialect.mvel.strict = false

1.      Rule "testing claim rule" working without error and exception

2.      Rule "test1", doesn't work and throw exception incompatible types in statement (detail below)

3.      Rule "test1", with adding ".value" executes but shows error "Unable to Analyse Expression"

Where did I missed???

//Rule>>>-------------Working
rule "testing claim rule"
when
       $claim: Claim($sd: submittedClaimID !=null, $sd =="130430007700");
Then
System.out.println("...SCID..."+$sd.getValue());
End


//class & MVEL property>>----------------
submittedClaimID
String<http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true> submittedClaimID
PROPERTY
submittedClaimID


MVEL Property Summary

Type Properties: provides information about a piece of data

 String<http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true>

submittedClaimID<../../../../com/edifecs/domain/echcf/Claim.html#property_getSubmittedClaimID()>



//NOT WORKING ERROR IS AS BELOW

//Rule>>>-------------Not Working

rule "test1"

when
       $claim: Claim(claimIdentificationInfo !=null, claimIdentificationInfo.claimType !=null, claimIdentificationInfo.claimType in ("H", "I", "G"))

then
       System.out.println("...ctype...is EXECUTING....");
end


Console Error:

[Error: incompatible types in statement: class java.lang.String (compared from: class com.somecompanyName.xml.schema.ucf.TPropertyString)]
[Near : {... claimIdentificationInfo.claimT ....}]

// WORKING BUT IT SHOWS ERROR

//Rule>>>-------------Working
rule "test1"

when
       $claim: Claim(claimIdentificationInfo !=null, claimIdentificationInfo.claimType !=null, claimIdentificationInfo.claimType.value in ("H", "I", "G"))
then
       System.out.println("...ctype...is EXECUTING....");
end

Console Output:
...ctype...is EXECUTING....

Shows error in code..
[Error: unable to resolve method using strict-mode: java.lang.String.value()]


From: Joe White-3 [via Drools] [mailto:ml-node+[hidden email]</user/SendEmail.jtp?type=node&node=4028997&i=0>]
Sent: Wednesday, March 26, 2014 5:42 PM
To: Gopu Shrestha
Subject: Re: [rules-users] BuildError: Unable to Analyse Expression BUT WORKING, how can I remove error

Remove the "<" characters. But it will still return an error. The error is valid. There is no method called getValue() on String.

From: [hidden email]</user/SendEmail.jtp?type=node&node=4028980&i=0> [mailto:[hidden email]</user/SendEmail.jtp?type=node&node=4028980&i=1>] On Behalf Of grules
Sent: Wednesday, March 26, 2014 2:51 PM
To: [hidden email]</user/SendEmail.jtp?type=node&node=4028980&i=2>
Subject: Re: [rules-users] BuildError: Unable to Analyse Expression BUT WORKING, how can I remove error

Hi Joe,
The eclipse is working and I inserted "-Ddrools.dialect.mvel.strict = <false>" but the error still popping up.

Return type is String.

Thank you for your help..

From: Joe White-3 [via Drools] [mailto:ml-node+[hidden email]</user/SendEmail.jtp?type=node&node=4028978&i=0>]
Sent: Wednesday, March 26, 2014 4:41 PM
To: Gopu Shrestha
Subject: Re: [rules-users] BuildError: Unable to Analyse Expression BUT WORKING, how can I remove error

You're supposed to pick a value for that one. Either true or false. It is a property. You may also need the -D.

I'm asking what is the return type on getProviderClaimNumber() and does that type have a getValue method?

From: [hidden email]</user/SendEmail.jtp?type=node&node=4028976&i=0> [mailto:[hidden email]</user/SendEmail.jtp?type=node&node=4028976&i=1>] On Behalf Of grules
Sent: Wednesday, March 26, 2014 2:12 PM
To: [hidden email]</user/SendEmail.jtp?type=node&node=4028976&i=2>
Subject: Re: [rules-users] BuildError: Unable to Analyse Expression BUT WORKING, how can I remove error

Hi Joe,

The getProviderClaimNumber return? i.e. System.out.println(".......java (getter/setter)...providerClaimNumber.."+$claim.getClaimIdentificationInfo().getProviderClaimNumber().getValue())

Same value "130430007701"
As $claim.claimIdentificationInfo.providerClaimNumber.value Do i.e. 130430007701

Now for My Eclipse didn't open when I added drools.dialect.mvel.strict =<true|false>

I just added like this in eclipse.ini
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20120913-144807
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Dhelp.lucene.tokenizer=standard
-Xms40m
-Xmx512m

drools.dialect.mvel.strict = <true|false>


From: Joe White-3 [via Drools] [mailto:ml-node+[hidden email]</user/SendEmail.jtp?type=node&node=4028974&i=0>]
Sent: Wednesday, March 26, 2014 3:56 PM
To: Gopu Shrestha
Subject: Re: [rules-users] BuildError: Unable to Analyse Expression BUT WORKING, how can I remove error

I haven't done it in a long time but I think you have to disable strict mode in your eclipse ini file

>From the docs:
drools.dialect.mvel.strict = <true|false>

I can't swear that will work though.  What does getProviderClaimNumber return? Does it actually have a getValue() method?

From: [hidden email]</user/SendEmail.jtp?type=node&node=4028973&i=0> [mailto:[hidden email]</user/SendEmail.jtp?type=node&node=4028973&i=1>] On Behalf Of Gopu Shrestha
Sent: Wednesday, March 26, 2014 1:29 PM
To: Rules Users List
Subject: [rules-users] BuildError: Unable to Analyse Expression BUT WORKING, how can I remove error

It is so annoying to see an error marks in Eclipse Juno with Drools Plug in. However the code is working fine...
How can clean up this error??? Please advise...


[http://drools.46999.n3.nabble.com/attachment/4028973/0/image001.png]

Error Message!!!!!
BuildError: Unable to Analyse Expression System.out.println(".......java (getter/setter)...providerClaimNumber.."+$claim.getClaimIdentificationInfo().getProviderClaimNumber().getValue());
                System.out.println("......mvel...providerClaimNumber.."+$claim.claimIdentificationInfo.providerClaimNumber.value);
                System.out.println("...ctype..."+$ct.value);:
[Error: unable to resolve method using strict-mode: java.lang.String.getValue()]
[Near : {... oviderClaimNumber().getValue()); ....}]
                                                                                                                  ^
[Line: 32, Column: 0]


Console Output:....
.......java (getter/setter)...providerClaimNumber..130430007701
......mvel...providerClaimNumber..130430007701
...ctype...I


_______________________________________________
rules-users mailing list
[hidden email]</user/SendEmail.jtp?type=node&node=4028973&i=2>
https://lists.jboss.org/mailman/listinfo/rules-users
________________________________
If you reply to this email, your message will be added to the discussion below:
http://drools.46999.n3.nabble.com/rules-users-BuildError-Unable-to-Analyse-Expression-BUT-WORKING-how-can-I-remove-error-tp4028972p4028973.html
To start a new topic under Drools: User forum, email [hidden email]</user/SendEmail.jtp?type=node&node=4028974&i=1>
To unsubscribe from Drools, click here.
NAML<http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>

________________________________
View this message in context: RE: [rules-users] BuildError: Unable to Analyse Expression BUT WORKING, how can I remove error<http://drools.46999.n3.nabble.com/rules-users-BuildError-Unable-to-Analyse-Expression-BUT-WORKING-how-can-I-remove-error-tp4028972p4028974.html>
Sent from the Drools: User forum mailing list archive<http://drools.46999.n3.nabble.com/Drools-User-forum-f47000.html> at Nabble.com.

_______________________________________________
rules-users mailing list
[hidden email]</user/SendEmail.jtp?type=node&node=4028976&i=3>
https://lists.jboss.org/mailman/listinfo/rules-users
________________________________
If you reply to this email, your message will be added to the discussion below:
http://drools.46999.n3.nabble.com/rules-users-BuildError-Unable-to-Analyse-Expression-BUT-WORKING-how-can-I-remove-error-tp4028972p4028976.html
To start a new topic under Drools: User forum, email [hidden email]</user/SendEmail.jtp?type=node&node=4028978&i=1>
To unsubscribe from Drools, click here.
NAML<http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>

________________________________
View this message in context: RE: [rules-users] BuildError: Unable to Analyse Expression BUT WORKING, how can I remove error<http://drools.46999.n3.nabble.com/rules-users-BuildError-Unable-to-Analyse-Expression-BUT-WORKING-how-can-I-remove-error-tp4028972p4028978.html>
Sent from the Drools: User forum mailing list archive<http://drools.46999.n3.nabble.com/Drools-User-forum-f47000.html> at Nabble.com.

_______________________________________________
rules-users mailing list
[hidden email]</user/SendEmail.jtp?type=node&node=4028980&i=3>
https://lists.jboss.org/mailman/listinfo/rules-users
________________________________
If you reply to this email, your message will be added to the discussion below:
http://drools.46999.n3.nabble.com/rules-users-BuildError-Unable-to-Analyse-Expression-BUT-WORKING-how-can-I-remove-error-tp4028972p4028980.html
To start a new topic under Drools: User forum, email [hidden email]</user/SendEmail.jtp?type=node&node=4028997&i=1>
To unsubscribe from Drools, click here.
NAML<http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>

________________________________
View this message in context: RE: [rules-users] BuildError: Unable to Analyse Expression BUT WORKING, how can I remove error<http://drools.46999.n3.nabble.com/rules-users-BuildError-Unable-to-Analyse-Expression-BUT-WORKING-how-can-I-remove-error-tp4028972p4028997.html>
Sent from the Drools: User forum mailing list archive<http://drools.46999.n3.nabble.com/Drools-User-forum-f47000.html> at Nabble.com.

_______________________________________________
rules-users mailing list
[hidden email]</user/SendEmail.jtp?type=node&node=4028998&i=3>
https://lists.jboss.org/mailman/listinfo/rules-users
________________________________
If you reply to this email, your message will be added to the discussion below:
http://drools.46999.n3.nabble.com/rules-users-BuildError-Unable-to-Analyse-Expression-BUT-WORKING-how-can-I-remove-error-tp4028972p4028998.html
To start a new topic under Drools: User forum, email ml-node+s46999n47000h43 at n3.nabble.com<mailto:ml-node+s46999n47000h43 at n3.nabble.com>
To unsubscribe from Drools, click here<http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=46999&code=Z3NocmVzdGhhQHRtZ2hlYWx0aC5jb218NDY5OTl8LTQ5MTIwOTgwMg==>.
NAML<http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>


image001.png (32K) <http://drools.46999.n3.nabble.com/attachment/4028999/0/image001.png>




--
View this message in context: http://drools.46999.n3.nabble.com/rules-users-BuildError-Unable-to-Analyse-Expression-BUT-WORKING-how-can-I-remove-error-tp4028972p4028999.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20140327/70c4768d/attachment-0001.html 


More information about the rules-users mailing list