// 1、发起流程
// POST  10.99.209.2:8080/ding/startFlow
// 请求数据类型：application/json
// {
//     "processCode": "PROC-CFEC5AF7-68C5-464B-9825-9F33574A6E8D",
//     "mobile": "15730035157",
//     "formParam": [
//         {
//             "name": "名称",
//             "value": "aaaaaaa"
//         },
//         {
//             "name": "手机号",
//             "value": "13611111111"
//         }
//     ]
// }


// 调用案例：
// let res = runtime.call('api/utils/yskt/createFlow.js', project_id,USER_INFO.phone,JSON.stringify(data))

// 查询接口 ： 2、获取流程详情
// GET 10.99.209.2:8080/ding/getFlowDetail?processInstanceId=流程 id

var querystring = require('querystring')

function main() {
    let req = {
        url: 'https://10-99-32-1168080-9svlohw2xfr4ze.ztna-dingtalk.com/ding/startFlow',
        method: 'POST',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        data: querystring.stringify({
    "processCode": args[0],
    "mobile": args[1],
    "formParam": JSON.parse(args[2])
}),
    }
    let res = request.parse(req).body.toObject()
    console.log(res)
    return res
}