Difference between revisions of "Placeholders Example"

From GreenVulcano Wiki
Jump to: navigation, search
 
(One intermediate revision by the same user not shown)
Line 18: Line 18:
 
| CLASS || <nowiki>%{{fqclass}}</nowiki> || the FQN (Fully Qualified Name) of the input [[GVBuffer]]: it.greenvulcano.gvesb.buffer.GVBuffer
 
| CLASS || <nowiki>%{{fqclass}}</nowiki> || the FQN (Fully Qualified Name) of the input [[GVBuffer]]: it.greenvulcano.gvesb.buffer.GVBuffer
 
|-
 
|-
| DECODE || <nowiki>decode{{ognl{{#object.getProperty(‘SQL’)}}::OK::Sql OK::Sql KO}}</nowiki> || 'Sql OK' if ognl 'OK'. 'Sql KO' otherwise
+
| DECODE || <span style="color:green">decode{{</span><span style="color:red">ognl{{<nowiki>#object</nowiki>.getProperty(‘SQL’)}}</span><span style="color:green">::OK::Sql OK::Sql KO}}</span> || 'Sql OK' if ognl evaluates to 'OK'. 'Sql KO' otherwise
 
|-
 
|-
| MINUTE || <nowiki>Minute decode{{js{{gvesb::timestamp{{mm}} % 2 == 0}}::true::EVEN::ODD}}</nowiki> || 'EVEN' if js returns 'true'. 'ODD' otherwise. <br/> timestamp: returns the current minute and js: verifies if the current minute is even or odd.
+
| MINUTE || Minute <span style="color:green">decode{{</span><span style="color:red">js{{gvesb::</span><span style="color:blue"><nowiki>timestamp{{mm}}</nowiki></span><span style="color:red"> % 2 == 0}}</span><span style="color:green">::true::EVEN::ODD}}</span> || 'EVEN' if js evaluates to 'true'. 'ODD' otherwise. <br/> timestamp: returns the current minute and js: verifies if the current minute is even or odd.
 +
|-
 +
| NOW_PLUS_30s || <nowiki>js{{gvesb::DateUtils.dateToString(DateUtils.addTime(DateUtils.createCalendar().getTime(), Calendar.SECOND, 30), DateUtils.FORMAT_ISO_DATETIME_L)}}</nowiki> || the current time plus 30 seconds in [[DateUtils|Long ISO date/time format]].
 
|}
 
|}
  
See [[GVExample_TestProperty|TestProperty]] example for seeing how configure it using {{L_VULCON}}.
+
See [[GVExample_TestProperty|TestProperty]] example for seeing how configure some of it using {{L_VULCON}}.

Latest revision as of 14:43, 31 October 2013

The following table shows how to use some metadata using specific examples:

Metadata Example Returns
SQL sql{{ds.test_gv::select ‘OK’ from dual}} the String ‘OK’
SQLLIST [sqllist{{ds.test_gv::,::select name from city order by 1}}] a list of City, separated by "," ordered alfabetically and enclosed into “[“ and “]”
TIMESTAMP timestamp{{yyyyMMdd HH:mm:ss}} the current timestamp with the indicated format
OGNL Service: ognl{{#object.getService()}} the service field of the input GVBuffer
JAVASCRIPT System: js{{gvesb::object.getSystem()}} the system field of the input GVBuffer
SYSTEM Server Name: ${{jboss.server.name}} the indicated system property value
CLASS %{{fqclass}} the FQN (Fully Qualified Name) of the input GVBuffer: it.greenvulcano.gvesb.buffer.GVBuffer
DECODE decode{{ognl{{#object.getProperty(‘SQL’)}}::OK::Sql OK::Sql KO}} 'Sql OK' if ognl evaluates to 'OK'. 'Sql KO' otherwise
MINUTE Minute decode{{js{{gvesb::timestamp{{mm}} % 2 == 0}}::true::EVEN::ODD}} 'EVEN' if js evaluates to 'true'. 'ODD' otherwise.
timestamp: returns the current minute and js: verifies if the current minute is even or odd.
NOW_PLUS_30s js{{gvesb::DateUtils.dateToString(DateUtils.addTime(DateUtils.createCalendar().getTime(), Calendar.SECOND, 30), DateUtils.FORMAT_ISO_DATETIME_L)}} the current time plus 30 seconds in Long ISO date/time format.

See TestProperty example for seeing how configure some of it using VulCon®.