Connector (TSV Bulk Start)

Launching the Start event specified by each line data of tab delimited format data (TSV) and stores the communication log.

    A. Set WORKFLOW-PLATFORM URL (e.g. "${var[applicationRoot]}")Single-line inputInserting EL expressions is also possibleRequired
    B. Set SECURITY KEY (e.g. "${var[key]}")Single-line inputInserting EL expressions is also possibleRequired
    C. Set PROCESS MODEL ID to Connect (e.g. "123")Single-line inputRequired
    D. Set START EVENT NODE ID to Connect (e.g. "0")Single-line inputRequired
    E. Select TSV STRING DATAData selectStringRequired
    F. Set FIELD-NAMEs in Destination (e.g. "q_corp,q_div,q_name")Single-line inputRequired
    X. Select STRING DATA for Access Log (update)Data selectString(multiple line)
    -variable namevariable label
    Aconf_applicationRootSet WORKFLOW-PLATFORM URL (e.g. "${var[applicationRoot]}")
    Bconf_keySet SECURITY KEY (e.g. "${var[key]}")
    Cconf_processModelInfoIdSet PROCESS MODEL ID to Connect (e.g. "123")
    Dconf_nodeNumberSet START EVENT NODE ID to Connect (e.g. "0")
    Econf_DataIdESelect TSV STRING DATA
    Fconf_fieldNamesSet FIELD-NAMEs in Destination (e.g. "q_corp,q_div,q_name")
    Xconf_DataIdXSelect STRING DATA for Access Log (update)
    // Connector for TSV Bulk Start by Batch HTTP Throw (ver. 20161221)
    // (c) 2016, Questetra, Inc. (the MIT License)
    
    //// == Note ==
    // # of TSV-Columns must be equal to # of Field-Names (v11.0~)
    // Tab-Separated Values Limit: 10 records
    // 
    // ==Sample Format==
    // titleData=foo
    // q_stringData=foo
    // q_numericData=1234.56 // dot as decimal point, no thousands separator
    // q_selectData=true // Choice ID
    // q_dateData=2011-10-27
    // q_datetime=2011-10-27 12:34
    // q_user=sample@example.com // Email address of User
    // q_organization=Sales // Name of Group
    
    //// == 自動工程コンフィグの参照 / Config Retrieving ==
    var applicationRoot = configs.get( "conf_applicationRoot" ) + "";
    var key = configs.get( "conf_key" ) + "";
    var processModelInfoId = configs.get( "conf_processModelInfoId" ) + "";
    var nodeNumber = configs.get( "conf_nodeNumber" ) + "";
    var dataIdE = configs.get( "conf_DataIdE" ); // (returns ID)
    var fieldNames = configs.get( "conf_fieldNames" ) + "";
    var dataIdX = configs.get( "conf_DataIdX" );
    
    //// == ワークフローデータの参照 / Data Retrieving ==
    var myTsv = data.get( dataIdE ) + "";
    
    //// == 演算 / Calculating ==
    var accessLog = "";
    var uri = applicationRoot + "System/Event/MessageStart/start";
    var tsvRecords = myTsv.split("\n");
    var myParams = fieldNames.split(",");
    if( tsvRecords.length < 11 ){
      for( var i = 0; i < tsvRecords.length; i++ ){
        var fieldValues = tsvRecords[i].split("\t");
        var httpRequest = httpClient.begin();
        httpRequest.queryParam( "processModelInfoId", processModelInfoId );
        httpRequest.queryParam( "nodeNumber", nodeNumber );
        httpRequest.queryParam( "key", key );
        for( var j = 0; j < fieldValues.length; j++ ){
          httpRequest.queryParam( myParams[j], fieldValues[j] );
        }
        try{
          var httpResponse = httpRequest.post( uri );
          accessLog += "---POST request--- " + httpResponse.getStatusCode() + "\n";
          accessLog += httpResponse.getResponseAsString() + "\n";
        }catch(e){
          accessLog += e.message + "\n";
        }
      }
    } else {
      accessLog += "ERROR: TSV is limited to 10 records (" + tsvRecords.length + ") \n";
    }
    
    //// == ワークフローデータへの代入 / Data Updating ==
    retVal.put( dataIdX, accessLog );
    

    • E’: TSV text stored in the Data Item selected at E
    • Kicks the start event specified in ABCD with each line data of TSV data E’
    • Communication log will be stored in the Data Item selected at config X
    • TSV text can be entered by copying and pasting the cells of Excel, etc.
    • The maximum line number of TSV text (= the number of Processes to be started at once) is limited to 10
    • Because of the characteristic of TSV, you cannot substitute String type Data with line feed code and checkbox type Select type data etc.
    • Eliminate thousands delimiter of Numeric type data, Select type data is specified by ID, User type is specified by Email address, Organization type is specified by organization name
    • It is required to set [Field Name] (e.g. “q_foo”) in the Data Item setting of destination in advance