接口 TaskService
- 所有已知实现类:
TaskServiceImpl
public interface TaskService
任务业务类接口
- 从以下版本开始:
- 1.0
-
方法概要
修饰符和类型方法说明default booleanaddTaskActor(Long taskId, List<FlwTaskActor> taskActors, FlowCreator flowCreator) booleanaddTaskActor(Long taskId, PerformType performType, List<FlwTaskActor> taskActors, FlowCreator flowCreator) 向指定的任务ID添加参与者【加签】default booleanaddTaskActor(Long taskId, PerformType performType, FlwTaskActor taskActor, FlowCreator flowCreator) default booleanaddTaskActor(Long taskId, FlwTaskActor taskActor, FlowCreator flowCreator) default booleanagentTask(Long taskId, FlowCreator flowCreator, List<FlowCreator> agentFlowCreators) default booleanagentTask(Long taskId, FlowCreator flowCreator, List<FlowCreator> agentFlowCreators, Map<String, Object> args) 根据 任务ID 指定代理人default booleanassigneeTask(Long taskId, TaskType taskType, TaskEventType taskEventType, FlowCreator flowCreator, List<FlowCreator> assigneeFlowCreators) booleanassigneeTask(Long taskId, TaskType taskType, TaskEventType taskEventType, FlowCreator flowCreator, List<FlowCreator> assigneeFlowCreators, Map<String, Object> args, Function<FlwTask, Boolean> check) 根据 任务ID 分配任务给指定办理人、重置任务类型booleancascadeRemoveByInstanceIds(List<Long> instanceIds) 级联删除 flw_his_task, flw_his_task_actor, flw_task, flw_task_actorbooleanchangeTaskActor(Long taskId, FlwTaskActor taskActor) 修改 taskId 任务办理人为指定 taskActor 参与者claimDepartment(Long taskId, FlowCreator flowCreator) 部门根据 任务ID 认领任务,删除其它任务参与者claimRole(Long taskId, FlowCreator flowCreator) 角色根据 任务ID 认领任务,删除其它任务参与者default FlwTaskcomplete(Long taskId, FlowCreator flowCreator) default FlwTask根据任务ID,创建人ID完成任务booleancompleteActiveTasksByInstanceId(Long instanceId, FlowCreator flowCreator) 完成指定实例ID活动任务booleancreateCcTask(NodeModel taskModel, FlwTask flwTask, List<NodeAssignee> ccUserList, FlowCreator flowCreator) 创建抄送任务createNewTask(Long taskId, TaskType taskType, PerformType performType, List<FlwTaskActor> taskActors, FlowCreator flowCreator, Function<FlwTask, Execution> executionFunction) 根据已有任务、参与者创建新的任务createTask(NodeModel taskModel, Execution execution) 根据任务模型、执行对象创建新的任务default booleandelegateTask(Long taskId, FlowCreator flowCreator, FlowCreator assigneeFlowCreator) default booleandelegateTask(Long taskId, FlowCreator flowCreator, FlowCreator assigneeFlowCreator, Map<String, Object> args) 根据 任务ID 委派任务、代理人办理完任务该任务重新归还给原处理人voidendCallProcessTask(Long callProcessId, Long callInstanceId) 结束调用外部流程任务booleanexecuteFinishTrigger(NodeModel nodeModel, Execution execution, FlowCreator flowCreator) 执行完成触发器操作流程继续往下执行default booleanexecuteJumpTask(Long taskId, String nodeKey, FlowCreator flowCreator, Function<FlwTask, Execution> executionFunction) default booleanexecuteJumpTask(Long taskId, String nodeKey, FlowCreator flowCreator, Map<String, Object> args, Function<FlwTask, Execution> executionFunction) executeJumpTask(Long taskId, String nodeKey, FlowCreator flowCreator, Map<String, Object> args, Function<FlwTask, Execution> executionFunction, TaskType taskType) 执行节点跳转任务executeTask(Long taskId, FlowCreator flowCreator, Map<String, Object> args, TaskState taskState, TaskEventType eventType) 根据任务ID,创建人ID完成任务booleanexecuteTaskTrigger(Execution execution, FlwTask flwTask) 执行触发器任务booleanforceCompleteAllTask(Long instanceId, FlwTask currentFlwTask, FlowCreator flowCreator, InstanceState instanceState, TaskEventType eventType) 强制完成所有任务booleanforceCompleteTask(FlwTask flwTask, FlowCreator flowCreator, TaskState taskState, TaskEventType eventType) 强制完成某个任务getTaskModel(Long taskId) 根据任务ID获取任务模型获取超时或者提醒的任务根据 taskId、createBy 判断创建人createBy是否允许执行任务reclaimTask(Long taskId, FlowCreator flowCreator) reclaimTask(Long taskId, FlowCreator flowCreator, BiConsumer<FlwHisTask, Integer> assertConsumer) 拿回任务、在当前办理人尚未处理文件前,允许上一节点提交人员执行拿回rejectTask(FlwTask currentFlwTask, FlowCreator flowCreator) rejectTask(FlwTask currentFlwTask, FlowCreator flowCreator, Map<String, Object> args) rejectTask(FlwTask currentFlwTask, FlowCreator flowCreator, Map<String, Object> args, TaskState taskState, TaskEventType eventType) 根据当前任务对象驳回至上一步处理default booleanremoveTaskActor(Long taskId, String actorId, FlowCreator flowCreator) booleanremoveTaskActor(Long taskId, List<String> actorIds, FlowCreator flowCreator) 对指定的任务ID删除参与者【减签】booleanresolveTask(Long taskId, FlowCreator flowCreator) 根据 任务ID 解决委派任务booleanresume(Long instanceId, FlowCreator flowCreator, BiFunction<FlwInstance, String, Boolean> execFunc) 唤醒撤回或拒绝终止历史任务(只有实例发起人可操作)default booleantransferTask(Long taskId, FlowCreator flowCreator, FlowCreator assigneeFlowCreator) default booleantransferTask(Long taskId, FlowCreator flowCreator, FlowCreator assigneeFlowCreator, Map<String, Object> args) 根据 任务ID 转办任务booleantransferTask(FlowCreator flowCreator, FlowCreator assigneeFlowCreator) 参与者的所有任务【离职转办】给指定办理人voidupdateTaskById(FlwTask flwTask, FlowCreator flowCreator) 更新任务对象booleanviewTask(Long taskId, FlowCreator flowCreator) 查看任务设置为已阅状态withdrawTask(Long taskId, FlowCreator flowCreator) 根据任务ID、创建人撤回任务(该任务后续任务未执行前有效)
-
方法详细资料
-
complete
根据任务ID,创建人ID完成任务该方法仅仅结束活动任务,并不能驱动流程继续执行
- 参数:
taskId- 任务IDflowCreator- 任务完成者args- 任务参数- 返回:
- Task 任务对象
-
complete
-
executeTask
FlwTask executeTask(Long taskId, FlowCreator flowCreator, Map<String, Object> args, TaskState taskState, TaskEventType eventType) 根据任务ID,创建人ID完成任务- 参数:
taskId- 任务IDflowCreator- 任务完成者args- 任务参数taskState- 任务状态eventType- 任务执行事件类型- 返回:
- Task 任务对象
-
forceCompleteAllTask
boolean forceCompleteAllTask(Long instanceId, FlwTask currentFlwTask, FlowCreator flowCreator, InstanceState instanceState, TaskEventType eventType) 强制完成所有任务- 参数:
instanceId- 流程实例IDcurrentFlwTask- 当前任务flowCreator- 处理人员instanceState- 流程实例最终状态eventType- 监听事件类型- 返回:
- true 成功 false 失败
-
forceCompleteTask
boolean forceCompleteTask(FlwTask flwTask, FlowCreator flowCreator, TaskState taskState, TaskEventType eventType) 强制完成某个任务- 参数:
flwTask- 审批任务flowCreator- 处理人员taskState- 流任务状态eventType- 监听事件类型- 返回:
- true 成功 false 失败
-
executeJumpTask
Optional<List<FlwTask>> executeJumpTask(Long taskId, String nodeKey, FlowCreator flowCreator, Map<String, Object> args, Function<FlwTask, Execution> executionFunction, TaskType taskType) 执行节点跳转任务- 参数:
taskId- 任务IDnodeKey- 跳转至目标节点keyflowCreator- 任务创建者args- 任务参数executionFunction- 执行函数taskType- 任务类型,仅支持 jump rejectJump routeJump- 返回:
- 当前 flowCreator 所在的任务
-
executeJumpTask
-
executeJumpTask
-
executeTaskTrigger
执行触发器任务- 参数:
execution-ExecutionflwTask- 触发器任务- 返回:
- true 成功 false 失败
-
completeActiveTasksByInstanceId
完成指定实例ID活动任务- 参数:
instanceId- 实例IDflowCreator- 处理人员- 返回:
- true 成功 false 失败
-
updateTaskById
更新任务对象- 参数:
flwTask- 任务对象flowCreator- 处理人员
-
viewTask
查看任务设置为已阅状态- 参数:
taskId- 任务IDflowCreator- 处理人员- 返回:
- true 成功 false 失败
-
claimRole
角色根据 任务ID 认领任务,删除其它任务参与者- 参数:
taskId- 任务IDflowCreator- 任务认领者- 返回:
- Task 任务对象
-
claimDepartment
部门根据 任务ID 认领任务,删除其它任务参与者- 参数:
taskId- 任务IDflowCreator- 任务认领者- 返回:
- Task 任务对象
-
agentTask
default boolean agentTask(Long taskId, FlowCreator flowCreator, List<FlowCreator> agentFlowCreators, Map<String, Object> args) 根据 任务ID 指定代理人- 参数:
taskId- 任务IDflowCreator- 任务参与者agentFlowCreators- 指定代理人列表args- 任务参数- 返回:
- true 成功 false 失败
-
agentTask
default boolean agentTask(Long taskId, FlowCreator flowCreator, List<FlowCreator> agentFlowCreators) -
transferTask
default boolean transferTask(Long taskId, FlowCreator flowCreator, FlowCreator assigneeFlowCreator, Map<String, Object> args) 根据 任务ID 转办任务- 参数:
taskId- 任务IDflowCreator- 任务参与者assigneeFlowCreator- 指定办理人args- 任务参数- 返回:
- true 成功 false 失败
-
transferTask
-
transferTask
参与者的所有任务【离职转办】给指定办理人用于任务参与者离职
- 参数:
flowCreator- 任务参与者assigneeFlowCreator- 指定办理人- 返回:
- true 成功 false 失败
-
delegateTask
default boolean delegateTask(Long taskId, FlowCreator flowCreator, FlowCreator assigneeFlowCreator, Map<String, Object> args) 根据 任务ID 委派任务、代理人办理完任务该任务重新归还给原处理人- 参数:
taskId- 任务IDflowCreator- 任务参与者assigneeFlowCreator- 指定办理人args- 任务参数- 返回:
- true 成功 false 失败
-
delegateTask
-
assigneeTask
boolean assigneeTask(Long taskId, TaskType taskType, TaskEventType taskEventType, FlowCreator flowCreator, List<FlowCreator> assigneeFlowCreators, Map<String, Object> args, Function<FlwTask, Boolean> check) 根据 任务ID 分配任务给指定办理人、重置任务类型- 参数:
taskId- 任务IDtaskType- 任务类型taskEventType- 任务事件类型flowCreator- 任务参与者assigneeFlowCreators- 指定办理人列表(业务层需要校验排查再次分配给已存在审批者)args- 任务参数check- 校验函数,可以根据 dbFlwTask.getAssignorId() 是否存在判断为重发分配- 返回:
- true 成功 false 失败
-
assigneeTask
default boolean assigneeTask(Long taskId, TaskType taskType, TaskEventType taskEventType, FlowCreator flowCreator, List<FlowCreator> assigneeFlowCreators) -
resolveTask
根据 任务ID 解决委派任务- 参数:
taskId- 任务IDflowCreator- 任务参与者- 返回:
- true 成功 false 失败
-
reclaimTask
Optional<List<FlwTask>> reclaimTask(Long taskId, FlowCreator flowCreator, BiConsumer<FlwHisTask, Integer> assertConsumer) 拿回任务、在当前办理人尚未处理文件前,允许上一节点提交人员执行拿回- 参数:
taskId- 任务ID(当前节点的父任务ID属于历史任务)flowCreator- 任务创建者assertConsumer- 断言处理函数- 返回:
- 拿回任务
-
reclaimTask
-
resume
boolean resume(Long instanceId, FlowCreator flowCreator, BiFunction<FlwInstance, String, Boolean> execFunc) 唤醒撤回或拒绝终止历史任务(只有实例发起人可操作)- 参数:
instanceId- 历史实例IDflowCreator- 任务唤醒者execFunc- 执行函数- 返回:
- true 成功 false 失败
-
withdrawTask
根据任务ID、创建人撤回任务(该任务后续任务未执行前有效)- 参数:
taskId- 待撤回历史任务IDflowCreator- 任务创建者- 返回:
- Task 任务对象
-
rejectTask
Optional<List<FlwTask>> rejectTask(FlwTask currentFlwTask, FlowCreator flowCreator, Map<String, Object> args, TaskState taskState, TaskEventType eventType) 根据当前任务对象驳回至上一步处理- 参数:
currentFlwTask- 当前任务对象flowCreator- 任务创建者args- 任务参数taskState- 任务状态eventType- 任务执行事件类型- 返回:
- Task 任务对象
-
rejectTask
-
rejectTask
-
executeFinishTrigger
执行完成触发器操作流程继续往下执行 -
isAllowed
根据 taskId、createBy 判断创建人createBy是否允许执行任务- 参数:
flwTask- 任务对象userId- 用户ID- 返回:
- 被允许参与者
FlwTaskActor
-
createTask
List<FlwTask> createTask(NodeModel taskModel, Execution execution, Function<FlwTask, FlwTask> taskFunction) 根据任务模型、执行对象创建新的任务- 参数:
taskModel- 任务模型execution- 执行对象taskFunction- 任务处理函数,如果自定义 CreateTaskHandler 可用于控制任务创建属性设置- 返回:
- 创建任务集合
-
createTask
-
createNewTask
List<FlwTask> createNewTask(Long taskId, TaskType taskType, PerformType performType, List<FlwTaskActor> taskActors, FlowCreator flowCreator, Function<FlwTask, Execution> executionFunction) 根据已有任务、参与者创建新的任务适用于动态转派,动态协办等处理且流程图中不体现节点情况
- 参数:
taskId- 主办任务IDtaskType- 任务类型performType- 参与类型taskActors- 参与者集合flowCreator- 任务创建者executionFunction- 执行函数- 返回:
- 创建任务集合
-
createCcTask
boolean createCcTask(NodeModel taskModel, FlwTask flwTask, List<NodeAssignee> ccUserList, FlowCreator flowCreator) 创建抄送任务默认不校验是否重复抄送
- 参数:
taskModel- 任务模型flwTask- 当前任务ccUserList- 抄送任务分配到任务的人或角色列表flowCreator- 任务创建者
-
getTimeoutOrRemindTasks
获取超时或者提醒的任务- 返回:
- 任务列表
-
getTaskModel
根据任务ID获取任务模型- 参数:
taskId- 任务ID- 返回:
- 流程模型
-
addTaskActor
boolean addTaskActor(Long taskId, PerformType performType, List<FlwTaskActor> taskActors, FlowCreator flowCreator) 向指定的任务ID添加参与者【加签】- 参数:
taskId- 任务IDperformType- 参与类型PerformTypetaskActors- 参与者列表flowCreator- 执行操作人员- 返回:
- true 成功 false 失败
-
addTaskActor
default boolean addTaskActor(Long taskId, PerformType performType, FlwTaskActor taskActor, FlowCreator flowCreator) -
addTaskActor
-
addTaskActor
-
removeTaskActor
对指定的任务ID删除参与者【减签】- 参数:
taskId- 任务IDactorIds- 参与者ID列表flowCreator- 执行操作人员- 返回:
- true 成功 false 失败
-
removeTaskActor
-
changeTaskActor
修改 taskId 任务办理人为指定 taskActor 参与者- 参数:
taskId- 任务IDtaskActor- 参与者- 返回:
- true 成功 false 失败
-
endCallProcessTask
结束调用外部流程任务- 参数:
callProcessId- 调用外部流程定义IDcallInstanceId- 调用外部流程实例ID
-
cascadeRemoveByInstanceIds
级联删除 flw_his_task, flw_his_task_actor, flw_task, flw_task_actor- 参数:
instanceIds- 流程实例ID列表
-