Interface WorkflowInstanceRemover
-
public interface WorkflowInstanceRemover
-
-
Field Summary
Fields Modifier and Type Field Description static StringMODEL_IDstatic StringWORKFLOW_INSTANCES_PATHDeprecated.please use the multi-value WORKFLOW_INSTANCES_PATHS instead.static String[]WORKFLOW_INSTANCES_PATHS
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidforceQuit()Forces an interruption of the Workflow removal process.WorkflowRemovalStatusgetStatus()Gets the Workflow Remover's status.intremoveWorkflowInstances(org.apache.sling.api.resource.ResourceResolver resourceResolver, Collection<String> modelIds, Collection<String> statuses, Collection<Pattern> payloads, Calendar olderThan)Removes workflow instances that match the parameter criteria.intremoveWorkflowInstances(org.apache.sling.api.resource.ResourceResolver resourceResolver, Collection<String> modelIds, Collection<String> statuses, Collection<Pattern> payloads, Calendar olderThan, int batchSize)Removes workflow instances that match the parameter criteria.intremoveWorkflowInstances(org.apache.sling.api.resource.ResourceResolver resourceResolver, Collection<String> modelIds, Collection<String> statuses, Collection<Pattern> payloads, Calendar olderThan, int batchSize, int maxDurationInMins)Removes workflow instances that match the parameter criteria.
-
-
-
Field Detail
-
WORKFLOW_INSTANCES_PATH
@Deprecated static final String WORKFLOW_INSTANCES_PATH
Deprecated.please use the multi-value WORKFLOW_INSTANCES_PATHS instead.- See Also:
- Constant Field Values
-
WORKFLOW_INSTANCES_PATHS
static final String[] WORKFLOW_INSTANCES_PATHS
-
MODEL_ID
static final String MODEL_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
removeWorkflowInstances
int removeWorkflowInstances(org.apache.sling.api.resource.ResourceResolver resourceResolver, Collection<String> modelIds, Collection<String> statuses, Collection<Pattern> payloads, Calendar olderThan) throws org.apache.sling.api.resource.PersistenceException, WorkflowRemovalException, InterruptedException, WorkflowRemovalForceQuitExceptionRemoves workflow instances that match the parameter criteria.- Parameters:
resourceResolver- the resource resolver; must have access to read/delete workflow instancesmodelIds- WF Models to removestatuses- WF Statuses to removepayloads- Regexes; WF Payloads to removeolderThan- UTC time in milliseconds; only delete WF's started after this time- Returns:
- the number of WF instances removed
- Throws:
org.apache.sling.api.resource.PersistenceExceptionWorkflowRemovalExceptionInterruptedExceptionWorkflowRemovalForceQuitException
-
removeWorkflowInstances
int removeWorkflowInstances(org.apache.sling.api.resource.ResourceResolver resourceResolver, Collection<String> modelIds, Collection<String> statuses, Collection<Pattern> payloads, Calendar olderThan, int batchSize) throws org.apache.sling.api.resource.PersistenceException, WorkflowRemovalException, InterruptedException, WorkflowRemovalForceQuitExceptionRemoves workflow instances that match the parameter criteria.- Parameters:
resourceResolver- the resource resolver; must have access to read/delete workflow instancesmodelIds- WF Models to removestatuses- WF Statuses to removepayloads- Regexes; WF Payloads to removeolderThan- UTC time in milliseconds; only delete WF's started after this timebatchSize- number of workflow instances to delete per JCR save- Returns:
- the number of WF instances removed
- Throws:
org.apache.sling.api.resource.PersistenceExceptionWorkflowRemovalExceptionInterruptedExceptionWorkflowRemovalForceQuitException
-
removeWorkflowInstances
int removeWorkflowInstances(org.apache.sling.api.resource.ResourceResolver resourceResolver, Collection<String> modelIds, Collection<String> statuses, Collection<Pattern> payloads, Calendar olderThan, int batchSize, int maxDurationInMins) throws org.apache.sling.api.resource.PersistenceException, WorkflowRemovalException, InterruptedException, WorkflowRemovalForceQuitExceptionRemoves workflow instances that match the parameter criteria.- Parameters:
resourceResolver- the resource resolver; must have access to read/delete workflow instancesmodelIds- WF Models to removestatuses- WF Statuses to removepayloads- Regexes; WF Payloads to removeolderThan- UTC time in milliseconds; only delete WF's started after this timebatchSize- number of workflow instances to delete per JCR savemaxDurationInMins- max number of mins the workflow removal process is allowed to run- Returns:
- the number of WF instances removed
- Throws:
org.apache.sling.api.resource.PersistenceExceptionWorkflowRemovalExceptionInterruptedExceptionWorkflowRemovalForceQuitException
-
getStatus
WorkflowRemovalStatus getStatus()
Gets the Workflow Remover's status. *- Returns:
- the workflow remover's status object
-
forceQuit
void forceQuit()
Forces an interruption of the Workflow removal process. Any uncommited changes will be lost.
-
-