public void initProcessDefinitionCache() { if (processDefinitionCache == null) { if (processDefinitionCacheLimit <= 0) { processDefinitionCache = new DefaultDeploymentCache<>(); } else { processDefinitionCache = new DefaultDeploymentCache<>(processDefinitionCacheLimit); } } }
@Override protected boolean removeEldestEntry(Map.Entry<String, T> eldest) { boolean removeEldest = size() > limit; if (removeEldest && LOGGER.isTraceEnabled()) { LOGGER.trace("Cache limit is reached, {} will be evicted", eldest.getKey()); } return removeEldest; }
public static BpmnModel getBpmnModelFromCache(String processDefinitionId) { ProcessDefinitionCacheEntry cacheEntry = CommandContextUtil.getProcessEngineConfiguration().getProcessDefinitionCache().get(processDefinitionId); if (cacheEntry != null) { return cacheEntry.getBpmnModel(); } return null; }
public void removeDeployment(String deploymentId, boolean cascade) { AppDeploymentEntity deployment = deploymentEntityManager.findById(deploymentId); if (deployment == null) { throw new FlowableObjectNotFoundException("Could not find a deployment with id '" + deploymentId + "'.", AppDeploymentEntity.class); } for (AppDefinition appDefinition : new AppDefinitionQueryImpl().deploymentId(deploymentId).list()) { appDefinitionCache.remove(appDefinition.getId()); } deploymentEntityManager.deleteDeploymentAndRelatedData(deploymentId, cascade); }
public static DmnDefinition getDmnDefinitionFromCache(String decisionTableId) { DecisionTableCacheEntry cacheEntry = CommandContextUtil.getDmnEngineConfiguration().getDecisionCache().get(decisionTableId); if (cacheEntry != null) { return cacheEntry.getDmnDefinition(); } return null; }
public void initAppResourceCache() { if (appResourceCache == null) { if (appResourceCacheLimit <= 0) { appResourceCache = new DefaultDeploymentCache<>(); } else { appResourceCache = new DefaultDeploymentCache<>(appResourceCacheLimit); } } }
public void removeDeployment(String deploymentId, boolean cascade) { CmmnDeploymentEntity deployment = deploymentEntityManager.findById(deploymentId); if (deployment == null) { throw new FlowableObjectNotFoundException("Could not find a deployment with id '" + deploymentId + "'.", CmmnDeploymentEntity.class); } for (CaseDefinition caseDefinition : new CaseDefinitionQueryImpl().deploymentId(deploymentId).list()) { caseDefinitionCache.remove(caseDefinition.getId()); } deploymentEntityManager.deleteDeploymentAndRelatedData(deploymentId, cascade); }
public static AppModel getAppModel(String appDefinitionId) { AppDeploymentManager deploymentManager = CommandContextUtil.getAppEngineConfiguration().getDeploymentManager(); AppDefinitionCacheEntry cacheEntry = deploymentManager.getAppDefinitionCache().get(appDefinitionId); if (cacheEntry != null) { return cacheEntry.getAppModel(); } deploymentManager.findDeployedAppDefinitionById(appDefinitionId); return deploymentManager.getAppDefinitionCache().get(appDefinitionId).getAppModel(); }
protected void initAppDefinitionCache() { if (appDefinitionCache == null) { if (appDefinitionCacheLimit <= 0) { appDefinitionCache = new DefaultDeploymentCache<>(); } else { appDefinitionCache = new DefaultDeploymentCache<>(appDefinitionCacheLimit); } } }
public void removeDeployment(String deploymentId) { FormDeploymentEntity deployment = deploymentEntityManager.findById(deploymentId); if (deployment == null) { throw new FlowableObjectNotFoundException("Could not find a deployment with id '" + deploymentId + "'."); } // Remove any form definition from the cache List<FormDefinition> forms = new FormDefinitionQueryImpl().deploymentId(deploymentId).list(); // Delete data deploymentEntityManager.deleteDeployment(deploymentId); for (FormDefinition form : forms) { formCache.remove(form.getId()); } }
public static CmmnModel getCmmnModel(String caseDefinitionId) { CmmnDeploymentManager deploymentManager = CommandContextUtil.getCmmnEngineConfiguration().getDeploymentManager(); CaseDefinitionCacheEntry cacheEntry = deploymentManager.getCaseDefinitionCache().get(caseDefinitionId); if (cacheEntry != null) { return cacheEntry.getCmmnModel(); } deploymentManager.findDeployedCaseDefinitionById(caseDefinitionId); return deploymentManager.getCaseDefinitionCache().get(caseDefinitionId).getCmmnModel(); }
public void initKnowledgeBaseCache() { if (knowledgeBaseCache == null) { if (knowledgeBaseCacheLimit <= 0) { knowledgeBaseCache = new DefaultDeploymentCache<>(); } else { knowledgeBaseCache = new DefaultDeploymentCache<>(knowledgeBaseCacheLimit); } } }
public static AppDefinition getAppDefinition(String appDefinitionId) { AppDeploymentManager deploymentManager = CommandContextUtil.getAppEngineConfiguration().getDeploymentManager(); AppDefinitionCacheEntry cacheEntry = deploymentManager.getAppDefinitionCache().get(appDefinitionId); return getAppDefinition(appDefinitionId, deploymentManager, cacheEntry); }
protected void initCaseDefinitionCache() { if (caseDefinitionCache == null) { if (caseDefinitionCacheLimit <= 0) { caseDefinitionCache = new DefaultDeploymentCache<>(); } else { caseDefinitionCache = new DefaultDeploymentCache<>(caseDefinitionCacheLimit); } } }
public static CaseDefinition getCaseDefinition(String caseDefinitionId) { CmmnDeploymentManager deploymentManager = CommandContextUtil.getCmmnEngineConfiguration().getDeploymentManager(); CaseDefinitionCacheEntry cacheEntry = deploymentManager.getCaseDefinitionCache().get(caseDefinitionId); return getCaseDefinition(caseDefinitionId, deploymentManager, cacheEntry); }
public void initExpressionManager() { if (expressionManager == null) { ProcessExpressionManager processExpressionManager = new ProcessExpressionManager(delegateInterceptor, beans); if (isExpressionCacheEnabled) { processExpressionManager.setExpressionCache(new DefaultDeploymentCache<>(expressionCacheSize)); processExpressionManager.setExpressionTextLengthCacheLimit(expressionTextLengthCacheLimit); } expressionManager = processExpressionManager; } expressionManager.setFunctionDelegates(flowableFunctionDelegates); expressionManager.setExpressionEnhancers(expressionEnhancers); }
public static SimpleFormModel getFormDefinitionFromCache(String formId) { FormEngineConfiguration formEngineConfiguration = CommandContextUtil.getFormEngineConfiguration(); FormDefinitionCacheEntry cacheEntry = formEngineConfiguration.getFormDefinitionCache().get(formId); if (cacheEntry != null) { return formEngineConfiguration.getFormJsonConverter().convertToFormModel(cacheEntry.getFormDefinitionJson()); } return null; }
public void initExpressionManager() { if (expressionManager == null) { CmmnExpressionManager cmmnExpressionManager = new CmmnExpressionManager(beans); if (isExpressionCacheEnabled) { cmmnExpressionManager.setExpressionCache(new DefaultDeploymentCache<>(expressionCacheSize)); cmmnExpressionManager.setExpressionTextLengthCacheLimit(expressionTextLengthCacheLimit); } expressionManager = cmmnExpressionManager; } expressionManager.setFunctionDelegates(flowableFunctionDelegates); expressionManager.setExpressionEnhancers(expressionEnhancers); }
public static DecisionTableEntity getDecisionTableEntity(String decisionTableId, boolean checkCacheOnly) { if (checkCacheOnly) { DecisionTableCacheEntry cacheEntry = CommandContextUtil.getDmnEngineConfiguration().getDecisionCache().get(decisionTableId); if (cacheEntry != null) { return cacheEntry.getDecisionTableEntity(); } return null; } else { // This will check the cache in the findDeployedDecisionById method return CommandContextUtil.getDmnEngineConfiguration().getDeploymentManager().findDeployedDecisionById(decisionTableId); } }
public static FormDefinitionEntity getFormDefinitionEntity(String formDefinitionId, boolean checkCacheOnly) { if (checkCacheOnly) { FormDefinitionCacheEntry cacheEntry = CommandContextUtil.getFormEngineConfiguration().getFormDefinitionCache().get(formDefinitionId); if (cacheEntry != null) { return cacheEntry.getFormDefinitionEntity(); } return null; } else { // This will check the cache in the findDeployedFormDefinitionById method return CommandContextUtil.getFormEngineConfiguration().getDeploymentManager().findDeployedFormDefinitionById(formDefinitionId); } }