diff --git a/application-engine/pom.xml b/application-engine/pom.xml index b22f9aaec1..2427ef6ed6 100644 --- a/application-engine/pom.xml +++ b/application-engine/pom.xml @@ -6,7 +6,7 @@ com.netgrif application-engine-parent - 7.0.0-RC10.1 + 7.0.0-RC10.2 application-engine diff --git a/application-engine/src/main/java/com/netgrif/application/engine/petrinet/service/PetriNetService.java b/application-engine/src/main/java/com/netgrif/application/engine/petrinet/service/PetriNetService.java index 759527b8bb..2781235bb5 100644 --- a/application-engine/src/main/java/com/netgrif/application/engine/petrinet/service/PetriNetService.java +++ b/application-engine/src/main/java/com/netgrif/application/engine/petrinet/service/PetriNetService.java @@ -138,6 +138,15 @@ public void evictAllCaches() { requireNonNull(cacheManager.getCache(cacheProperties.getPetriNetByIdentifier()), cacheProperties.getPetriNetByIdentifier()).clear(); } + @Override + public void evictCache(String id, String identifier, String version) { + requireNonNull(cacheManager.getCache(cacheProperties.getPetriNetById()), cacheProperties.getPetriNetById()).evict(id); + requireNonNull(cacheManager.getCache(cacheProperties.getPetriNetDefault()), cacheProperties.getPetriNetDefault()).evict(identifier); + requireNonNull(cacheManager.getCache(cacheProperties.getPetriNetLatest()), cacheProperties.getPetriNetLatest()).evict(identifier); + requireNonNull(cacheManager.getCache(cacheProperties.getPetriNetCache()), cacheProperties.getPetriNetCache()).evict(new ObjectId(id)); + requireNonNull(cacheManager.getCache(cacheProperties.getPetriNetByIdentifier()), cacheProperties.getPetriNetByIdentifier()).evict(identifier + version); + } + public void evictCache(PetriNet net) { requireNonNull(cacheManager.getCache(cacheProperties.getPetriNetById()), cacheProperties.getPetriNetById()).evict(net.getStringId()); requireNonNull(cacheManager.getCache(cacheProperties.getPetriNetDefault()), cacheProperties.getPetriNetDefault()).evict(net.getIdentifier()); @@ -150,7 +159,7 @@ public void evictCache(PetriNet net) { * Get read only Petri net. */ @Override - @Cacheable(value = "petriNetCache") + @Cacheable(value = "petriNetCache", unless = "#result == null") public PetriNet get(ObjectId petriNetId) { Optional optional = repository.findById(petriNetId.toString()); if (optional.isEmpty()) { @@ -301,7 +310,7 @@ protected final Optional doSaveInternal(PetriNet petriNet) { } @Override - @Cacheable(value = "petriNetById") + @Cacheable(value = "petriNetById", unless = "#result == null") public PetriNet getPetriNet(String id) { Optional net = repository.findById(id); if (net.isEmpty()) { diff --git a/application-engine/src/main/java/com/netgrif/application/engine/petrinet/service/interfaces/IPetriNetService.java b/application-engine/src/main/java/com/netgrif/application/engine/petrinet/service/interfaces/IPetriNetService.java index 234fedf217..e477c16658 100644 --- a/application-engine/src/main/java/com/netgrif/application/engine/petrinet/service/interfaces/IPetriNetService.java +++ b/application-engine/src/main/java/com/netgrif/application/engine/petrinet/service/interfaces/IPetriNetService.java @@ -257,6 +257,8 @@ ImportPetriNetEventOutcome importPetriNet(ImportPetriNetParams importPetriNetPar */ void evictAllCaches(); + void evictCache(String id, String identifier, String version); + /** * Evicts the cache for the given {@link PetriNet}. * diff --git a/application-engine/src/main/java/com/netgrif/application/engine/workflow/service/FieldActionsCacheService.java b/application-engine/src/main/java/com/netgrif/application/engine/workflow/service/FieldActionsCacheService.java index 0f6818ded2..4c9da89eac 100644 --- a/application-engine/src/main/java/com/netgrif/application/engine/workflow/service/FieldActionsCacheService.java +++ b/application-engine/src/main/java/com/netgrif/application/engine/workflow/service/FieldActionsCacheService.java @@ -54,6 +54,8 @@ public void cachePetriNetFunctions(PetriNet petriNet) { return; } + log.info("Caching functions for PetriNet id={}", petriNet.getIdentifier()); + List functions = petriNet.getFunctions(FunctionScope.GLOBAL).stream() .map(function -> CachedFunction.build(shell, function)) .collect(Collectors.toList()); @@ -66,6 +68,7 @@ public void cachePetriNetFunctions(PetriNet petriNet) { } else { globalFunctionsCache.evictIfPresent(petriNet.getIdentifier()); } + log.info("Finished caching functions for PetriNet id={}", petriNet.getIdentifier()); } @Override diff --git a/nae-object-library/pom.xml b/nae-object-library/pom.xml index aea8bb7345..cd4763f83f 100644 --- a/nae-object-library/pom.xml +++ b/nae-object-library/pom.xml @@ -7,7 +7,7 @@ com.netgrif application-engine-parent - 7.0.0-RC10.1 + 7.0.0-RC10.2 nae-object-library diff --git a/nae-spring-core-adapter/pom.xml b/nae-spring-core-adapter/pom.xml index a4938f3527..d6b882dd6f 100644 --- a/nae-spring-core-adapter/pom.xml +++ b/nae-spring-core-adapter/pom.xml @@ -7,7 +7,7 @@ com.netgrif application-engine-parent - 7.0.0-RC10.1 + 7.0.0-RC10.2 nae-spring-core-adapter diff --git a/nae-user-ce/pom.xml b/nae-user-ce/pom.xml index 53754d34ca..91fc102afa 100644 --- a/nae-user-ce/pom.xml +++ b/nae-user-ce/pom.xml @@ -6,7 +6,7 @@ com.netgrif application-engine-parent - 7.0.0-RC10.1 + 7.0.0-RC10.2 nae-user-ce diff --git a/nae-user-common/pom.xml b/nae-user-common/pom.xml index 82986242a2..9960e3cc9e 100644 --- a/nae-user-common/pom.xml +++ b/nae-user-common/pom.xml @@ -6,7 +6,7 @@ com.netgrif application-engine-parent - 7.0.0-RC10.1 + 7.0.0-RC10.2 nae-user-common diff --git a/pom.xml b/pom.xml index 5031750cf0..b610c584da 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.netgrif application-engine-parent - 7.0.0-RC10.1 + 7.0.0-RC10.2 pom NETGRIF Application Engine parent