// init
processEngine = Configuration.getProcessEngine();
repositoryService = processEngine.getRepositoryService();
executionService = processEngine.getExecutionService();
taskService = processEngine.getTaskService();
// deploy process
repositoryService.createDeployment().addResourcesFromZipInputStream(zipInput).deploy();
//delete process
repositoryService.deleteDeployment(processId);
// task list
taskList = taskService.findPersonalTasks(assignee);
// run task
Map<String, Object> envs = new HashMap<String, Object>();
envs.put("envName", envVariable);
taskService.setVariables(taskId, envs);
// OPT1: new task
taskService.completeTask(taskService.findPersonalTasks(assignee).get(0).getId())
// OPT2: existed task
taskService.completeTask(taskId);