Per condividere un valore fra le UDF di un mapping
1 2 3 4 5 6 7 8 9 10 11 |
public String initCounter(Container container) throws StreamTransformationException{ container.getGlobalContainer ().setParameter ("COUNTER", "0"); return in; } public String increaseCounter(Container container) throws StreamTransformationException{ int theCounter = (new Integer ((String) container.getGlobalContainer().getParameter ("COUNTER"))).intValue(); theCounter++; container.getGlobalContainer().setParameter ("COUNTER", String.valueOf(theCounter)); return String.valueOf(theCounter); } |