Re: [rules-users] Unterminated String Literal error

2011-02-17 Thread Wolfgang Laun
There is a semicolon missing after break in line 39.

The drools.inse in the error message is very strange. Are you
compiling other rules as well?

Don't use dialect mvel when you aren't using mvel.
-W

On 17 February 2011 00:37, StormeHawke brian.trez...@intellidata.net wrote:


 Esteban wrote:

 shouldn't that be: inputType.toString() //No capital i ??


 Yes it should, thanks for catching that.  Unfortunately there must still be
 more problems because I'm still getting the error.  I'm thrown by the fact
 that it's telling me I've got an unterminated string literal, it's not
 making sense:


 Error: Unable to build expression for 'consequence': [Error: unterminated
 string literal]
 [Near : {... }
                };

                drools.inse }]
                  ^
 [Line: 43, Column: 4] '         PriceResult result = new
 PriceResult($priceRequest.getClient(), $priceRequest.getRequestedPn());
                for(InputType inputType : $priceDataRecord.keyset())
                {
                        String label = inputType.getPropertyName();
                        Object value = $priceDataRecord.get(inputType);
                        ValueType valueType = null;
                        String valueDisplay = null;
                        switch(inputType)
                        {
                                //Don't add ID and PN to the result - ID is 
 unnecessary and PN is
 included as a separate property
                                case ID:
                                case PN:
                                        break;

                                case PACKAGE_UNIT:
                                        valueType = ValueType.INTEGER;
                                        valueDisplay = value.toString();
                                        break;

                                case MOQ_1:
                                case MOQ2:
                                        valueType = ValueType.INTEGER;
                                        valueDisplay = value.toString();
                                        break

                                case PRICE_1:
                                case PRICE_2:
                                        valueType = ValueType.BIG_DECIMAL;
                                        valueDisplay = value.toString();
                                        break;

                                case LEAD_TIME:
                                        valueType = ValueType.DOUBLE;
                                        valueDisplay = value.toString();
                                        break;

                                default:
                                        throw new 
 IllegalArgumentException(InputType  + inputType.toString()
 +  is not defined for  + $priceRequest.getClient().getName());
                        }

                        if(valueType != null)
                        {
                                PriceValue priceValue = new PriceValue(label, 
 value, valueType,
 valueDisplay);
                                result.put(label, priceValue);
                        }
                }

                insert(result);
 ' : [Rule name='someclient-default rule']

 --
 View this message in context: 
 http://drools-java-rules-engine.46999.n3.nabble.com/Unterminated-String-Literal-error-tp2513857p2514050.html
 Sent from the Drools - User 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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Unterminated String Literal error

2011-02-17 Thread StormeHawke

scratch that last question.  I've got a cold this week, not thinking 
straight lol

On 2/17/2011 1:31 AM, Wolfgang Laun-2 [via Drools - Java Rules Engine] 
wrote:
 There is a semicolon missing after break in line 39.

 The drools.inse in the error message is very strange. Are you
 compiling other rules as well?

 Don't use dialect mvel when you aren't using mvel.
 -W

 On 17 February 2011 00:37, StormeHawke [hidden email] 
 /user/SendEmail.jtp?type=nodenode=2516479i=0 wrote:

 
 
  Esteban wrote:
 
  shouldn't that be: inputType.toString() //No capital i ??
 
 
  Yes it should, thanks for catching that.  Unfortunately there must 
 still be
  more problems because I'm still getting the error.  I'm thrown by 
 the fact
  that it's telling me I've got an unterminated string literal, it's not
  making sense:
 
 
  Error: Unable to build expression for 'consequence': [Error: 
 unterminated
  string literal]
  [Near : {... }
 };
 
 drools.inse }]
   ^
  [Line: 43, Column: 4] ' PriceResult result = new
  PriceResult($priceRequest.getClient(), $priceRequest.getRequestedPn());
 for(InputType inputType : $priceDataRecord.keyset())
 {
 String label = inputType.getPropertyName();
 Object value = $priceDataRecord.get(inputType);
 ValueType valueType = null;
 String valueDisplay = null;
 switch(inputType)
 {
 //Don't add ID and PN to the result - 
 ID is unnecessary and PN is
  included as a separate property
 case ID:
 case PN:
 break;
 
 case PACKAGE_UNIT:
 valueType = ValueType.INTEGER;
 valueDisplay = value.toString();
 break;
 
 case MOQ_1:
 case MOQ2:
 valueType = ValueType.INTEGER;
 valueDisplay = value.toString();
 break
 
 case PRICE_1:
 case PRICE_2:
 valueType = 
 ValueType.BIG_DECIMAL;
 valueDisplay = value.toString();
 break;
 
 case LEAD_TIME:
 valueType = ValueType.DOUBLE;
 valueDisplay = value.toString();
 break;
 
 default:
 throw new 
 IllegalArgumentException(InputType  + inputType.toString()
  +  is not defined for  + $priceRequest.getClient().getName());
 }
 
 if(valueType != null)
 {
 PriceValue priceValue = new 
 PriceValue(label, value, valueType,
  valueDisplay);
 result.put(label, priceValue);
 }
 }
 
 insert(result);
  ' : [Rule name='someclient-default rule']
 
  --
  View this message in context: 
 http://drools-java-rules-engine.46999.n3.nabble.com/Unterminated-String-Literal-error-tp2513857p2514050.html
  
 http://drools-java-rules-engine.46999.n3.nabble.com/Unterminated-String-Literal-error-tp2513857p2514050.html?by-user=t
  Sent from the Drools - User mailing list archive at Nabble.com.
  ___
  rules-users mailing list
  [hidden email] /user/SendEmail.jtp?type=nodenode=2516479i=1
  https://lists.jboss.org/mailman/listinfo/rules-users
 

 ___
 rules-users mailing list
 [hidden email] /user/SendEmail.jtp?type=nodenode=2516479i=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-java-rules-engine.46999.n3.nabble.com/Unterminated-String-Literal-error-tp2513857p2516479.html
  

 To unsubscribe from Unterminated String Literal error, click here 
 http://drools-java-rules-engine.46999.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=2513857code=QnJpYW4uVHJlemlzZUBpbnRlbGxpZGF0YS5uZXR8MjUxMzg1N3wtMjA3MDc3MTQ0MA==.
  


