From 200a140b330a97f3c2d377eaf1de2b20fead7995 Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Mon, 18 Nov 2013 09:55:47 +0000 Subject: [PATCH] CLOUD-2178: Incorrect defaults used when no message is supplied when starting a hybrid workflow CLOUD-2167: Notification emails for assigned tasks are not populated correctly NOTE: If no message is supplied the task type is used as the description rather than empty string in the email notification. Also fixed the task type display for "simple cloud task", now shows "Task" and not "Review". git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@57957 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- config/alfresco/workflow/hybrid-adhoc.bpmn20.xml | 2 +- .../tasklistener/TaskNotificationListener.java | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/config/alfresco/workflow/hybrid-adhoc.bpmn20.xml b/config/alfresco/workflow/hybrid-adhoc.bpmn20.xml index 1324dab4a8..b7bf5b6d0e 100644 --- a/config/alfresco/workflow/hybrid-adhoc.bpmn20.xml +++ b/config/alfresco/workflow/hybrid-adhoc.bpmn20.xml @@ -19,7 +19,7 @@ sourceRef='start' targetRef='adhocTask' /> - diff --git a/source/java/org/alfresco/repo/workflow/activiti/tasklistener/TaskNotificationListener.java b/source/java/org/alfresco/repo/workflow/activiti/tasklistener/TaskNotificationListener.java index 68782038b3..82c052d5c7 100644 --- a/source/java/org/alfresco/repo/workflow/activiti/tasklistener/TaskNotificationListener.java +++ b/source/java/org/alfresco/repo/workflow/activiti/tasklistener/TaskNotificationListener.java @@ -121,14 +121,14 @@ public class TaskNotificationListener implements TaskListener TypeDefinition typeDefinition = propertyConverter.getWorkflowObjectFactory().getTaskTypeDefinition(taskFormKey, false); taskFormKey = typeDefinition.getName().toPrefixString(); - if(taskFormKey != null) + if (taskFormKey != null) { String processDefinitionKey = ((ProcessDefinition) ((TaskEntity)task).getExecution().getProcessDefinition()).getKey(); String defName = propertyConverter.getWorkflowObjectFactory().buildGlobalId(processDefinitionKey); title = propertyConverter.getWorkflowObjectFactory().getTaskTitle(typeDefinition, defName, task.getName(), taskFormKey.replace(":", "_")); } - if(title == null) + if (title == null) { if (task.getName() != null) { @@ -139,12 +139,20 @@ public class TaskNotificationListener implements TaskListener title = taskFormKey.replace(":", "_"); } } + + // Make sure a description is present + String description = task.getDescription(); + if (description == null || description.length() == 0) + { + // use the task title as the description + description = title; + } // Send email notification workflowNotificationUtils.sendWorkflowAssignedNotificationEMail( ActivitiConstants.ENGINE_ID + "$" + task.getId(), title, - task.getDescription(), + description, task.getDueDate(), Integer.valueOf(task.getPriority()), workflowPackage,