Ejemplo n.º 1
0
  public void removeFromCache(String processId, long processInstanceId) {
    String businessId = businessIdCache.get(processInstanceId);
    if (StringUtils.isNotBlank(businessId)) {
      processInstanceIdCache.remove(processId + "_" + businessId);
      businessIdCache.remove(processInstanceId);

      ProcessInstanceBOInfo info =
          processInstanceBOService.getProcessInstanceBOInfo(processInstanceId);
      if (info != null) {
        processInstanceBOService.removeProcessInstanceBOInfo(info);
      }
    }
  }
Ejemplo n.º 2
0
 public String getBusinessId(Long processInstanceId) {
   String businessId = businessIdCache.get(processInstanceId);
   if (businessId == null) {
     synchronized (ProcessInstanceBOCache.class) {
       if (businessId == null) {
         logger.info("fetch from database");
         ProcessInstanceBOInfo info =
             processInstanceBOService.getProcessInstanceBOInfo(processInstanceId);
         businessId = info != null ? info.getBusinessId() : null;
         if (businessId != null) {
           put(info.getProcessId(), businessId, processInstanceId);
         }
       }
     }
   }
   return businessId;
 }
Ejemplo n.º 3
0
 public Long getProcessInstanceId(String processId, String businessId) {
   Long value = processInstanceIdCache.get(processId + "_" + businessId);
   if (value == null) {
     synchronized (ProcessInstanceBOCache.class) {
       if (value == null) {
         logger.info("fetch from database");
         ProcessInstanceBOInfo info =
             processInstanceBOService.getProcessInstanceBOInfo(processId, businessId);
         value = info != null ? info.getProcessInstanceId() : null;
         if (value != null) {
           put(processId, businessId, value);
         }
       }
     }
   }
   return value;
 }