-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Unterminated-String-Literal-error-tp2513857p2519739.html
Sent from the Drools - User mailing list archive at Nabble.com.

Re: [rules-users] Unterminated String Literal error

2011-02-17 Thread StormeHawke

Thanks, killing mvel got it, the error messages are almost making sense 
now.  Any idea why it would tell me the method keyset() is undefined for 
an object that extends HashMap?

On 2/17/2011 1:31 AM, Wolfgang Laun-2 [via Drools - Java Rules Engine] 
wrote:
 There is a semicolon missing after break in line 39.

 The drools.inse in the error message is very strange. Are you
 compiling other rules as well?

 Don't use dialect mvel when you aren't using mvel.
 -W

 On 17 February 2011 00:37, StormeHawke [hidden email] 
 /user/SendEmail.jtp?type=nodenode=2516479i=0 wrote:

 
 
  Esteban wrote:
 
  shouldn't that be: inputType.toString() //No capital i ??
 
 
  Yes it should, thanks for catching that.  Unfortunately there must 
 still be
  more problems because I'm still getting the error.  I'm thrown by 
 the fact
  that it's telling me I've got an unterminated string literal, it's not
  making sense:
 
 
  Error: Unable to build expression for 'consequence': [Error: 
 unterminated
  string literal]
  [Near : {... }
 };
 
 drools.inse }]
   ^
  [Line: 43, Column: 4] ' PriceResult result = new
  PriceResult($priceRequest.getClient(), $priceRequest.getRequestedPn());
 for(InputType inputType : $priceDataRecord.keyset())
 {
 String label = inputType.getPropertyName();
 Object value = $priceDataRecord.get(inputType);
 ValueType valueType = null;
 String valueDisplay = null;
 switch(inputType)
 {
 //Don't add ID and PN to the result - 
 ID is unnecessary and PN is
  included as a separate property
 case ID:
 case PN:
 break;
 
 case PACKAGE_UNIT:
 valueType = ValueType.INTEGER;
 valueDisplay = value.toString();
 break;
 
 case MOQ_1:
 case MOQ2:
 valueType = ValueType.INTEGER;
 valueDisplay = value.toString();
 break
 
 case PRICE_1:
 case PRICE_2:
 valueType = 
 ValueType.BIG_DECIMAL;
 valueDisplay = value.toString();
 break;
 
 case LEAD_TIME:
 valueType = ValueType.DOUBLE;
 valueDisplay = value.toString();
 break;
 
 default:
 throw new 
 IllegalArgumentException(InputType  + inputType.toString()
  +  is not defined for  + $priceRequest.getClient().getName());
 }
 
 if(valueType != null)
 {
 PriceValue priceValue = new 
 PriceValue(label, value, valueType,
  valueDisplay);
 result.put(label, priceValue);
 }
 }
 
 insert(result);
  ' : [Rule name='someclient-default rule']
 
  --
  View this message in context: 
 http://drools-java-rules-engine.46999.n3.nabble.com/Unterminated-String-Literal-error-tp2513857p2514050.html
  
 http://drools-java-rules-engine.46999.n3.nabble.com/Unterminated-String-Literal-error-tp2513857p2514050.html?by-user=t
  Sent from the Drools - User mailing list archive at Nabble.com.
  ___
  rules-users mailing list
  [hidden email] /user/SendEmail.jtp?type=nodenode=2516479i=1
  https://lists.jboss.org/mailman/listinfo/rules-users
 

 ___
 rules-users mailing list
 [hidden email] /user/SendEmail.jtp?type=nodenode=2516479i=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-java-rules-engine.46999.n3.nabble.com/Unterminated-String-Literal-error-tp2513857p2516479.html
  

 To unsubscribe from Unterminated String Literal error, click here 
 http://drools-java-rules-engine.46999.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=2513857code=QnJpYW4uVHJlemlzZUBpbnRlbGxpZGF0YS5uZXR8MjUxMzg1N3wtMjA3MDc3MTQ0MA==.
  


-- 
View this message in context: 

Re: [rules-users] Unterminated String Literal error

2011-02-17 Thread Wolfgang Laun
2011/2/17 StormeHawke brian.trez...@intellidata.net

 Thanks, killing mvel got it, the error messages are almost making sense
 now.  Any idea why it would tell me the method keyset() is undefined for an
 object that extends HashMap?


Yes: because it is. --- keyset != keySet
-W




 On 2/17/2011 1:31 AM, Wolfgang Laun-2 [via Drools - Java Rules Engine]
 wrote:

 There is a semicolon missing after break in line 39.

 The drools.inse in the error message is very strange. Are you
 compiling other rules as well?

 Don't use dialect mvel when you aren't using mvel.
 -W

 On 17 February 2011 00:37, StormeHawke [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=2516479i=0by-user=t
 wrote:

 
 
  Esteban wrote:
 
  shouldn't that be: inputType.toString() //No capital i ??
 
 
  Yes it should, thanks for catching that.  Unfortunately there must still
 be
  more problems because I'm still getting the error.  I'm thrown by the
 fact
  that it's telling me I've got an unterminated string literal, it's not
  making sense:
 
 
  Error: Unable to build expression for 'consequence': [Error: unterminated

  string literal]
  [Near : {... }
 };
 
 drools.inse }]
   ^
  [Line: 43, Column: 4] ' PriceResult result = new
  PriceResult($priceRequest.getClient(), $priceRequest.getRequestedPn());
 for(InputType inputType : $priceDataRecord.keyset())
 {
 String label = inputType.getPropertyName();
 Object value = $priceDataRecord.get(inputType);
 ValueType valueType = null;
 String valueDisplay = null;
 switch(inputType)
 {
 //Don't add ID and PN to the result - ID
 is unnecessary and PN is
  included as a separate property
 case ID:
 case PN:
 break;
 
 case PACKAGE_UNIT:
 valueType = ValueType.INTEGER;
 valueDisplay = value.toString();
 break;
 
 case MOQ_1:
 case MOQ2:
 valueType = ValueType.INTEGER;
 valueDisplay = value.toString();
 break
 
 case PRICE_1:
 case PRICE_2:
 valueType = ValueType.BIG_DECIMAL;

 valueDisplay = value.toString();
 break;
 
 case LEAD_TIME:
 valueType = ValueType.DOUBLE;
 valueDisplay = value.toString();
 break;
 
 default:
 throw new
 IllegalArgumentException(InputType  + inputType.toString()
  +  is not defined for  + $priceRequest.getClient().getName());
 }
 
 if(valueType != null)
 {
 PriceValue priceValue = new
 PriceValue(label, value, valueType,
  valueDisplay);
 result.put(label, priceValue);
 }
 }
 
 insert(result);
  ' : [Rule name='someclient-default rule']
 
  --
  View this message in context:
 http://drools-java-rules-engine.46999.n3.nabble.com/Unterminated-String-Literal-error-tp2513857p2514050.htmlhttp://drools-java-rules-engine.46999.n3.nabble.com/Unterminated-String-Literal-error-tp2513857p2514050.html?by-user=tby-user=t
  Sent from the Drools - User mailing list archive at Nabble.com.
  ___
  rules-users mailing list
  [hidden 
  email]http://user/SendEmail.jtp?type=nodenode=2516479i=1by-user=t
  https://lists.jboss.org/mailman/listinfo/rules-users
 

 ___
 rules-users mailing list
 [hidden email]http://user/SendEmail.jtp?type=nodenode=2516479i=2by-user=t
 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-java-rules-engine.46999.n3.nabble.com/Unterminated-String-Literal-error-tp2513857p2516479.htmlhttp://drools-java-rules-engine.46999.n3.nabble.com/Unterminated-String-Literal-error-tp2513857p2516479.html?by-user=t
  To unsubscribe from Unterminated String Literal error, click 
 

[rules-users] Unterminated String Literal error

2011-02-16 Thread StormeHawke

I'm getting an error as follows:
Error: Unable to build expression for 'consequence': [Error: unterminated
string literal]
[Near : {... label, priceValue);
}
} }]

I've combed the file looking for any stray quote characters, did a ctrl + f
and verified that all my string literals are closed, all my lines of code
have their appropriate ; terminations... I'm sure I'm probably missing
something obvious, but can somebody take a look for me?

I'm using Drools version 5.1.0; my rule file is below.


package net.intellidata.pricing.rules

import net.intellidata.pricing.data.model.PriceDataRecord;
import net.intellidata.pricing.PriceRequest;
import net.intellidata.pricing.result.PriceResult;
import net.intellidata.pricing.result.ValueType;
import net.intellidata.pricing.result.PriceValue;
import net.intellidata.pricing.data.InputType;

rule someclient-default rule
dialect mvel
when 
$priceRequest : PriceRequest( )
$priceDataRecord : PriceDataRecord( )
then
PriceResult result = new PriceResult($priceRequest.getClient(),
$priceRequest.getRequestedPn());
for(InputType inputType : $priceDataRecord.keyset())
{
String label = inputType.getPropertyName();
Object value = $priceDataRecord.get(inputType);
ValueType valueType = null;
String valueDisplay = null;
switch(inputType)
{
//Don't add ID and PN to the result - ID is 
unnecessary and PN is
included as a separate property
case ID:
case PN:
break;

case PACKAGE_UNIT:
valueType = ValueType.INTEGER;
valueDisplay = value.toString();
break;

case MOQ_1:
case MOQ2:
valueType = ValueType.INTEGER;
valueDisplay = value.toString();
break

case PRICE_1:
case PRICE_2:
valueType = ValueType.BIG_DECIMAL;
valueDisplay = value.toString();
break;

case LEAD_TIME:
valueType = ValueType.DOUBLE;
valueDisplay = value.toString();
break;

default:
throw new 
IllegalArgumentException(InputType  + InputType.toString()
+  is not defined for  + $priceRequest.getClient().getName());
}

if(valueType != null)
{
PriceValue priceValue = new PriceValue(label, 
value, valueType,
valueDisplay); 
result.put(label, priceValue);
}
}
end

-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Unterminated-String-Literal-error-tp2513857p2513857.html
Sent from the Drools - User 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] Unterminated String Literal error

2011-02-16 Thread Esteban Aliverti
throw new IllegalArgumentException(InputType  + InputType.toString()
+  is not defined for  + $priceRequest.getClient().getName());

shouldn't that be: inputType.toString() //No capital i ??

Best Regards,



Esteban Aliverti
- Developer @ http://www.plugtree.com
- Blog @ http://ilesteban.wordpress.com


On Wed, Feb 16, 2011 at 8:13 PM, StormeHawke
brian.trez...@intellidata.netwrote:

 throw new IllegalArgumentException(InputType  + InputType.toString()
 +  is not defined for  + $priceRequest.getClient().getName());

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Unterminated String Literal error

2011-02-16 Thread StormeHawke


Esteban wrote:
 
 shouldn't that be: inputType.toString() //No capital i ??
 

Yes it should, thanks for catching that.  Unfortunately there must still be
more problems because I'm still getting the error.  I'm thrown by the fact
that it's telling me I've got an unterminated string literal, it's not
making sense:


Error: Unable to build expression for 'consequence': [Error: unterminated
string literal]
[Near : {... }
};

drools.inse }]
  ^
[Line: 43, Column: 4] ' PriceResult result = new
PriceResult($priceRequest.getClient(), $priceRequest.getRequestedPn());
for(InputType inputType : $priceDataRecord.keyset())
{
String label = inputType.getPropertyName();
Object value = $priceDataRecord.get(inputType);
ValueType valueType = null;
String valueDisplay = null;
switch(inputType)
{
//Don't add ID and PN to the result - ID is 
unnecessary and PN is
included as a separate property
case ID:
case PN:
break;

case PACKAGE_UNIT:
valueType = ValueType.INTEGER;
valueDisplay = value.toString();
break;

case MOQ_1:
case MOQ2:
valueType = ValueType.INTEGER;
valueDisplay = value.toString();
break

case PRICE_1:
case PRICE_2:
valueType = ValueType.BIG_DECIMAL;
valueDisplay = value.toString();
break;

case LEAD_TIME:
valueType = ValueType.DOUBLE;
valueDisplay = value.toString();
break;

default:
throw new 
IllegalArgumentException(InputType  + inputType.toString()
+  is not defined for  + $priceRequest.getClient().getName());
}

if(valueType != null)
{
PriceValue priceValue = new PriceValue(label, 
value, valueType,
valueDisplay); 
result.put(label, priceValue);
}
}

insert(result);
' : [Rule name='someclient-default rule']

-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Unterminated-String-Literal-error-tp2513857p2514050.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users