Random number Generator

Generates a random number in the specified range and stores it in a data item. It can be used for determining the person in charge of processing by the generated numerical value for the sake of "preventing fixation of reviewers", or "determining strict winner numbers" in lottery, and so on.
Random Number Generator
random-number-20171018-addonxml.txt
(md5:7b090358ec848a4ca450fb4da5bafb36)

    • none
    • A random number which does not exceed A is stored in the data item selected at config B

    A. Set Max Number (100 returns 0 - 99)Single-line inputRequired
    B. Select NUMERIC DATA for Random Number (update)Data selectNumericRequired
    -variable namevariable label
    Aconf_MaxNumSet Max Number (100 returns 0 - 99)
    Bconf_DataIdBSelect NUMERIC DATA for Random Number (update)
    // Random Number Generator (ver. 20181018)
    // (c) 2017, Questetra, Inc. (the MIT License)
    
    //// == Config Retrieving / 工程コンフィグの参照 ==
    var maxNum  = configs.get( "conf_MaxNum" ) - 0;
    // convet 'java.lang.String' to 'javascript number'
    var dataIdB = configs.get( "conf_DataIdB" ) + "";
    // convet 'java.lang.String' to 'javascript string'
    
    //// == Data Retrieving / ワークフローデータの参照 ==
    // (none)
    
    //// == Calculating / 演算 ==
    var randNum = Math.floor( Math.random() * maxNum );
    // Math.random(): 0.00 to 0.99
    
    //// == Data Updating / ワークフローデータへの代入 ==
    engine.setDataByNumber( dataIdB, java.math.BigDecimal( randNum ) );