//设置业务关联键
startProcessInstanceCommand.setBusinessKey("bk_StartProcessInstanceTest");
//设置流程的启动人
startProcessInstanceCommand.setStartAuthor("1200119390");
//启动流程,返回流程实例
ProcessInstance processInstance = runtimeService.noneStartProcessInstance(startProcessInstanceCommand);
//验证流程是否启动成功
assertNotNull(processInstance);
//获取流程实例号
String processInstanceId = processInstance.getId();
//暂停流程实例
runtimeService.suspendProcessInstance(processInstanceId);
//创建流程实例查询
ProcessInstanceQuery processInstanceQuery = runtimeService.createProcessInstanceQuery();
//查询刚才暂停的流程实例
processInstanceQuery.processInstanceId(processInstanceId);
//获取流程实例
processInstance = processInstanceQuery.singleResult();
//验证流程实例已经暂停
assertTrue(processInstance.isSuspended());
//恢复流程实例
runtimeService.continueProcessInstance(processInstanceId);
//重置流程实例查询
processInstanceQuery = runtimeService.createProcessInstanceQuery();
//查询刚才的流程实例
processInstanceQuery.processInstanceId(processInstanceId);
//获取流程实例
processInstance = processInstanceQuery.singleResult();
//验证不是暂停状态
assertFalse(processInstance.isSuspended());
}