设置流程实例参数

  • SDK调用
WorkflowEngineClient client = new WorkflowEngineClient();
client.setUrl(URL+"/engine");  //引擎客户端
String procId = "20181229000001";
int taskId = 2;
//构建环境变量参数
Map<String, Object> params = new HashMap<String, Object>();
params.put("userName", "userName");
params.put("taskId ", 2);
params.put("taskSeqId ", 1);
params.put("passTaskId ",1);
params.put("taskText", "请");
params.put("taskName", "请");
params.put("userName", "张"); 
params.put("userOrgName ", null);
Result result = client.setWorkflowParameters(procId, params);
String resultStr = JSONObject.fromObject(result,getJsonConfig()).toString();
System.out.println(resultStr);
  • CURL 调用
curl -X  POST  "URL/engine/setWorkflowParameters"  -H "accept: application/json" -H "Content-Type: application/json" -d \
"{   \
    \"procId\": \"20181229000001\",    \
    \"parameter\": {   \
         \"taskId\": 2,    \
         \"taskSeqId\": 1 ,   \
         \"passTaskId\": 1 ,   \
         \"taskText\": \"请\" ,   \
         \"taskName\": \"请\" ,   \
         \"userName\": \"张\" ,   \
         \"userOrgName\": \"\"   \
    }   \
}"

 注:parameter 下的字段为自定义的变量参数和变量值

  • 响应示例
{
    "success": true,
    "message": "设置成功",
    "statusCode": 200
}