Sometimes our authors upload 2k-4k images at a time, which triggers multiple workflows through launchers, as these instances are very high in number, many times they get stuck and the image is unable to be processed.
I am trying to use the ACS AEM Commons’ Workflow Instance Remover, to schedule it to run every hour, and delete the workflow instances if it's in a running state from the last 60 mins. It is working fine, and all the stuck workflow instances are getting deleted.
However, the assets still show an "In Workflow" message, even though the workflow instance is removed from /var/workflow/instance folder.
How can we fix it?
@arunpatidar @Bhuwan_B @SantoshSai
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @ashish_mishra1,
If you will look into card implementation (it can be found on crx under /libs/dam/gui/coral/components/admin/contentrenderer/card/common/card-banner.jsp), you will see that In Workflow... status is shown base on information from WorkflowStatus object and method isRunningWorkflow.
isRunningWorkflow method is using PaylodMap underneath which is using com.adobe.granite.workflow.core.PayloadMapCache.
Most likely after removing workflow instance by ACS Commons Instance Remover tool, above cache has not been refreshed. In other words it still includes information about workflow instances that has been removed.
Luckily this is in memory cache. You can try one of below options to remove outdated information from that cache.
import com.adobe.granite.workflow.PayloadMap CLEAR_CACHE = false PayloadMap pm = resourceResolver.adaptTo(PayloadMap.class) // getting all entries from cache pm?.payloadMapCache?.cache?.each {payloadPath, wfInstance -> println "$payloadPath, $wfInstance" } // checking if cache is initilized and setting proper value that will allow to refresh it if (pm?.payloadMapCache?.isInitialized && CLEAR_CACHE) { pm?.payloadMapCache?.isInitialized = false // clearing the cache pm?.payloadMapCache?.cache?.clear() // initializing the cache pm?.payloadMapCache?.init() println "Workflow payload cache has been initialized" }In case you would like to clear the cache, please set CLEAR_CACHE variable in above script to true. In other case script will only return list of all items included in the cache.
Hi @ashish_mishra1,
If you will look into card implementation (it can be found on crx under /libs/dam/gui/coral/components/admin/contentrenderer/card/common/card-banner.jsp), you will see that In Workflow... status is shown base on information from WorkflowStatus object and method isRunningWorkflow.
isRunningWorkflow method is using PaylodMap underneath which is using com.adobe.granite.workflow.core.PayloadMapCache.
Most likely after removing workflow instance by ACS Commons Instance Remover tool, above cache has not been refreshed. In other words it still includes information about workflow instances that has been removed.
Luckily this is in memory cache. You can try one of below options to remove outdated information from that cache.
import com.adobe.granite.workflow.PayloadMap CLEAR_CACHE = false PayloadMap pm = resourceResolver.adaptTo(PayloadMap.class) // getting all entries from cache pm?.payloadMapCache?.cache?.each {payloadPath, wfInstance -> println "$payloadPath, $wfInstance" } // checking if cache is initilized and setting proper value that will allow to refresh it if (pm?.payloadMapCache?.isInitialized && CLEAR_CACHE) { pm?.payloadMapCache?.isInitialized = false // clearing the cache pm?.payloadMapCache?.cache?.clear() // initializing the cache pm?.payloadMapCache?.init() println "Workflow payload cache has been initialized" }In case you would like to clear the cache, please set CLEAR_CACHE variable in above script to true. In other case script will only return list of all items included in the cache.
Hi @lukasz-m ,
We are using workflow remover to purge the running workflows. But, we are not able author the tool. Is there any configuration that needs to be done "ACS AEM Commons’ Workflow Instance Remover"?
AEM Version - Cloud Service
How to configure ACS AEM Commons’ Workflow Instance Remover and author workflow remover?
Views
Replies
Total Likes