ALF-13474 possibility of deleting compleded workflows + explorer ui cancel action fix

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@35900 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Frederik Heremans
2012-04-30 12:07:23 +00:00
parent 304f8ff0f9
commit e64357dd45

View File

@@ -72,13 +72,21 @@ public class CancelWorkflowDialog extends BaseDialogBean
throws Exception throws Exception
{ {
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
logger.debug("Cancelling workflow with id: " + this.getWorkflowInstance().id); logger.debug("Cancelling workflow with id: " + this.getWorkflowInstance().getId());
WorkflowInstance instance = this.getWorkflowInstance();
if(instance.isActive()) {
// cancel the workflow // cancel the workflow
this.getWorkflowService().cancelWorkflow(this.getWorkflowInstance().id); this.getWorkflowService().cancelWorkflow(this.getWorkflowInstance().getId());
}
else
{
// delete the workflow
this.getWorkflowService().deleteWorkflow(this.getWorkflowInstance().getId());
}
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
logger.debug("Cancelled workflow with id: " + this.getWorkflowInstance().id); logger.debug("Cancelled workflow with id: " + this.getWorkflowInstance().getId());
return outcome; return outcome;
} }
@@ -120,10 +128,10 @@ public class CancelWorkflowDialog extends BaseDialogBean
String confirmMsg = Application.getMessage(FacesContext.getCurrentInstance(), String confirmMsg = Application.getMessage(FacesContext.getCurrentInstance(),
"cancel_workflow_confirm"); "cancel_workflow_confirm");
String workflowLabel = this.getWorkflowInstance().definition.title; String workflowLabel = this.getWorkflowInstance().getDefinition().getTitle();
if (this.getWorkflowInstance().description != null && this.getWorkflowInstance().description.length() > 0) if (this.getWorkflowInstance().getDescription() != null && this.getWorkflowInstance().getDescription().length() > 0)
{ {
workflowLabel = workflowLabel + " (" + this.getWorkflowInstance().description + ")"; workflowLabel = workflowLabel + " (" + this.getWorkflowInstance().getDescription() + ")";
} }
return MessageFormat.format(confirmMsg, new Object[] {workflowLabel}); return MessageFormat.format(confirmMsg, new Object[] {workflowLabel});