public interface TaskService
限定符和类型 | 方法和说明 |
---|---|
default boolean |
addTaskActor(Long taskId,
PerformType performType,
FlwTaskActor flwTaskActor,
FlowCreator flowCreator) |
boolean |
addTaskActor(Long taskId,
PerformType performType,
List<FlwTaskActor> flwTaskActors,
FlowCreator flowCreator)
向指定的任务ID添加参与者【加签】
|
default boolean |
agentTask(Long taskId,
FlowCreator flowCreator,
List<FlowCreator> agentFlowCreators)
根据 任务ID 指定代理人
|
default boolean |
assigneeTask(Long taskId,
TaskType taskType,
FlowCreator flowCreator,
List<FlowCreator> assigneeFlowCreators) |
boolean |
assigneeTask(Long taskId,
TaskType taskType,
FlowCreator flowCreator,
List<FlowCreator> assigneeFlowCreators,
Function<FlwTask,Boolean> check)
根据 任务ID 分配任务给指定办理人、重置任务类型
|
boolean |
cascadeRemoveByInstanceIds(List<Long> instanceIds)
级联删除 flw_his_task, flw_his_task_actor, flw_task, flw_task_actor
|
FlwTask |
claimDepartment(Long taskId,
FlowCreator flowCreator)
部门根据 任务ID 认领任务,删除其它任务参与者
|
FlwTask |
claimRole(Long taskId,
FlowCreator flowCreator)
角色根据 任务ID 认领任务,删除其它任务参与者
|
default FlwTask |
complete(Long taskId,
FlowCreator flowCreator) |
default FlwTask |
complete(Long taskId,
FlowCreator flowCreator,
Map<String,Object> args)
根据任务ID,创建人ID完成任务
该方法仅仅结束活动任务,并不能驱动流程继续执行
|
boolean |
completeActiveTasksByInstanceId(Long instanceId,
FlowCreator flowCreator)
完成指定实例ID活动任务
|
List<FlwTask> |
createNewTask(Long taskId,
TaskType taskType,
PerformType performType,
List<FlwTaskActor> taskActors,
FlowCreator flowCreator,
Function<FlwTask,Execution> executionFunction)
根据已有任务、参与者创建新的任务
适用于动态转派,动态协办等处理且流程图中不体现节点情况
|
default List<FlwTask> |
createTask(NodeModel taskModel,
Execution execution) |
List<FlwTask> |
createTask(NodeModel taskModel,
Execution execution,
Function<FlwTask,FlwTask> taskFunction)
根据任务模型、执行对象创建新的任务
|
default boolean |
delegateTask(Long taskId,
FlowCreator flowCreator,
FlowCreator assigneeFlowCreator)
根据 任务ID 委派任务、代理人办理完任务该任务重新归还给原处理人
|
void |
endCallProcessTask(Long callProcessId,
Long callInstanceId)
结束调用外部流程任务
|
default boolean |
executeJumpTask(Long taskId,
String nodeKey,
FlowCreator flowCreator,
Function<FlwTask,Execution> executionFunction) |
default boolean |
executeJumpTask(Long taskId,
String nodeKey,
FlowCreator flowCreator,
Map<String,Object> args,
Function<FlwTask,Execution> executionFunction) |
Optional<FlwTask> |
executeJumpTask(Long taskId,
String nodeKey,
FlowCreator flowCreator,
Map<String,Object> args,
Function<FlwTask,Execution> executionFunction,
TaskType taskTye)
执行节点跳转任务
|
FlwTask |
executeTask(Long taskId,
FlowCreator flowCreator,
Map<String,Object> args,
TaskState taskState,
TaskEventType eventType)
根据任务ID,创建人ID完成任务
|
boolean |
executeTaskTrigger(Execution execution,
FlwTask flwTask)
执行触发器任务
|
boolean |
forceCompleteAllTask(Long instanceId,
FlowCreator flowCreator,
InstanceState instanceState,
TaskEventType eventType)
强制完成所有任务
|
NodeModel |
getTaskModel(Long taskId)
根据任务ID获取任务模型
|
List<FlwTask> |
getTimeoutOrRemindTasks()
获取超时或者提醒的任务
|
FlwTaskActor |
isAllowed(FlwTask flwTask,
String userId)
根据 taskId、createBy 判断创建人createBy是否允许执行任务
|
Optional<FlwTask> |
reclaimTask(Long taskId,
FlowCreator flowCreator)
拿回任务、在当前办理人尚未处理文件前,允许上一节点提交人员执行拿回
|
default Optional<FlwTask> |
rejectTask(FlwTask currentFlwTask,
FlowCreator flowCreator) |
Optional<FlwTask> |
rejectTask(FlwTask currentFlwTask,
FlowCreator flowCreator,
Map<String,Object> args)
根据当前任务对象驳回至上一步处理
|
boolean |
removeTaskActor(Long taskId,
List<String> actorIds,
FlowCreator flowCreator)
对指定的任务ID删除参与者【减签】
|
default boolean |
removeTaskActor(Long taskId,
String actorId,
FlowCreator flowCreator) |
boolean |
resolveTask(Long taskId,
FlowCreator flowCreator)
根据 任务ID 解决委派任务
|
FlwTask |
resume(Long taskId,
FlowCreator flowCreator)
唤醒历史任务
该方法会导致流程状态不可控,请慎用
|
boolean |
transferTask(FlowCreator flowCreator,
FlowCreator assigneeFlowCreator)
参与者的所有任务【离职转办】给指定办理人
用于任务参与者离职
|
default boolean |
transferTask(Long taskId,
FlowCreator flowCreator,
FlowCreator assigneeFlowCreator)
根据 任务ID 转办任务
|
void |
updateTaskById(FlwTask flwTask,
FlowCreator flowCreator)
更新任务对象
|
boolean |
viewTask(Long taskId,
FlwTaskActor taskActor)
查看任务设置为已阅状态
|
Optional<FlwTask> |
withdrawTask(Long taskId,
FlowCreator flowCreator)
根据任务ID、创建人撤回任务(该任务后续任务未执行前有效)
|
default FlwTask complete(Long taskId, FlowCreator flowCreator, Map<String,Object> args)
该方法仅仅结束活动任务,并不能驱动流程继续执行
taskId
- 任务IDflowCreator
- 任务完成者args
- 任务参数default FlwTask complete(Long taskId, FlowCreator flowCreator)
FlwTask executeTask(Long taskId, FlowCreator flowCreator, Map<String,Object> args, TaskState taskState, TaskEventType eventType)
taskId
- 任务IDflowCreator
- 任务完成者args
- 任务参数taskState
- 任务状态eventType
- 任务执行事件类型boolean forceCompleteAllTask(Long instanceId, FlowCreator flowCreator, InstanceState instanceState, TaskEventType eventType)
instanceId
- 流程实例IDflowCreator
- 处理人员instanceState
- 流程实例最终状态eventType
- 监听事件类型Optional<FlwTask> executeJumpTask(Long taskId, String nodeKey, FlowCreator flowCreator, Map<String,Object> args, Function<FlwTask,Execution> executionFunction, TaskType taskTye)
taskId
- 任务IDflowCreator
- 任务创建者args
- 任务参数nodeKey
- 跳转至目标节点keyexecutionFunction
- 执行函数taskTye
- 任务类型,仅支持 jump rejectJump routeJumpdefault boolean executeJumpTask(Long taskId, String nodeKey, FlowCreator flowCreator, Map<String,Object> args, Function<FlwTask,Execution> executionFunction)
default boolean executeJumpTask(Long taskId, String nodeKey, FlowCreator flowCreator, Function<FlwTask,Execution> executionFunction)
boolean executeTaskTrigger(Execution execution, FlwTask flwTask)
execution
- Execution
flwTask
- 触发器任务boolean completeActiveTasksByInstanceId(Long instanceId, FlowCreator flowCreator)
instanceId
- 实例IDflowCreator
- 处理人员void updateTaskById(FlwTask flwTask, FlowCreator flowCreator)
flwTask
- 任务对象flowCreator
- 处理人员boolean viewTask(Long taskId, FlwTaskActor taskActor)
taskId
- 任务IDtaskActor
- 任务参与者FlwTask claimRole(Long taskId, FlowCreator flowCreator)
taskId
- 任务IDflowCreator
- 任务认领者FlwTask claimDepartment(Long taskId, FlowCreator flowCreator)
taskId
- 任务IDflowCreator
- 任务认领者default boolean agentTask(Long taskId, FlowCreator flowCreator, List<FlowCreator> agentFlowCreators)
taskId
- 任务IDflowCreator
- 任务参与者agentFlowCreators
- 指定代理人列表default boolean transferTask(Long taskId, FlowCreator flowCreator, FlowCreator assigneeFlowCreator)
taskId
- 任务IDflowCreator
- 任务参与者assigneeFlowCreator
- 指定办理人boolean transferTask(FlowCreator flowCreator, FlowCreator assigneeFlowCreator)
用于任务参与者离职
flowCreator
- 任务参与者assigneeFlowCreator
- 指定办理人default boolean delegateTask(Long taskId, FlowCreator flowCreator, FlowCreator assigneeFlowCreator)
taskId
- 任务IDflowCreator
- 任务参与者assigneeFlowCreator
- 指定办理人boolean assigneeTask(Long taskId, TaskType taskType, FlowCreator flowCreator, List<FlowCreator> assigneeFlowCreators, Function<FlwTask,Boolean> check)
taskId
- 任务IDtaskType
- 任务类型flowCreator
- 任务参与者assigneeFlowCreators
- 指定办理人列表check
- 校验函数,可以根据 dbFlwTask.getAssignorId() 是否存在判断为重发分配default boolean assigneeTask(Long taskId, TaskType taskType, FlowCreator flowCreator, List<FlowCreator> assigneeFlowCreators)
boolean resolveTask(Long taskId, FlowCreator flowCreator)
taskId
- 任务IDflowCreator
- 任务参与者Optional<FlwTask> reclaimTask(Long taskId, FlowCreator flowCreator)
taskId
- 任务ID(当前节点的父任务ID属于历史任务)flowCreator
- 任务创建者FlwTask resume(Long taskId, FlowCreator flowCreator)
该方法会导致流程状态不可控,请慎用
taskId
- 历史任务IDflowCreator
- 任务唤醒者FlwTask
唤醒后的任务对象Optional<FlwTask> withdrawTask(Long taskId, FlowCreator flowCreator)
taskId
- 待撤回历史任务IDflowCreator
- 任务创建者Optional<FlwTask> rejectTask(FlwTask currentFlwTask, FlowCreator flowCreator, Map<String,Object> args)
currentFlwTask
- 当前任务对象flowCreator
- 任务创建者args
- 任务参数default Optional<FlwTask> rejectTask(FlwTask currentFlwTask, FlowCreator flowCreator)
FlwTaskActor isAllowed(FlwTask flwTask, String userId)
flwTask
- 任务对象userId
- 用户IDFlwTaskActor
List<FlwTask> createTask(NodeModel taskModel, Execution execution, Function<FlwTask,FlwTask> taskFunction)
taskModel
- 任务模型execution
- 执行对象taskFunction
- 任务处理函数,如果自定义 CreateTaskHandler 可用于控制任务创建属性设置List<FlwTask> createNewTask(Long taskId, TaskType taskType, PerformType performType, List<FlwTaskActor> taskActors, FlowCreator flowCreator, Function<FlwTask,Execution> executionFunction)
适用于动态转派,动态协办等处理且流程图中不体现节点情况
taskId
- 主办任务IDtaskActors
- 参与者集合taskType
- 任务类型performType
- 参与类型flowCreator
- 任务创建者executionFunction
- 执行函数boolean addTaskActor(Long taskId, PerformType performType, List<FlwTaskActor> flwTaskActors, FlowCreator flowCreator)
taskId
- 任务IDperformType
- 参与类型 PerformType
flwTaskActors
- 参与者列表flowCreator
- 执行操作人员default boolean addTaskActor(Long taskId, PerformType performType, FlwTaskActor flwTaskActor, FlowCreator flowCreator)
boolean removeTaskActor(Long taskId, List<String> actorIds, FlowCreator flowCreator)
taskId
- 任务IDactorIds
- 参与者ID列表flowCreator
- 执行操作人员default boolean removeTaskActor(Long taskId, String actorId, FlowCreator flowCreator)
void endCallProcessTask(Long callProcessId, Long callInstanceId)
callProcessId
- 调用外部流程定义IDcallInstanceId
- 调用外部流程实例IDCopyright © 2025. All rights reserved.