Workflow Notification:

* Activiti reassign notification hook working



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29937 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2011-08-22 07:01:32 +00:00
parent 24354aae0a
commit 557980f0af
2 changed files with 34 additions and 0 deletions

View File

@@ -29,6 +29,7 @@
<property name="avmSyncService" ref="AVMSyncService"/>
<property name="dictionaryService" ref="dictionaryService"/>
<property name="protectedNodeService" ref="NodeService"/>
<property name="services" ref="ServiceRegistry"/>
</bean>
<bean id="workflowPackageImpl" class="org.alfresco.repo.workflow.WorkflowPackageImpl">

View File

@@ -31,6 +31,7 @@ import java.util.Set;
import org.alfresco.model.ContentModel;
import org.alfresco.model.WCMModel;
import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.avmsync.AVMDifference;
import org.alfresco.service.cmr.avmsync.AVMSyncService;
import org.alfresco.service.cmr.dictionary.DictionaryService;
@@ -77,6 +78,7 @@ public class WorkflowServiceImpl implements WorkflowService
private AVMSyncService avmSyncService;
private DictionaryService dictionaryService;
private NodeService protectedNodeService;
private ServiceRegistry services;
/**
* Sets the Authority Service
@@ -158,6 +160,16 @@ public class WorkflowServiceImpl implements WorkflowService
this.protectedNodeService = protectedNodeService;
}
/**
* Set the service registry
*
* @param services service registry
*/
public void setServices(ServiceRegistry services)
{
this.services = services;
}
/*
* (non-Javadoc)
* @see
@@ -693,6 +705,27 @@ public class WorkflowServiceImpl implements WorkflowService
WorkflowInstance instance = task.getPath().getInstance();
workflowPackageComponent.setWorkflowForPackage(instance);
}
// Get the start task
String instanceId = task.getPath().getInstance().getId();
WorkflowTask startTask = component.getStartTask(instanceId);
// Get the email notification flag
Boolean sendEMailNotification = (Boolean) startTask.getProperties().get(WorkflowModel.PROP_SEND_EMAIL_NOTIFICATIONS);
// Get the 'new' assignee
String assignee = (String)properties.get(ContentModel.PROP_OWNER);
if (assignee != null && assignee.length() != 0 &&
Boolean.TRUE.equals(sendEMailNotification) == true)
{
// Send the notification
WorkflowNotificationUtils.sendWorkflowAssignedNotificationEMail(
services,
taskId,
assignee,
false);
}
return task;
}