Filename Generator (in: None, out: String type C)

Stores a filename generated by concatenating prefix, item ID, date / time, and suffix in a data item

    A. Set Prefix Letters for Filename (e.g. "Quote-")Single-line inputInserting EL expressions is also possible
    B. Set Postfix Letters for Filename (e.g. ".pdf")Single-line inputInserting EL expressions is also possible
    C. Select FILE NAME DATA (update)Data selectString(single line)Required
    -variable namevariable label
    Aconf_PrefixCharacterSet Prefix Letters for Filename (e.g. "Quote-")
    Bconf_PostfixCharacterSet Postfix Letters for Filename (e.g. ".pdf")
    Cconf_FileNameDataIdSelect FILE NAME DATA (update)
    //// == 自動工程コンフィグの参照 / Config Retrieving ==
    var prefix = configs.get("conf_PrefixCharacter") + "";
    var postfix = configs.get("conf_PostfixCharacter") + "";
    var dataIdC = configs.get("conf_FileNameDataId");
    
    //// == ワークフローデータの参照 / Data Retrieving ==
    // no need
    
    //// == 演算 / Calculating ==
    var pid = processInstance.getProcessInstanceId() + "";
    
    var myToday = new Date(); 
    var yyyy = myToday.getFullYear(); 
    var M = myToday.getMonth() + 1; // Jan: 0 
    var d = myToday.getDate();
    var H = myToday.getHours();
    var m = myToday.getMinutes();
    
    var myFileName = "";
    myFileName += prefix;
    myFileName += ('0000' + pid).slice(-6);
    myFileName += "-";
    myFileName += yyyy;
    myFileName += ('0' + M).slice(-2);
    myFileName += ('0' + d).slice(-2);
    myFileName += ('0' + H).slice(-2);
    myFileName += ('0' + m).slice(-2);
    myFileName += postfix;
    
    //// == ワークフローデータへの代入 / Data Updating ==
    retVal.put( dataIdC, myFileName );
    
    noneA string of concatenating “Config A” and “PID-yyyyMMddHHmm(19 characters)” and “Config B” will be stored in the Data item selected in the config CIf it is placed in a loop structure which iterates multiple times within 1 minute, there is a possibility that the filename will not be a unique string.