当前位置:   article > 正文

【Activiti研究】关于Activiti变量范围VariableScope的实现(子类ExecutionEntity,TaskEntity)_variablescope activiti

variablescope activiti
void org.activiti.engine.impl.persistence.entity.VariableScopeImpl
//调用子类ExecutionEntity或taskEntity的loadVariableInstances加载本地变量
ensureVariableInstancesInitialized()
//只判断ExecutionEntity当前AcitityImpl是否存在,存在则返回this
getSourceActivityExecution()
//加载子类ExecutionEntity或TaskEntity的本地变量
loadVariableInstances()
//查找ExecutionEntity或TaskEntity的父类ExecutionEntity
getParentVariableScope()
//收集本地(ExecutionEntity或TaskEntity)和递归所有父类变量
collectVariables(HashMap<String, Object> variables)
//同理如上,只是收集的是VariableInstance
collectVariableInstances(HashMap<String, VariableInstance> variables)
//在本地(ExecutionEntity或TaskEntity)id查找对应的变量
getSpecificVariables(Collection<String> variableNames)
//1.本地已使过的缓存查找加载
//2.判断fetchAllVariables=true强制加载本层变量,
//否则false加载根据本地(ExecutionEntity或TaskEntity)id,并递归调用找不到查找父亲
getVariables(Collection<String> variableNames, boolean fetchAllVariables)
getVariableInstances(Collection<String> variableNames, boolean fetchAllVariables)
//1.从本地已使过的缓存中
//2.判断fetchAllVariables,是否强制加载本层变量
//3.最后递归父类getVariableInstance方法
getVariable(String variableName, boolean fetchAllVariables)
getVariableInstance(String variableName, boolean fetchAllVariables) 
//同上,但只查询本层次(ExecutionEntity或TaskEntity)变量
getVariableLocal(String variableName, boolean fetchAllVariables)
getVariableInstanceLocal(String variableName, boolean fetchAllVariables)
//判断本层级(ExecutionEntity或TaskEntity)及递归父层是否存在变量
hasVariables()
//本层级(ExecutionEntity或TaskEntity)是否存在变量
hasVariablesLocal()
//判断本层级是否存在变量variableName
hasVariable(String variableName)
//先判断本层级,再递归父级
hasVariableLocal(String variableName)
//收集所有层级变量名称
collectVariableNames(Set<String> variableNames)
//为变量实例设置exectionId,processInstanceId(taskId)
initializeVariableInstanceBackPointer(VariableInstanceEntity variableInstance)
//查找引擎配置中的所有变量类型,根据值查找对应VariableType,新建保存VariableInstanceEntity
//调用上面方法,变量实例与流程实例做关联
//最后记录历史变量与历史变量详情
createVariableInstance(String variableName, Object value, ExecutionEntity sourceActivityExecution)
//获取变量或本地变量,并进行类型强转返回
getVariable(String variableName, Class<T> variableClass)
getVariableLocal(String variableName, Class<T> variableClass)
//更新变量实例的变量值或变量类型
updateVariableInstance(VariableInstanceEntity variableInstance, Object value, ExecutionEntity sourceActivityExecution)
//根据变量名查找本地变量,不存在递归查找父类变量
//找到具体变量实例后,deleteVariableInstanceForExplicitUserCall进行删除,并作日志记录
removeVariable(String variableName)...
deleteVariableInstanceForExplicitUserCall(VariableInstanceEntity variableInstance, ExecutionEntity sourceActivityExecution) 
//本地已使用缓存中查找变量,找不到查本地所有变量中查找,找到更新updateVariableInstance,找不到就创建createVariableLocal
setVariableLocal(String variableName, Object value, ExecutionEntity sourceActivityExecution, boolean fetchAllVariables)
//删除本层级(ExecutionEntity或TaskEntity)所有变量
deleteVariablesInstanceForLeavingScope()
//记录历史变量详情时,使用ExecutionEntity为true,TaskEntity为false
isActivityIdUsedForDetails()
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/658192
推荐阅读
相关标签
  

闽ICP备14008679号