Topic was "Re: <if-empty> test for Map does not do deep test".

Hi Chris (Howe),

You were saying that I can avoid restarting the server or recompiling my codes if I use <call-bsh><![CDATA]> and Minilang. I haven't explored using Minilang in bean shell. Is it possible?

> 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.

I currently do it in some "validateInputs" method, which avoids setting a field (inside a deep map structure, a constructed result, like a map-processor but more elaborate) if the input parameters were empty. It's a matter of doing it there, or later on before I use the constructed results.

If there were a deep if-empty test for Map(s), it'll just mean I can do away with many individual <if-empty> statements, and just plonk values in "parameters" into my constructed result.

Ultimately, I want to do <if-not-empty field-name="result.primaryPhone">, rather than go through primaryPhone.countryCode and primaryPhone.areaCode individually.

When you say "test the field [I] am interested in", that's difficult to apply in my case. I think I've been using Minilang too much like Java, object-oriented, with nested Map structures being passed around.

Well, if you're interested, and I think you use lots of Minilang, I've been unwittingly making Minilang more and more robust like OO Java. It started out with the motivation to avoid server restarts and Java code compiles, but is looking like the resultant Minilang is as good and clean as Java can be. I might just continue to use Minilang and avoid Java as much as possible. The extensions to Minilang is minimal. Took me an hour or less to create and test CallSimpleMethodScoped.java.

Jonathon

Reply via email to