Master Table: List All Options as TSV String

Master Table: List All Options as TSV String

translate マスターテーブル: TSV文字列として一覧

Includes the master table on Workflow Platform as a string property of the process. The IDs and Labels are concatenated into TSV (Tab-Separated Values) and stored into Multiline-String type.

Auto Step icon
Configs for this Auto Step
strSetConfA
A: Set Name of Master (e.g. “foo.xml”) *#{EL}
SelectConfB
B: Select STRING DATA for Master TSV (update) *
Script (click to open)
// Script for 'engine type: 3' ("GraalJS standard mode")
// cf 'engine type: 2' renamed from "GraalJS" to "GraalJS Nashorn compatible mode" (at 20230526)

/*
 Questetra BPMS V12.0 (released 2020-05-11)
 - configs.getObject()
 - engine.findData()
 - engine.setData()
*/

//////// START "main()" /////////////////////////////////////////////////////////////////
main();
function main(){ 

//// == Config Retrieving / 工程コンフィグの参照 ==
const strMasterName = configs.get( "strSetConfA"  );      // required
const pocketStrTsv  = configs.getObject( "SelectConfB" ); // required
if( strMasterName === "" ){
  throw new Error( "\n AutomatedTask ConfigError:" +
                   " Config {MasterFile Name A} is empty \n" );
}


//// == Data Retrieving / ワークフローデータの参照 ==
// (nothing, except Expression Language config)


//// == Calculating / 演算 ==
const jarrOptions = itemDao.findAll( strMasterName, true );
// return "List<ItemView>" (java.util.ArrayList)
// M319: Register an Options-XML file to which the Process Model Definitions Refer
// M319: Options-XML: 複数の業務プロセス定義から参照される選択肢XML
// R2300 com.questetra.bpms.core.event.scripttask.ItemDaoWrapper
if( jarrOptions.size() - 0 === 0 ){
  throw new Error( "\n AutomatedTask UnexpectedOptionsXmlError:" +
                   strMasterName + " not found or null \n" );
}

engine.log( " AutomatedTask OptionsXML: " + 
            strMasterName + ": " +
            jarrOptions.size() + " options" );
let strTsv = '';
for( let i = 0; i < (jarrOptions.size() - 0); i++ ){
  strTsv += jarrOptions.get(i).getValue();
  strTsv += '\t';
  strTsv += jarrOptions.get(i).getDisplay();
  strTsv += '\n';
}
strTsv = strTsv.slice( 0, -1 );


//// == Data Updating / ワークフローデータへの代入 ==
engine.setData( pocketStrTsv, strTsv );

} //////// END "main()" /////////////////////////////////////////////////////////////////

Download

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

Notes

Includes the master table on Workflow Platform

Capture

Includes the master table on Workflow Platform as a string property of the process. The IDs and Labels are concatenated into TSV (Tab-Separated Values) and stored into Multiline-String type.

See Also

%d bloggers like this: