Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws Exception
- {
- //RESTに渡す文字列
- String body="";
- Object[] r = null;
- //データを纏める件数をここで調整
- for(int i=0;i<10;i++){
- //一行すすめる
- r=getRow();
- if (r==null)
- {
- break;
- }
- String firstLine ="{ \"index\" : {} }\n";
- String secondLine = "{"
- +"\"nf\":\""+ get(Fields.In, "NF").getString(r) +"\","
- +"\"sexe\":\""+ get(Fields.In, "SEXE").getString(r) +"\","
- +"\"nom\":\""+ get(Fields.In, "NOM").getString(r) +"\","
- +"\"cog1\":\""+ get(Fields.In, "COG1").getString(r) +"\","
- +"\"cog2\":\""+ get(Fields.In, "COG2").getString(r) +"\""
- //+"\"datn\":\""+ get(Fields.In, "DATN").getString(r) +"\","
- +"}\n";
- //取得したデータをbody(戻り値)に詰める
- body+=firstLine+secondLine;
- }
- Object[] outputRowData = RowDataUtil.resizeArray(r, data.outputRowMeta.size());
- int outputIndex = getInputRowMeta().size();
- //OutPutの3番めに値を追加(0スタート)
- outputRowData[outputIndex++] =body;
- //行出力
- putRow(data.outputRowMeta, outputRowData);
- if (r==null)
- {
- //処理を終了して次の処理へ進む
- setOutputDone();
- return false;
- }
- //継続
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement