Fix for CLOUD-1824 (partial).

This fix addresses the creation of 'ghost tasks' - or more correctly, the failure to properly clean up ghost tasks.
There was already code to automatically delete invitation tasks when a site was deleted, but it was no longer working and had no test coverage.

This checkin adds a test case for this issue and also fixes it.
I also added & improved logging in various places.
The bug was in ActionExecuterAbstractBase, where an action run on a non-existent, but non-null, NodeRef was considered to be run on a locked node and hence not run.



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@52158 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Neil McErlean
2013-07-04 18:13:56 +00:00
parent e4b1be9f43
commit 437ba4e516
5 changed files with 224 additions and 14 deletions

View File

@@ -27,12 +27,16 @@ import org.alfresco.service.cmr.action.ParameterDefinition;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.workflow.WorkflowService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* @author dward
*/
public class CancelWorkflowActionExecuter extends ActionExecuterAbstractBase
{
protected static Log log = LogFactory.getLog(CancelWorkflowActionExecuter.class);
public static String NAME = "cancel-workflow";
public static final String PARAM_WORKFLOW_ID_LIST = "workflow-id-list"; // list of workflow IDs
@@ -55,6 +59,9 @@ public class CancelWorkflowActionExecuter extends ActionExecuterAbstractBase
{
@SuppressWarnings("unchecked")
List<String> workflowIds = (List<String>) action.getParameterValue(PARAM_WORKFLOW_ID_LIST);
if (log.isTraceEnabled()) { log.trace("Cancelling " + (workflowIds == null ? 0 : workflowIds.size()) + " workflows by ID."); }
if (workflowIds != null && !workflowIds.isEmpty())
{
this.workflowService.cancelWorkflows(workflowIds);

View File

@@ -570,6 +570,8 @@ public class WorkflowServiceImpl implements WorkflowService
*/
public List<WorkflowInstance> cancelWorkflows(List<String> workflowIds)
{
if (logger.isTraceEnabled()) { logger.trace("Cancelling " + (workflowIds == null ? 0 : workflowIds.size()) + " workflowIds..."); }
List<WorkflowInstance> result = new ArrayList<WorkflowInstance>(workflowIds.size());
// Batch the workflow IDs by engine ID