ClimberCloud Index File: Create

ClimberCloud: Create Index File

Generates an index file for a ClimberCloud’s ‘list with file’.

Auto Step icon
Configs for this Auto Step
conf_FieldNames
C1: Data item field names for add index file (comma separated) *
conf_IndexFile
C2: Data item that stores the create index file (update) *
Script (click to open)


main();
function main(){
//// == Config Retrieving / 工程コンフィグの参照 ==
const fieldNames         = configs.get( "conf_FieldNames" ) + "";

const dataId_indexFile   = configs.get( "conf_IndexFile" );


//// == 演算 / Calculating ==
if ( fieldNames == "" ) {
  throw `Field Names none.`;
}

let text = "";
let arrayFieldNames = fieldNames.split(",");
for ( let i = 0; i < arrayFieldNames.length; i++) {
  const fieldName = arrayFieldNames[i];
//engine.log("fieldName:" + fieldName);
  const dataItem = engine.findDataDefinitionByVarName( fieldName );

  //文字型単一行・数値型・日付型年月日のみ対象
  if ( dataItem.matchDataType("STRING_TEXTFIELD") ) {
    const qstring = engine.findDataByVarName( fieldName ) + "";
    text += qstring +",";
  } else if ( dataItem.matchDataType("DECIMAL") ) {
    const qnum = engine.findDataByVarName( fieldName );
    text += qnum.longValue()+",";
  } else if ( dataItem.matchDataType("DATE_YMD") ) {
    const qdate = engine.findDataByVarName( fieldName );
    text += qdate.toString()+",";
  } else  {
    text += ",";
  }
}

//// == ワークフローデータへの代入 / Data Updating ==
let files = new java.util.ArrayList();
//インデックスファイル名は固定
files.add(new com.questetra.bpms.core.event.scripttask.NewQfile("index.csv","text/csv; charset=Shift_JIS", text));
engine.setDataByNumber( dataId_indexFile, files);

}

Download

warning Freely modifiable JavaScript (ECMAScript) code. No warranty of any kind.
(Installing Addon Auto-Steps are available only on the Professional edition.)

Notes

  • ClimberCloud is a service provided by NTT Data Business Brains, Inc. and is JIIMA certified (the service is compliant with the Electric Ledger Law and Invoice System).
  • It is intended to be used in combination with [ClimberCloud: Upload File].
  • For details on how to obtain a ClimberCloud API key and index file specifications, please refer to the ClimberCloud service (Support > Terms of Use/Specifications > WEBAPI Specifications). For a ClimberCloud trial, please apply from the ClimberCloud website.

Capture

See Also

%d bloggers like this: