Hi Jonathon,

(it's Howe btw, no "s")

I wouldn't agree with that approach.  A map is empty if it has no
name/value pairs, not if one (or all) of the name/value pairs is empty.
To attempt the test that you're trying, either test the actual field
that you're interested in or if unknown run an iterate-map and set the
value of some field (to if-not-empty test later) to a value if you
encounter an empty field.  Remember that the simple methods are
primarily for business logic not a replacement for java, so if you're
running into complicated scenarios you may want to rethink whether
logic is "business" or if it's application.

If you're simply looking to avoid resetting the server or rebuilding
your packages, you can still use the <call-bsh><![CDATA[ and run
beanshell inside of it, just make sure you return the field before
exiting ]]></call-bsh>.


--- Jonathon -- Improov <[EMAIL PROTECTED]> wrote:

> Hey Chris (Howes),
> 
> I think you use Minilang a lot, so I really need your advice.
> 
> Currently, <if-empty field-name="someMap"> returns false even if
> "someMap" contains keys pointing 
> to empty values. See Java method ObjectType.isEmpty(Object value)
> where value is a java.util.Map.
> 
> Do you think we should add an attribute say "deep-test" (true/false
> value)?
> 
> I handle nested maps a lot, since it's more organized (structured)
> that way.
> 
> Jonathon
> 

Reply via email to