use of org.alfresco.module.org_alfresco_module_rm.event.EventCompletionDetails in project records-management by Alfresco.
the class DispositionActionImpl method getEventCompletionDetails.
/**
* @see org.alfresco.module.org_alfresco_module_rm.disposition.DispositionAction#getEventCompletionDetails()
*/
public List<EventCompletionDetails> getEventCompletionDetails() {
List<ChildAssociationRef> assocs = services.getNodeService().getChildAssocs(this.dispositionNodeRef, ASSOC_EVENT_EXECUTIONS, RegexQNamePattern.MATCH_ALL);
List<EventCompletionDetails> result = new ArrayList<EventCompletionDetails>(assocs.size());
for (ChildAssociationRef assoc : assocs) {
result.add(getEventCompletionDetailsFromNodeRef(assoc.getChildRef()));
}
return result;
}
use of org.alfresco.module.org_alfresco_module_rm.event.EventCompletionDetails in project records-management by Alfresco.
the class DispositionActionImpl method getEventCompletionDetails.
/**
* Gets the event completion details for the named event.
* <p>
* Returns null if event can not be found.
*
* @param eventName name of the event
* @return {@link EventCompletionDetails} event completion details for named event, null otherwise
*
* @since 2.2
*/
@Override
public EventCompletionDetails getEventCompletionDetails(String eventName) {
EventCompletionDetails result = null;
List<ChildAssociationRef> assocs = services.getNodeService().getChildAssocsByPropertyValue(dispositionNodeRef, PROP_EVENT_EXECUTION_NAME, eventName);
if (!assocs.isEmpty()) {
if (assocs.size() != 1) {
throw new AlfrescoRuntimeException("Unable to get event completion details, because more than one child was found for event " + eventName);
}
result = getEventCompletionDetailsFromNodeRef(assocs.get(0).getChildRef());
}
return result;
}
use of org.alfresco.module.org_alfresco_module_rm.event.EventCompletionDetails in project records-management by Alfresco.
the class RecordsManagementSearchBehaviour method setupDispositionActionEvents.
/**
* Helper method to setup disposition action events.
*
* @param nodeRef node reference
* @param da disposition action
*/
private void setupDispositionActionEvents(NodeRef nodeRef, DispositionAction da) {
if (!methodCached("setupDispositionActionEvents", nodeRef)) {
if (da != null) {
List<String> eventNames = null;
List<EventCompletionDetails> eventsList = da.getEventCompletionDetails();
if (eventsList.size() > 0) {
eventNames = new ArrayList<String>(eventsList.size());
for (EventCompletionDetails event : eventsList) {
eventNames.add(event.getEventName());
}
}
// set the property
nodeService.setProperty(nodeRef, PROP_RS_DISPOSITION_EVENTS, (Serializable) eventNames);
if (logger.isDebugEnabled()) {
logger.debug("Set rma:recordSearchDispositionEvents for node " + nodeRef + " to: " + eventNames);
}
}
}
}
Aggregations