发起流程

  • SDK调用
//构建发起流程的参数
WorkflowRequest workflowRequest = new WorkflowRequest();
workflowRequest.setBusinessDataId(UUID.randomUUID().toString().replace("-", ""));
workflowRequest.setImportant(1);
workflowRequest.setSecret(1);
workflowRequest.setOpinionContent("opinionContent1");
workflowRequest.setOpinionArea("1");
workflowRequest.setExtendedFieldOne("extendedFieldOne");
workflowRequest.setExtendedFieldTwo("extendedFieldTwo");
workflowRequest.setExtendedFieldThree("extendedFieldThree");
workflowRequest.setAppCode("test001");
workflowRequest.setProcName("测试流程");

//构建表单参数
Map<String, Object> formData=new HashMap<String,Object>();
formData.put("userName", "userName");
formData.put("age", 1);
formData.put("weight", 1.23);
formData.put("enable", true);
formData.put("birthday", new Date());

WorkflowEngineClient client = new WorkflowEngineClient();
client.setUrl(URL+"/engine");  //引擎客户端
	//发起流程
ResultEntity<WorkflowRequest> resultEntity = client.saveOrUpdateWorkflow(workflowRequest,formData);
String result = JSONObject.fromObject(resultEntity,getJsonConfig()).toString();
System.out.println(result);

  • CURL调用
curl -X  POST  "URL/engine/saveOrUpdateWorkflow"  -H "accept: application/json" -H "Content-Type: application/json" -d \
"{   \
      \"procId\": \"\",    \
      \"taskId\": 0,    \
      \"opinionContent\": \"string\",    \
      \"opinionArea\": \"string\",    \
      \"appCode\": \"RS-00001\",    \
      \"procName\": \"string\",    \
      \"businessDataId\": \"guidgenenate11\",    \
      \"important\": 0,    \
      \"secret\": 0,    \
      \"extendedFieldOne\": \"string\",    \
      \"extendedFieldTwo\": \"string\",    \
      \"extendedFieldThree\": \"string\",    \
      \"formDataJsons\": \"\",    \
      \"choiceStepJsons\": \"\" \
 }"
  • 响应示例
{
  "businessObject": {
    "appCode": "RS-00001",
    "businessDataId": "c49eaaebed7c4c49af70e0531a8a4c85",
    "extendedFieldOne": "string",
    "extendedFieldThree": "string",
    "extendedFieldTwo": "string",
    "important": 0,
"opinionArea": "string",
"opinionContent": "string",
    "procId": "20181229000001",
    "procName": "string",
    "secret": 0,
    "taskId": 1
  },
  "message": "成功",
  "statusCode": 200,
  "success": true
}