Clarity

What is in my Gel JellyContext? 

08-13-2014 06:50 PM

In a Gel script every tag that uses the “var” attribute will save the results of the tag into the JellyContext under the string identified by the “var” attribute.

 

So once in a while when debugging a Gel script, I want to inspect the scripts variables.  I use this to find misspelled variables, check expected values and figure out the underlying object types.

 

So to take a peek at your JellyContext, just drop this inside your Gel script at a location of interest.

 

<gel:log>Dump Context Variables</gel:log>
<core:set var="entries" value="${context.getVariables().entrySet().toArray()}" />    
<core:forEach var="entry" items="${entries}">
    <core:if test="${!entry.getKey().equalsIgnoreCase('systemScope')}" >
        <gel:log> ${entry.getKey()} = ${entry.getValue()} |  ${entry.getValue().getClass().getName()} </gel:log>
    </core:if>
</core:forEach>

 

V/r,

Gene

Statistics
0 Favorited
0 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Comments

08-21-2014 02:45 PM

Thanks Gene. This is perfect for troubleshooting variable issues in process / GEL scripts. So I have used this to troubleshoot processes for concurrency issues. Great Stuff !

 

 

Thanks,

AK

08-18-2014 02:08 PM

Thanks for sharing this with the community Gene!

08-14-2014 12:41 AM

Hi Gene,

 

This is cool! I just tried this in a test Gel with one string var (myname) and a query output var (qryoutput). Got the below data which looks pretty cool, but I expected to see the single row, single column value stored in the qryoutput variable too.

Regards,

Georgy

Related Entries and Links

No Related Resource entered.