mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
RM-652: Updated "Reject" rule is executed when the record is created
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@49881 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1105,6 +1105,7 @@
|
|||||||
<property name="ownableService" ref="OwnableService" />
|
<property name="ownableService" ref="OwnableService" />
|
||||||
<property name="notificationHelper" ref="recordsManagementNotificationHelper"/>
|
<property name="notificationHelper" ref="recordsManagementNotificationHelper"/>
|
||||||
<property name="capabilityService" ref="CapabilityService" />
|
<property name="capabilityService" ref="CapabilityService" />
|
||||||
|
<property name="ruleService" ref="RuleService" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="RecordService" class="org.springframework.aop.framework.ProxyFactoryBean">
|
<bean id="RecordService" class="org.springframework.aop.framework.ProxyFactoryBean">
|
||||||
|
@@ -62,6 +62,7 @@ import org.alfresco.service.cmr.dictionary.PropertyDefinition;
|
|||||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.repository.NodeService;
|
import org.alfresco.service.cmr.repository.NodeService;
|
||||||
|
import org.alfresco.service.cmr.rule.RuleService;
|
||||||
import org.alfresco.service.cmr.security.AccessPermission;
|
import org.alfresco.service.cmr.security.AccessPermission;
|
||||||
import org.alfresco.service.cmr.security.AccessStatus;
|
import org.alfresco.service.cmr.security.AccessStatus;
|
||||||
import org.alfresco.service.cmr.security.OwnableService;
|
import org.alfresco.service.cmr.security.OwnableService;
|
||||||
@@ -170,6 +171,9 @@ public class RecordServiceImpl implements RecordService,
|
|||||||
/** Capability service */
|
/** Capability service */
|
||||||
private CapabilityService capabilityService;
|
private CapabilityService capabilityService;
|
||||||
|
|
||||||
|
/** Rule service */
|
||||||
|
private RuleService ruleService;
|
||||||
|
|
||||||
/** List of available record meta-data aspects */
|
/** List of available record meta-data aspects */
|
||||||
private Set<QName> recordMetaDataAspects;
|
private Set<QName> recordMetaDataAspects;
|
||||||
|
|
||||||
@@ -285,6 +289,14 @@ public class RecordServiceImpl implements RecordService,
|
|||||||
this.capabilityService = capabilityService;
|
this.capabilityService = capabilityService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ruleService rule service
|
||||||
|
*/
|
||||||
|
public void setRuleService(RuleService ruleService)
|
||||||
|
{
|
||||||
|
this.ruleService = ruleService;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Init method
|
* Init method
|
||||||
*/
|
*/
|
||||||
@@ -662,6 +674,9 @@ public class RecordServiceImpl implements RecordService,
|
|||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public Void doWork() throws Exception
|
public Void doWork() throws Exception
|
||||||
|
{
|
||||||
|
ruleService.disableRules();
|
||||||
|
try
|
||||||
{
|
{
|
||||||
// take note of the record id
|
// take note of the record id
|
||||||
String recordId = (String)nodeService.getProperty(nodeRef, PROP_IDENTIFIER);
|
String recordId = (String)nodeService.getProperty(nodeRef, PROP_IDENTIFIER);
|
||||||
@@ -714,6 +729,11 @@ public class RecordServiceImpl implements RecordService,
|
|||||||
|
|
||||||
// send an email to the record creator
|
// send an email to the record creator
|
||||||
notificationHelper.recordRejectedEmailNotification(nodeRef, recordId, documentOwner);
|
notificationHelper.recordRejectedEmailNotification(nodeRef, recordId, documentOwner);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
ruleService.enableRules();
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user