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
This commit is contained in:
Gavin Cornwell
2013-11-18 09:55:47 +00:00
parent 744231ab1f
commit 200a140b33
2 changed files with 12 additions and 4 deletions

View File

@@ -19,7 +19,7 @@
sourceRef='start' sourceRef='start'
targetRef='adhocTask' /> targetRef='adhocTask' />
<userTask id="adhocTask" name="Review Task" <userTask id="adhocTask" name="Adhoc Task"
activiti:formKey="wf:adhocTask"> activiti:formKey="wf:adhocTask">
<extensionElements> <extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener"> <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">

View File

@@ -121,14 +121,14 @@ public class TaskNotificationListener implements TaskListener
TypeDefinition typeDefinition = propertyConverter.getWorkflowObjectFactory().getTaskTypeDefinition(taskFormKey, false); TypeDefinition typeDefinition = propertyConverter.getWorkflowObjectFactory().getTaskTypeDefinition(taskFormKey, false);
taskFormKey = typeDefinition.getName().toPrefixString(); taskFormKey = typeDefinition.getName().toPrefixString();
if(taskFormKey != null) if (taskFormKey != null)
{ {
String processDefinitionKey = ((ProcessDefinition) ((TaskEntity)task).getExecution().getProcessDefinition()).getKey(); String processDefinitionKey = ((ProcessDefinition) ((TaskEntity)task).getExecution().getProcessDefinition()).getKey();
String defName = propertyConverter.getWorkflowObjectFactory().buildGlobalId(processDefinitionKey); String defName = propertyConverter.getWorkflowObjectFactory().buildGlobalId(processDefinitionKey);
title = propertyConverter.getWorkflowObjectFactory().getTaskTitle(typeDefinition, defName, task.getName(), taskFormKey.replace(":", "_")); title = propertyConverter.getWorkflowObjectFactory().getTaskTitle(typeDefinition, defName, task.getName(), taskFormKey.replace(":", "_"));
} }
if(title == null) if (title == null)
{ {
if (task.getName() != null) if (task.getName() != null)
{ {
@@ -140,11 +140,19 @@ public class TaskNotificationListener implements TaskListener
} }
} }
// 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 // Send email notification
workflowNotificationUtils.sendWorkflowAssignedNotificationEMail( workflowNotificationUtils.sendWorkflowAssignedNotificationEMail(
ActivitiConstants.ENGINE_ID + "$" + task.getId(), ActivitiConstants.ENGINE_ID + "$" + task.getId(),
title, title,
task.getDescription(), description,
task.getDueDate(), task.getDueDate(),
Integer.valueOf(task.getPriority()), Integer.valueOf(task.getPriority()),
workflowPackage, workflowPackage,