类 RuntimeServiceImpl
java.lang.Object
net.sohelp.boot.engine.workflow.impl.RuntimeServiceImpl
- 所有已实现的接口:
RuntimeService
流程实例运行业务类
- 从以下版本开始:
- 1.0
-
字段概要
字段修饰符和类型字段说明protected final FlwExtInstanceDaoprotected final FlowIdGeneratorprotected final FlwHisInstanceDaoprotected final FlwInstanceDaoprotected final InstanceListenerprotected final QueryServiceprotected final TaskService -
构造器概要
构造器构造器说明RuntimeServiceImpl(InstanceListener instanceListener, FlowIdGenerator flowLongIdGenerator, QueryService queryService, TaskService taskService, FlwInstanceDao instanceDao, FlwHisInstanceDao hisInstanceDao, FlwExtInstanceDao extInstanceDao) -
方法概要
修饰符和类型方法说明booleanactiveInstanceById(Long instanceId, FlowCreator flowCreator) 激活流程实例InstanceState.activebooleanaddVariable(Long instanceId, Map<String, Object> args, Function<FlwInstance, FlwInstance> function) 根据 流程实例ID 更新流程实例全局变量voidappendNodeModel(Long taskId, NodeModel nodeModel, boolean beforeAfter) 追加节点模型(不执行任务跳转)voidcascadeRemoveByInstanceId(Long instanceId) 级联删除表 flw_his_task_actor, flw_his_task, flw_task_actor, flw_task, flw_instance, flw_his_instancevoidcascadeRemoveByProcessId(Long processId) 级联删除指定流程实例的所有数据createInstance(FlwProcess flwProcess, FlowCreator flowCreator, Map<String, Object> args, NodeModel nodeModel, boolean saveAsDraft, Supplier<FlwInstance> supplier) 创建活动实例booleandestroyByInstanceId(Long instanceId, Map<String, Object> args) 根据 流程实例ID 作废流程booleanendInstance(Execution execution, Long instanceId, NodeModel endNode, InstanceState instanceState) 删除活动流程实例数据,更新历史流程实例的状态、结束时间protected booleanforceComplete(Long instanceId, FlwTask currentFlwTask, FlowCreator flowCreator, InstanceEventType instanceEventType, InstanceState instanceState, TaskEventType eventType) 强制完成流程实例protected voidforceCompleteAll(FlwInstance flwInstance, FlwTask currentFlwTask, FlowCreator flowCreator, InstanceEventType instanceEventType, InstanceState instanceState, TaskEventType eventType) 强制完成流程所有实例protected FlwHisInstancegetFlwHisInstance(Long instanceId, NodeModel endNode, FlwInstance flwInstance, InstanceState instanceState) getProcessModelByInstanceId(Long instanceId) 根据流程实例ID获取流程实例模型protected voidinstanceNotify(InstanceEventType eventType, Supplier<FlwHisInstance> supplier, NodeModel nodeModel, FlowCreator flowCreator) booleanreject(Long instanceId, FlwTask currentFlwTask, FlowCreator flowCreator) 流程实例拒绝审批强制终止(用于后续审核人员认为该审批不再需要继续,拒绝审批强行终止)boolean删除节点模型某个临时节点booleanrevoke(Long instanceId, FlwTask currentFlwTask, FlowCreator flowCreator) 流程实例撤销(用于错误发起审批申请,发起人主动撤销)voidsaveInstance(FlwInstance flwInstance, FlwProcess flwProcess, boolean saveAsDraft, FlowCreator flowCreator) 流程实例数据会保存至活动实例表、历史实例表booleansuspendInstanceById(Long instanceId, FlowCreator flowCreator) 暂停流程实例InstanceState.suspendbooleanterminate(Long instanceId, FlwTask currentFlwTask, FlowCreator flowCreator) 强制终止活动实例,并强制完成活动任务booleantimeout(Long instanceId, FlwTask currentFlwTask, FlowCreator flowCreator) 流程实例超时(设定审批时间超时,自动结束)voidupdateInstance(FlwInstance flwInstance) 更新活动实例booleanupdateInstanceModelById(Long instanceId, ProcessModel processModel) 根据 流程实例ID 更新流程实例模型内容protected booleanupdateInstanceState(FlwHisInstance dbFhi, InstanceState instanceState, FlowCreator flowCreator) 更新流程实例状态protected booleanupdateInstanceStateById(Long instanceId, InstanceState instanceState, FlowCreator flowCreator) 根据流程实例ID更新流程实例状态protected voidupdateModelContent(FlwExtInstance flwExtInstance, ProcessModel processModel) 从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 net.sohelp.boot.engine.workflow.RuntimeService
addVariable, getNodeModel, reject, revoke, terminate, timeout, timeout
-
字段详细资料
-
instanceListener
-
flowLongIdGenerator
-
queryService
-
taskService
-
instanceDao
-
hisInstanceDao
-
extInstanceDao
-
-
构造器详细资料
-
RuntimeServiceImpl
public RuntimeServiceImpl(InstanceListener instanceListener, FlowIdGenerator flowLongIdGenerator, QueryService queryService, TaskService taskService, FlwInstanceDao instanceDao, FlwHisInstanceDao hisInstanceDao, FlwExtInstanceDao extInstanceDao)
-
-
方法详细资料
-
createInstance
public FlwInstance createInstance(FlwProcess flwProcess, FlowCreator flowCreator, Map<String, Object> args, NodeModel nodeModel, boolean saveAsDraft, Supplier<FlwInstance> supplier) 创建活动实例- 指定者:
createInstance在接口中RuntimeService- 参数:
flwProcess- 流程定义对象flowCreator- 流程实例任务创建者args- 参数列表nodeModel- 当前所在节点saveAsDraft- 暂存草稿supplier- 初始化流程实例提供者- 返回:
- 活动流程实例对象
-
getProcessModelByInstanceId
根据流程实例ID获取流程实例模型- 指定者:
getProcessModelByInstanceId在接口中RuntimeService- 参数:
instanceId- 流程实例ID- 返回:
ProcessModel
-
addVariable
public boolean addVariable(Long instanceId, Map<String, Object> args, Function<FlwInstance, FlwInstance> function) 从接口复制的说明:RuntimeService根据 流程实例ID 更新流程实例全局变量- 指定者:
addVariable在接口中RuntimeService- 参数:
instanceId- 流程实例IDargs- 流程实例参数function- 待更新实例回调处理函数
-
endInstance
public boolean endInstance(Execution execution, Long instanceId, NodeModel endNode, InstanceState instanceState) 删除活动流程实例数据,更新历史流程实例的状态、结束时间- 指定者:
endInstance在接口中RuntimeService- 参数:
execution-ExecutioninstanceId- 流程实例IDendNode- 结束节点instanceState- 实例状态- 返回:
- true 成功 false 失败
-
getFlwHisInstance
protected FlwHisInstance getFlwHisInstance(Long instanceId, NodeModel endNode, FlwInstance flwInstance, InstanceState instanceState) -
instanceNotify
protected void instanceNotify(InstanceEventType eventType, Supplier<FlwHisInstance> supplier, NodeModel nodeModel, FlowCreator flowCreator) -
saveInstance
public void saveInstance(FlwInstance flwInstance, FlwProcess flwProcess, boolean saveAsDraft, FlowCreator flowCreator) 流程实例数据会保存至活动实例表、历史实例表- 指定者:
saveInstance在接口中RuntimeService- 参数:
flwInstance- 流程实例对象flwProcess- 流程定义对象saveAsDraft- 暂存草稿flowCreator- 处理人员
-
suspendInstanceById
从接口复制的说明:RuntimeService暂停流程实例InstanceState.suspend- 指定者:
suspendInstanceById在接口中RuntimeService- 参数:
instanceId- 流程实例IDflowCreator- 处理人员- 返回:
- true 成功 false 失败
-
activeInstanceById
从接口复制的说明:RuntimeService激活流程实例InstanceState.active- 指定者:
activeInstanceById在接口中RuntimeService- 参数:
instanceId- 流程实例IDflowCreator- 处理人员- 返回:
- true 成功 false 失败
-
updateInstanceStateById
protected boolean updateInstanceStateById(Long instanceId, InstanceState instanceState, FlowCreator flowCreator) 根据流程实例ID更新流程实例状态- 参数:
instanceId- 流程实例IDinstanceState- 流程实例状态flowCreator- 流程创建者
-
updateInstanceState
protected boolean updateInstanceState(FlwHisInstance dbFhi, InstanceState instanceState, FlowCreator flowCreator) 更新流程实例状态- 参数:
dbFhi- 数据库流程实例历史对象instanceState- 流程实例状态flowCreator- 流程创建者
-
reject
从接口复制的说明:RuntimeService流程实例拒绝审批强制终止(用于后续审核人员认为该审批不再需要继续,拒绝审批强行终止)- 指定者:
reject在接口中RuntimeService- 参数:
instanceId- 流程实例IDcurrentFlwTask- 当前任务flowCreator- 处理人员
-
revoke
从接口复制的说明:RuntimeService流程实例撤销(用于错误发起审批申请,发起人主动撤销)- 指定者:
revoke在接口中RuntimeService- 参数:
instanceId- 流程实例IDcurrentFlwTask- 当前任务flowCreator- 处理人员
-
timeout
从接口复制的说明:RuntimeService流程实例超时(设定审批时间超时,自动结束)- 指定者:
timeout在接口中RuntimeService- 参数:
instanceId- 流程实例IDcurrentFlwTask- 当前任务flowCreator- 处理人员
-
terminate
强制终止活动实例,并强制完成活动任务- 指定者:
terminate在接口中RuntimeService- 参数:
instanceId- 流程实例IDcurrentFlwTask- 当前任务flowCreator- 处理人员
-
forceComplete
protected boolean forceComplete(Long instanceId, FlwTask currentFlwTask, FlowCreator flowCreator, InstanceEventType instanceEventType, InstanceState instanceState, TaskEventType eventType) 强制完成流程实例- 参数:
instanceId- 流程实例IDcurrentFlwTask- 当前任务flowCreator- 处理人员instanceState- 流程实例最终状态eventType- 监听事件类型
-
forceCompleteAll
protected void forceCompleteAll(FlwInstance flwInstance, FlwTask currentFlwTask, FlowCreator flowCreator, InstanceEventType instanceEventType, InstanceState instanceState, TaskEventType eventType) 强制完成流程所有实例 -
updateInstance
更新活动实例- 指定者:
updateInstance在接口中RuntimeService- 参数:
flwInstance- 流程实例对象
-
updateInstanceModelById
从接口复制的说明:RuntimeService根据 流程实例ID 更新流程实例模型内容- 指定者:
updateInstanceModelById在接口中RuntimeService- 参数:
instanceId- 流程实例IDprocessModel- 流程模型- 返回:
- true 成功 false 失败
-
cascadeRemoveByProcessId
级联删除指定流程实例的所有数据删除表 flw_his_task_actor, flw_his_task, flw_task_actor, flw_task, flw_his_instance, flw_ext_instance, flw_instance
- 指定者:
cascadeRemoveByProcessId在接口中RuntimeService- 参数:
processId- 流程ID
-
cascadeRemoveByInstanceId
从接口复制的说明:RuntimeService级联删除表 flw_his_task_actor, flw_his_task, flw_task_actor, flw_task, flw_instance, flw_his_instance- 指定者:
cascadeRemoveByInstanceId在接口中RuntimeService- 参数:
instanceId- 流程实例ID
-
destroyByInstanceId
从接口复制的说明:RuntimeService根据 流程实例ID 作废流程- 指定者:
destroyByInstanceId在接口中RuntimeService- 参数:
instanceId- 流程实例IDargs- 流程实例参数- 返回:
- true 成功 false 失败
-
appendNodeModel
从接口复制的说明:RuntimeService追加节点模型(不执行任务跳转)执行追加节点模型调用
FlowEngine.executeAppendNodeModel(Long, NodeModel, FlowCreator, boolean)- 指定者:
appendNodeModel在接口中RuntimeService- 参数:
taskId- 任务IDnodeModel- 节点模型beforeAfter- true 前置 false 后置
-
updateModelContent
-
removeNodeModel
public boolean removeNodeModel(Long instanceId, String nodeKey, Function<NodeModel, Boolean> checkFunc) 从接口复制的说明:RuntimeService删除节点模型某个临时节点- 指定者:
removeNodeModel在接口中RuntimeService- 参数:
instanceId- 流程实例IDnodeKey- 节点KEYcheckFunc- 节点检查函数
-