流程测试常用命令
True
无标题 (4)
1、部署。

curl --user rest-admin:test -F "file=@question_flow_v2.bpmn20.xml" http://localhost:8080/flowable-rest/service/repository/deployments

返回:

{"id":"c34f7d57-74b1-11e8-8c79-d0577b0e02fe","name":"question_flow_v2","deploymentTime":"2018-06-21T01:45:46.960+08:00","category":null,"parentDeploymentId":null,"url":"http://localhost:8080/flowable-rest/service/repository/deployments/c34f7d57-74b1-11e8-8c79-d0577b0e02fe","tenantId":""}

2、开始流程。

curl --user rest-admin:test -H "Content-Type: application/json" -X POST -d "{ \"processDefinitionKey\":\"question_flow\", \"variables\": [ { \"name\":\"employee\", \"value\": \"John Doe\" }, { \"name\":\"nrOfHolidays\", \"value\": 7 }]}" http://localhost:8080/flowable-rest/service/runtime/process-instances

返回:

{"id":"f07bb59f-74b2-11e8-8c79-d0577b0e02fe","url":"http://localhost:8080/flowable-rest/service/runtime/process-instances/f07bb59f-74b2-11e8-8c79-d0577b0e02fe","businessKey":null,"suspended":false,"ended":false,"processDefinitionId":"question_flow:1:c386eb9e-74b2-11e8-8c79-d0577b0e02fe","processDefinitionUrl":"http://localhost:8080/flowable-rest/service/repository/process-definitions/question_flow:1:c386eb9e-74b2-11e8-8c79-d0577b0e02fe","activityId":null,"variables":[],"tenantId":"","completed":false}

3、列出任务。
curl --user rest-admin:test -H "Content-Type: application/json" -X POST -d "{ \"candidateGroup\" : \"diaodu\" }" http://localhost:8080/flowable-rest/service/query/tasks

返回:

{"data":[{"id":"f07bdcb8-74b2-11e8-8c79-d0577b0e02fe","url":"http://localhost:8080/flowable-rest/service/runtime/tasks/f07bdcb8-74b2-11e8-8c79-d0577b0e02fe","owner":null,"assignee":null,"delegationState":null,"name":"闂鍒涘缓","descri
ption":null,"createTime":"2018-06-21T01:54:12.244+08:00","dueDate":null,"priority":50,"suspended":false,"taskDefinitionKey":"sid-4B790EF9-8293-4351-AC27-264C7A7C2DD8","tenantId":"","category":null,"formKey":null,"parentTaskId":null,"parentTaskUrl":null,"executionId":"f07bb5a5-74b2-11e8-8c79-d0577b0e02fe","executionUrl":"http://localhost:8080/flowable-rest/service/runtime/executions/f07bb5a5-74b2-11e8-8c79-d0577b0e02fe","processInstanceId":"f07bb59f-74b2-11e8-8c79-d0577b0e02fe","processInstanceUrl":"http://localhost:8080/flowable-rest/service/runtime/process-instances/f07bb59f-74b2-11e8-8c79-d0577b0e02fe","processDefinitionId":"question_flow:1:c386eb9e-74b2-11e8-8c79-d0577b0e02fe","processDefinitionUrl":"http://localhost:8080/flowable-rest/service/repository/process-definitions/question_flow:1:c386eb9e-74b2-11e8-8c79-d0577b0e02fe","variables":[]}],"total":1,"start":0,"sort":"id","order":"asc","size":1}

4、完成任务。

curl --user rest-admin:test -H "Content-Type: application/json" -X POST -d "{ \"action\" : \"complete\", \"variables\" : [ { \"name\" : \"approved\", \"value\" : true} ] }" http://localhost:8080/flowable-rest/service/runtime/tasks/f07bdcb8-74b2-11e8-8c79-d0577b0e02fe

5、查询工区长任务。

curl --user rest-admin:test -H "Content-Type: application/json" -X POST -d "{ \"candidateGroup\" : \"gongzhang\" }" http://localhost:8080/flowable-rest/service/query/tasks

{"data":[{"id":"5095cd3e-74b4-11e8-8c79-d0577b0e02fe","url":"http://localhost:8080/flowable-rest/service/runtime/tasks/5095cd3e-74b4-11e8-8c79-d0577b0e02fe","owner":null,"assignee":null,"delegationState":null,"name":"棰嗗彇鎴栬浆浜?,"desc
ription":null,"createTime":"2018-06-21T02:04:02.973+08:00","dueDate":null,"priority":50,"suspended":false,"taskDefinitionKey":"sid-D3935FAC-0001-4FD5-A320-44AB73283AAB","tenantId":"","category":null,"formKey":null,"parentTaskId":null,"parentTaskUrl":null,"executionId":"f07bb5a5-74b2-11e8-8c79-d0577b0e02fe","executionUrl":"http://localhost:8080/flowable-rest/service/runtime/executions/f07bb5a5-74b2-11e8-8c79-d0577b0e02fe","processInstanceId":"f07bb59f-74b2-11e8-8c79-d0577b0e02fe","processInstanceUrl":"http://localhost:8080/flowable-rest/service/runtime/process-instances/f07bb59f-74b2-11e8-8c79-d0577b0e02fe","processDefinitionId":"question_flow:1:c386eb9e-74b2-11e8-8c79-d0577b0e02fe","processDefinitionUrl":"http://localhost:8080/flowable-rest/service/repository/process-definitions/question_flow:1:c386eb9e-74b2-11e8-8c79-d0577b0e02fe","variables":[]}],"total":1,"start":0,"sort":"id","order":"asc","size":1}

6、工区长通过审核。
curl --user rest-admin:test -H "Content-Type: application/json" -X POST -d "{ \"action\" : \"complete\", \"variables\" : [ { \"name\" : \"approved\", \"value\" : true},{ \"name\" : \"asign\", \"value\" : false} ] }" http://localhost:8080/flowable-rest/service/runtime/tasks/5095cd3e-74b4-11e8-8c79-d0577b0e02fe

7、列出当值工程师任务。

curl --user rest-admin:test -H "Content-Type: application/json" -X POST -d "{ \"candidateGroup\" : \"gongchengshi\" }" http://localhost:8080/flowable-rest/service/query/tasks

返回
{"data":[{"id":"40215969-74b5-11e8-8c79-d0577b0e02fe","url":"http://localhost:8080/flowable-rest/service/runtime/tasks/40215969-74b5-11e8-8c79-d0577b0e02fe","owner":null,"assignee":null,"delegationState":null,"name":"褰撳€煎伐绋嬪笀瀹℃
牳鎴栭€€鍥?,"description":null,"createTime":"2018-06-21T02:10:44.863+08:00","dueDate":null,"priority":50,"suspended":false,"taskDefinitionKey":"sid-E54E6C7C-AA96-4263-A192-C31A3ECF96B3","tenantId":"","category":null,"formKey":null,"pare
ntTaskId":null,"parentTaskUrl":null,"executionId":"f07bb5a5-74b2-11e8-8c79-d0577b0e02fe","executionUrl":"http://localhost:8080/flowable-rest/service/runtime/executions/f07bb5a5-74b2-11e8-8c79-d0577b0e02fe","processInstanceId":"f07bb59f-74b2-11e8-8c79-d0577b0e02fe","processInstanceUrl":"http://localhost:8080/flowable-rest/service/runtime/process-instances/f07bb59f-74b2-11e8-8c79-d0577b0e02fe","processDefinitionId":"question_flow:1:c386eb9e-74b2-11e8-8c79-d0577b0e02fe","processDefinitionUrl":"http://localhost:8080/flowable-rest/service/repository/process-definitions/question_flow:1:c386eb9e-74b2-11e8-8c79-d0577b0e02fe","variables":[]}],"total":1,"start":0,"sort":"id","order":"asc","size":1}

8、当值工程师通过。
curl --user rest-admin:test -H "Content-Type: application/json" -X POST -d "{ \"action\" : \"complete\", \"variables\" : [ { \"name\" : \"approved\", \"value\" : true}] }" http://localhost:8080/flowable-rest/service/runtime/tasks/40215969-74b5-11e8-8c79-d0577b0e02fe

备份操作手册
True