String, Batch Replace to LowerCase
Replaces uppercase letters in the text with corresponding lowercase letters. An input of “ABC”, “Abc”, “abc” will all be output as “abc”. It is used to store case-insensitive data such as Internet domain or search words.
Configs
  • A: Set Input Text *#{EL}
  • B: Select STRING DATA for Output Text (update) *
Script (click to open)
// GraalJS Script (engine type: 2)

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

//// == Config Retrieving / 工程コンフィグの参照 ==
const strInput        = configs.get      ( "StrConfA" );    /// REQUIRED
  if( strInput      === "" ){
    throw new Error( "\n AutomatedTask ConfigError:" +
                     " Config {A: String} is empty \n" );
  }
const strPocketOutput = configs.getObject( "SelectConfB" ); /// REQUIRED


//// == Data Retrieving / ワークフローデータの参照 ==
// (Nothing. Retrieved via Expression Language in Config Retrieving)


//// == Calculating / 演算 ==
let strOutput = strInput.toLowerCase();
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase
// https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase


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


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

/*
Notes:
- When the process reaches the automated step, the Input Text will be automatically evaluated.
    - All uppercase letters in the string are replaced at once.
- Replaces not only the ISO Basic Latin Alphabet (26 characters),
    - but also Western European characters with uppercase and lowercase.
    - So-called double-byte characters are also replaced. (eg "A" to "a")
    - Characters with no uppercase and lowercase letters (such as kanji and katakana) are not replaced.
    - Some language characters with non-one-to-one case mapping may not be replaced as intended.
- See JavaScript `String.prototype.toLowerCase()` for details on replacement specs.
    - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase

Notes-ja:
- 案件が自動工程に到達した際、「入力テキスト」の文字列が評価されます。
    - 文字列中にある大文字が全て一括して置換されます。
- ISO基本ラテンアルファベット(26文字)のみならず、大文字小文字が存在する西欧系言語の文字が置換されます。
    - いわゆる全角文字も置換されます。(例 "A" → "a" )
    - 大文字小文字が存在しない文字(漢字やカタカナなど)は置換されません。
    - 大文字小文字のマッピングが1対1でない一部の言語文字では意図通りに置換されない可能性があります。
- 置換ルールに関する詳細仕様は JavaScript `String.prototype.toLowerCase()` を参照してください。
    - https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase
*/

Download

2022-08-17 (C) Questetra, Inc. (MIT License)
https://support.questetra.com/addons/string-batch-replace-to-lowercase-2022/
The Addon-import feature is available with Professional edition.
How to add on: (M415: Adding an Auto-Step to be Used in a Business Process Definition)
Freely modifiable JavaScript (ECMAScript) code. No warranty of any kind.

Notes

  • When the process reaches the automated step, the Input Text will be automatically evaluated.
    • All uppercase letters in the string are replaced at once.
  • Replaces the ISO Basic Latin Alphabet (26 characters).
    • Western European characters with uppercase and lowercase are replaced.
    • So-called double-byte characters are also replaced (e.g. “A” to “a”).
    • Characters with no uppercase and lowercase letters (such as kanji and katakana) are not replaced.
    • Some language characters with non-one-to-one case mapping may not be replaced as intended.
  • See JavaScript String.prototype.toLowerCase() for details on replacement specs.

Capture

Replaces uppercase letters in the text with corresponding lowercase letters. An input of "ABC", "Abc", "abc" will all be output as "abc". It is used to store case-insensitive data such as Internet domain or search words.

See also

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: