You can't construct a Value with a type RU.ANY.

If the Slot doesn't provide the information, you'll have to obtain this
information from elsewhere; in getJessValue you have the value as a String,
and no other information. With a String being passed to the Value
constructor, you have the options RU.STRING and RU.SYMBOL. -- See Javadoc
for jess.Value.

-W


On 22 September 2010 07:04, Donald Winston <[email protected]> wrote:

> When the "slotType" is "ANY" my value is "<UNKNOWN>". So the RU.ANY data
> type cannot be used this way and I have to use one of the others?
>
> ...
> fact.setSlotValue(name, getJessValue(slotType, value));
> ...
>
> private Value getJessValue(String type, String value) throws JessException
> {
> if ("ANY".equals(type) == true)
> return new Value(value, RU.ANY);
> else if ("STRING".equals(type) == true)
> return new Value(value, RU.STRING);
> else if ("INTEGER".equals(type) == true)
> return new Value(Integer.parseInt(value), RU.INTEGER);
> else if ("FLOAT".equals(type) == true)
> return new Value(Float.parseFloat(value), RU.FLOAT);
> else if ("SYMBOL".equals(type) == true)
> return new Value(value, RU.SYMBOL);
> else if ("LONG".equals(type) == true)
> return new Value(Long.parseLong(value), RU.LONG);
> else
> return new Value(value, RU.ANY);
> }
>

Reply via email to