|
@@ -306,7 +306,12 @@ public class DefaultBpmDefineReader implements IBpmDefineReader {
|
|
|
if(isCacheOpenning() && getCache().exists(Region.REGION_IBPS_BPM_DEF, cacheKey)) {
|
|
if(isCacheOpenning() && getCache().exists(Region.REGION_IBPS_BPM_DEF, cacheKey)) {
|
|
|
CacheObject cacheObject = getCache().get(Region.REGION_IBPS_BPM_DEF, cacheKey, true);
|
|
CacheObject cacheObject = getCache().get(Region.REGION_IBPS_BPM_DEF, cacheKey, true);
|
|
|
bpmProcDefine = (BpmProcDefine) cacheObject.getValue();
|
|
bpmProcDefine = (BpmProcDefine) cacheObject.getValue();
|
|
|
- return bpmProcDefine;
|
|
|
|
|
|
|
+ if(bpmProcDefine != null){
|
|
|
|
|
+ return bpmProcDefine;
|
|
|
|
|
+ }
|
|
|
|
|
+ else{
|
|
|
|
|
+ logger.warn("Can't get BpmProcDefine from cache with defID=" + procDefineId);
|
|
|
|
|
+ }
|
|
|
// 复制对象,防止外部操作直接修改缓存数据
|
|
// 复制对象,防止外部操作直接修改缓存数据
|
|
|
// 上移到对应修改数据的位置
|
|
// 上移到对应修改数据的位置
|
|
|
//return BeanUtils.copy(bpmProcDefine);
|
|
//return BeanUtils.copy(bpmProcDefine);
|
|
@@ -316,6 +321,7 @@ public class DefaultBpmDefineReader implements IBpmDefineReader {
|
|
|
BpmDefineRepository bpmDefineRepository = AppUtil.getBean(BpmDefineRepository.class);
|
|
BpmDefineRepository bpmDefineRepository = AppUtil.getBean(BpmDefineRepository.class);
|
|
|
BpmDefinePo bpmDefinePo = bpmDefineRepository.getByDefId(procDefineId, true);
|
|
BpmDefinePo bpmDefinePo = bpmDefineRepository.getByDefId(procDefineId, true);
|
|
|
if(bpmDefinePo == null) {
|
|
if(bpmDefinePo == null) {
|
|
|
|
|
+ logger.warn("Can't get bpmDefinePo with defID=" + procDefineId);
|
|
|
return bpmProcDefine;
|
|
return bpmProcDefine;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -328,9 +334,11 @@ public class DefaultBpmDefineReader implements IBpmDefineReader {
|
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
|
logger.error(e.getMessage(), e);
|
|
logger.error(e.getMessage(), e);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ if(bpmProcDefine == null){
|
|
|
|
|
+ logger.warn("Can't get BpmProcDefine from database with defID=" + procDefineId);
|
|
|
|
|
+ }
|
|
|
// 添加缓存
|
|
// 添加缓存
|
|
|
- if(isCacheOpenning()){
|
|
|
|
|
|
|
+ if(isCacheOpenning() && bpmProcDefine != null ){
|
|
|
getCache().set(Region.REGION_IBPS_BPM_DEF, cacheKey, bpmProcDefine);
|
|
getCache().set(Region.REGION_IBPS_BPM_DEF, cacheKey, bpmProcDefine);
|
|
|
}
|
|
}
|
|
|
|
|
|