package com.leanwo.activiti.service.base;

import org.quartz.SchedulerException;

import com.leanwo.activiti.dto.BaseResponse;
import com.leanwo.activiti.dto.base.TaskDefineDto;
import com.leanwo.activiti.dto.base.TaskInstanceSaveRequest;
import com.leanwo.activiti.dto.base.TaskInstanceStatus;
import com.leanwo.activiti.dto.base.TaskInstanceUpdateRequest;

/**
 * Http定时任务执行引擎
 * 
 * @author YangZhiJie
 *
 */
public interface HttpTaskEngine {

	/**
	 * 初始化引擎
	 */
	void init();

	/**
	 * 增加流程报表定时执行任务
	 * 
	 * @param accountId
	 *            账套id
	 * @param processReportExecutorDto
	 *            流程报表定时执行定义
	 * @throws SchedulerException
	 */
	public BaseResponse addJob(TaskDefineDto taskDefineDto) throws SchedulerException;

	/**
	 * 增加流程报表定时执行任务
	 * 
	 * @param accountId
	 *            账套id
	 * @param processReportExecutorDto
	 *            流程报表定时执行定义
	 * @throws SchedulerException
	 */
	public BaseResponse deleteJob(TaskDefineDto taskDefineDto) throws SchedulerException;

	/**
	 * 生成流程实例
	 * 
	 * @param taskInstanceSaveRequest
	 * @return
	 */
	public BaseResponse addTaskInstance(Long timeSerialNumber, TaskDefineDto taskDefineDto);

	/**
	 * 生成流程实例
	 * 
	 * @param taskInstanceSaveRequest
	 * @return
	 */
	public BaseResponse updateTaskInstance(Long timeSerialNumber, String result, TaskInstanceStatus taskInstanceStatus,
			TaskDefineDto taskDefineDto);

}
