From 5717a6d36e1cb21687ff95a2e593f05773b08705 Mon Sep 17 00:00:00 2001 From: jcule Date: Thu, 17 May 2018 22:46:53 +0100 Subject: [PATCH 1/7] RM-6310: sc:securityMarksSearch is not properly updated when editing the content classification (affects the results from RM search results): automation test --- .../rest/rm/community/base/BaseRMRestTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java index 5de8128200..38a424db96 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java @@ -591,6 +591,17 @@ public class BaseRMRestTest extends RestTest RecordFolderAPI recordFolderAPI = restAPIFactory.getRecordFolderAPI(); recordFolderAPI.deleteRecordFolder(recordFolderId); } + + /** + * Delete a record + * + * @param recordId the id of the record to delete + */ + public void deleteRecord(String recordId) + { + RecordsAPI recordsAPI = restAPIFactory.getRecordsAPI(); + recordsAPI.deleteRecord(recordId); + } /** * Delete a record category From 986c1b8fea121b609bc19879759f2194e5a70e06 Mon Sep 17 00:00:00 2001 From: jcule Date: Fri, 25 May 2018 21:46:19 +0100 Subject: [PATCH 2/7] RM-6310: sc:securityMarksSearch is not properly updated when editing the content classification (affects the results from RM search results): automation test --- .../org/alfresco/rest/core/v0/BaseAPI.java | 31 ++++++++++ .../java/org/alfresco/rest/v0/SearchAPI.java | 60 +++++++++++++------ .../rm/community/base/BaseRMRestTest.java | 60 +++++++++++++++++-- 3 files changed, 127 insertions(+), 24 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java index 935dcc151c..82813b7556 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java @@ -121,6 +121,37 @@ public abstract class BaseAPI return results; } + /** + * Helper method to extract the property value for the given nodeRef and property name + * + * @param result + * @param nodeRef + * @param propertyName + * @return + */ + protected String getPropertyValue(JSONObject result, String nodeRef, String propertyName) + { + String propertValue = ""; + try + { + JSONArray items = result.getJSONArray("items"); + for (int i = 0; i < items.length(); i++) + { + JSONObject item = items.getJSONObject(i); + if(nodeRef.equals(item.getString("nodeRef"))) + { + propertValue = item.getJSONObject("properties").getString(propertyName); + } + } + } + catch (JSONException error) + { + throw new RuntimeException("Unable to parse result", error); + } + + return propertValue; + } + /** * Helper method to extract property values from request result and put them in map as a list that corresponds to a unique property value. * diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/SearchAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/SearchAPI.java index 809397ef6c..5fa460cf41 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/SearchAPI.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/SearchAPI.java @@ -123,42 +123,41 @@ public class SearchAPI extends BaseAPI * Search as a user for nodes on site "rm" matching query, using SearchAPI.RM_DEFAULT_RECORD_FILTERS and sorted * by sortby *
- * If more fine-grained control of search parameters is required, use rmSearch() directly. + * * @param username * @param password * @param query * @param sortby - * @return list of record names + * @return list of node names */ - public List searchForRecordsAsUser( - String username, String password, - String query, String sortby, - boolean includeCategories, boolean includeFolders) + public List searchForNodeNamesAsUser(String username, String password, String query, String sortby, + boolean includeCategories, boolean includeFolders) { - String searchFilterParamaters = MessageFormat.format(RM_DEFAULT_NODES_FILTERS, Boolean.toString(includeFolders), Boolean.toString(includeCategories)); + String searchFilterParamaters = MessageFormat.format(RM_DEFAULT_NODES_FILTERS, Boolean.toString(includeFolders), + Boolean.toString(includeCategories)); return getItemNames(rmSearch(username, password, "rm", query, searchFilterParamaters, sortby)); } /** - * Search as a user for content on site "rm" matching query, using SearchAPI.RM_DEFAULT_NODES_FILTERS and sorted - * by sortby - *
- * If more fine-grained control of search parameters is required, use rmSearch() directly. + * Search as a user for nodes on site "rm" matching query, using SearchAPI.RM_DEFAULT_RECORD_FILTERS and sorted + * by sortby and returns the property value for the given nodeRef and property name + * * @param username * @param password * @param query * @param sortby - * @return list of record names + * @param includeCategories + * @param includeFolders + * @return list of node properties */ - public List searchForRmContentAsUser( - String username, - String password, - String query, - String sortby) + public String searchForNodePropertyAsUser(String username, String password, String nodeRef, String propertyName, String query, String sortby, + boolean includeCategories, boolean includeFolders) { - return getItemNames(rmSearch(username, password, "rm", query, RM_DEFAULT_NODES_FILTERS, sortby)); + String searchFilterParamaters = MessageFormat.format(RM_DEFAULT_NODES_FILTERS, Boolean.toString(includeFolders), + Boolean.toString(includeCategories)); + return getItemProperty(rmSearch(username, password, "rm", query, searchFilterParamaters, sortby), nodeRef, propertyName); } - + /** * Generic faceted search. * @param username @@ -228,12 +227,35 @@ public class SearchAPI extends BaseAPI /** * Helper method to extract list of names from search result. + * * @param searchResult * @return list of document or record names in search result + * @throws FileNotFoundException + * @throws JsonSyntaxException + * @throws JsonIOException * @throws RuntimeException for malformed search response */ + /** + * Helper method to extract list of names from search result. + * + * @param searchResult + * @param getProperties + * @return + */ private List getItemNames(JSONObject searchResult) { return getPropertyValues(searchResult, "name"); } + + /** + * Helper method to extract list of property values from search result for the given nodeRef. + * + * @param searchResult + * @param getProperties + * @return + */ + private String getItemProperty(JSONObject searchResult, String nodeRef, String propertyName) + { + return getPropertyValue(searchResult, nodeRef, propertyName); + } } diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java index 88600a2d45..bbf001ae3e 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java @@ -681,13 +681,15 @@ public class BaseRMRestTest extends RestTest } /** - * Returns records search results for the given search term - * + * Returns the list of node names returned by search results for the given search term + * * @param user * @param term * @param sortby + * @param includeFolders + * @param includeCategories * @param expectedResults - * @return + * @return List */ public List searchForRMContentAsUser(UserModel user, String term, String sortby, boolean includeFolders, boolean includeCategories, List expectedResults) @@ -708,8 +710,8 @@ public class BaseRMRestTest extends RestTest { } } - results = searchApi.searchForRecordsAsUser(user.getUsername(), user.getPassword(), term, sortby, - includeFolders, includeCategories); + results = searchApi.searchForNodeNamesAsUser(user.getUsername(), user.getPassword(), term, sortby, + includeFolders, includeCategories); if (!results.isEmpty() && results.containsAll(expectedResults)) { break; @@ -724,6 +726,54 @@ public class BaseRMRestTest extends RestTest return results; } + /** + * Returns the property value for the given property name and nodeRef of the search results + * + * @param user + * @param term + * @param nodeRef + * @param propertyName + * @param sortby + * @param includeFolders + * @param includeCategories + * @param expectedResults + * @return String + */ + public String searchForRMContentAsUser(UserModel user, String term, String nodeRef, String propertyName, + String sortby, boolean includeFolders, boolean includeCategories, String expectedResults) + { + String result = ""; + // wait for solr indexing + int counter = 0; + int waitInMilliSeconds = 6000; + while (counter < 3) + { + synchronized (this) + { + try + { + this.wait(waitInMilliSeconds); + } + catch (InterruptedException e) + { + } + } + result = searchApi.searchForNodePropertyAsUser(user.getUsername(), user.getPassword(), nodeRef, + propertyName, term, sortby, includeFolders, includeCategories); + if (!result.isEmpty() && result.contains(expectedResults)) + { + break; + } + else + { + counter++; + } + // double wait time to not overdo solr search + waitInMilliSeconds = (waitInMilliSeconds * 2); + } + return result; + } + /** * Helper method to return site document library content model * From 4f3aef35bf892d993571c1d1715db5c7ee8a4a50 Mon Sep 17 00:00:00 2001 From: Roxana Lucanu-Ghetu Date: Mon, 28 May 2018 22:48:57 +0300 Subject: [PATCH 3/7] RM-6337 Fix visibility conditions for accession step. --- .../disposition/DispositionServiceImpl.java | 25 +++++++++++++++---- .../jscript/app/JSONConversionComponent.java | 3 ++- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/disposition/DispositionServiceImpl.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/disposition/DispositionServiceImpl.java index 0da309a7c8..52fd93cf04 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/disposition/DispositionServiceImpl.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/disposition/DispositionServiceImpl.java @@ -814,28 +814,43 @@ public class DispositionServiceImpl extends ServiceBaseImpl // Get the disposition instructions DispositionSchedule di = getDispositionSchedule(nodeRef); - NodeRef nextDa = getNextDispositionActionNodeRef(nodeRef); + NodeRef accessionNodeRef = di.getDispositionActionDefinitionByName("accession").getNodeRef(); + DispositionAction nextDa = getNextDispositionAction(nodeRef); if (di != null && this.nodeService.hasAspect(nodeRef, ASPECT_DISPOSITION_LIFECYCLE) && nextDa != null) { + Boolean combineSteps = null; + if (nextDa.getName().equals("accession")) + { + combineSteps = (Boolean)nodeService.getProperty(accessionNodeRef, PROP_COMBINE_DISPOSITION_STEP_CONDITIONS); + } + // If it has an asOf date and it is greater than now the action is eligible - Date asOf = (Date)this.nodeService.getProperty(nextDa, PROP_DISPOSITION_AS_OF); + Date asOf = (Date)this.nodeService.getProperty(nextDa.getNodeRef(), PROP_DISPOSITION_AS_OF); if (asOf != null && asOf.before(new Date())) { result = true; + if (combineSteps == null || !combineSteps) + { + return true; + } + } + else if(combineSteps != null && combineSteps) + { + return false; } - if (!result) + if (!result || (result && combineSteps)) { - DispositionAction da = new DispositionActionImpl(serviceRegistry, nextDa); + DispositionAction da = new DispositionActionImpl(serviceRegistry, nextDa.getNodeRef()); DispositionActionDefinition dad = da.getDispositionActionDefinition(); if (dad != null) { boolean firstComplete = dad.eligibleOnFirstCompleteEvent(); - List assocs = this.nodeService.getChildAssocs(nextDa, ASSOC_EVENT_EXECUTIONS, RegexQNamePattern.MATCH_ALL); + List assocs = this.nodeService.getChildAssocs(nextDa.getNodeRef(), ASSOC_EVENT_EXECUTIONS, RegexQNamePattern.MATCH_ALL); for (ChildAssociationRef assoc : assocs) { NodeRef eventExecution = assoc.getChildRef(); diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/jscript/app/JSONConversionComponent.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/jscript/app/JSONConversionComponent.java index da2a7234a3..4a9c6c633a 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/jscript/app/JSONConversionComponent.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/jscript/app/JSONConversionComponent.java @@ -29,7 +29,7 @@ package org.alfresco.module.org_alfresco_module_rm.jscript.app; import static org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel.READ_RECORDS; import static org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel.PROP_COMBINE_DISPOSITION_STEP_CONDITIONS; -import static org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel.PROP_RS_DISPOSITION_EVENTS; +import static org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel.PROP_DISPOSITION_EVENT_COMBINATION; import static org.alfresco.service.cmr.security.AccessStatus.ALLOWED; import java.util.ArrayList; @@ -485,6 +485,7 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JS HashMap properties = ((HashMap) rmNodeValues.get("properties")); properties.put("combineDispositionStepConditions", nodeService.getProperty(dispositionService.getNextDispositionAction(nodeRef).getDispositionActionDefinition().getNodeRef(), PROP_COMBINE_DISPOSITION_STEP_CONDITIONS)); properties.put("incompleteDispositionEvent", details.getEventName()); + properties.put("dispositionEventCombination", nodeService.getProperty(dispositionService.getNextDispositionAction(nodeRef).getDispositionActionDefinition().getNodeRef(), PROP_DISPOSITION_EVENT_COMBINATION)); break; } } From 125614fe180593d52e3071f51890cceabc82474d Mon Sep 17 00:00:00 2001 From: Roxana Lucanu-Ghetu Date: Mon, 28 May 2018 23:53:59 +0300 Subject: [PATCH 4/7] RM-6337 Fix failing tests --- .../disposition/DispositionServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/disposition/DispositionServiceImpl.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/disposition/DispositionServiceImpl.java index 52fd93cf04..86a67b2fb8 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/disposition/DispositionServiceImpl.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/disposition/DispositionServiceImpl.java @@ -814,7 +814,6 @@ public class DispositionServiceImpl extends ServiceBaseImpl // Get the disposition instructions DispositionSchedule di = getDispositionSchedule(nodeRef); - NodeRef accessionNodeRef = di.getDispositionActionDefinitionByName("accession").getNodeRef(); DispositionAction nextDa = getNextDispositionAction(nodeRef); if (di != null && this.nodeService.hasAspect(nodeRef, ASPECT_DISPOSITION_LIFECYCLE) && @@ -823,6 +822,7 @@ public class DispositionServiceImpl extends ServiceBaseImpl Boolean combineSteps = null; if (nextDa.getName().equals("accession")) { + NodeRef accessionNodeRef = di.getDispositionActionDefinitionByName("accession").getNodeRef(); combineSteps = (Boolean)nodeService.getProperty(accessionNodeRef, PROP_COMBINE_DISPOSITION_STEP_CONDITIONS); } From 758ae020bd557c0cb0d3992ccbd03639d7148d07 Mon Sep 17 00:00:00 2001 From: Roxana Lucanu-Ghetu Date: Tue, 29 May 2018 15:21:59 +0300 Subject: [PATCH 5/7] RM-6337 Code review changes --- .../disposition/DispositionServiceImpl.java | 86 +++++++++---------- 1 file changed, 42 insertions(+), 44 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/disposition/DispositionServiceImpl.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/disposition/DispositionServiceImpl.java index 86a67b2fb8..c9d33dd7f9 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/disposition/DispositionServiceImpl.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/disposition/DispositionServiceImpl.java @@ -811,7 +811,6 @@ public class DispositionServiceImpl extends ServiceBaseImpl public boolean isNextDispositionActionEligible(NodeRef nodeRef) { boolean result = false; - // Get the disposition instructions DispositionSchedule di = getDispositionSchedule(nodeRef); DispositionAction nextDa = getNextDispositionAction(nodeRef); @@ -819,70 +818,69 @@ public class DispositionServiceImpl extends ServiceBaseImpl this.nodeService.hasAspect(nodeRef, ASPECT_DISPOSITION_LIFECYCLE) && nextDa != null) { - Boolean combineSteps = null; + // for accession step we can have also AND between step conditions + Boolean combineSteps = false; if (nextDa.getName().equals("accession")) { NodeRef accessionNodeRef = di.getDispositionActionDefinitionByName("accession").getNodeRef(); - combineSteps = (Boolean)nodeService.getProperty(accessionNodeRef, PROP_COMBINE_DISPOSITION_STEP_CONDITIONS); - } - - // If it has an asOf date and it is greater than now the action is eligible - Date asOf = (Date)this.nodeService.getProperty(nextDa.getNodeRef(), PROP_DISPOSITION_AS_OF); - if (asOf != null && - asOf.before(new Date())) - { - result = true; - if (combineSteps == null || !combineSteps) - { - return true; + if (accessionNodeRef != null) { + if (this.nodeService.getProperty(accessionNodeRef, PROP_COMBINE_DISPOSITION_STEP_CONDITIONS) != null) + { + combineSteps = (Boolean)this.nodeService.getProperty(accessionNodeRef, PROP_COMBINE_DISPOSITION_STEP_CONDITIONS); + } } } - else if(combineSteps != null && combineSteps) + Date asOf = (Date)this.nodeService.getProperty(nextDa.getNodeRef(), PROP_DISPOSITION_AS_OF); + Boolean asOfDateInPast = false; + if (asOf != null) + { + asOfDateInPast = ((Date) this.nodeService.getProperty(nextDa.getNodeRef(), PROP_DISPOSITION_AS_OF)).before(new Date()); + } + if (asOfDateInPast && !combineSteps) + { + return true; + } + else if(!asOfDateInPast && combineSteps) { return false; } - - if (!result || (result && combineSteps)) + DispositionAction da = new DispositionActionImpl(serviceRegistry, nextDa.getNodeRef()); + DispositionActionDefinition dad = da.getDispositionActionDefinition(); + if (dad != null) { - DispositionAction da = new DispositionActionImpl(serviceRegistry, nextDa.getNodeRef()); - DispositionActionDefinition dad = da.getDispositionActionDefinition(); - if (dad != null) + boolean firstComplete = dad.eligibleOnFirstCompleteEvent(); + + List assocs = this.nodeService.getChildAssocs(nextDa.getNodeRef(), ASSOC_EVENT_EXECUTIONS, RegexQNamePattern.MATCH_ALL); + for (ChildAssociationRef assoc : assocs) { - boolean firstComplete = dad.eligibleOnFirstCompleteEvent(); - - List assocs = this.nodeService.getChildAssocs(nextDa.getNodeRef(), ASSOC_EVENT_EXECUTIONS, RegexQNamePattern.MATCH_ALL); - for (ChildAssociationRef assoc : assocs) + NodeRef eventExecution = assoc.getChildRef(); + Boolean isCompleteValue = (Boolean)this.nodeService.getProperty(eventExecution, PROP_EVENT_EXECUTION_COMPLETE); + boolean isComplete = false; + if (isCompleteValue != null) { - NodeRef eventExecution = assoc.getChildRef(); - Boolean isCompleteValue = (Boolean)this.nodeService.getProperty(eventExecution, PROP_EVENT_EXECUTION_COMPLETE); - boolean isComplete = false; - if (isCompleteValue != null) - { - isComplete = isCompleteValue.booleanValue(); + isComplete = isCompleteValue.booleanValue(); - // implement AND and OR combination of event completions - if (isComplete) + // implement AND and OR combination of event completions + if (isComplete) + { + result = true; + if (firstComplete) { - result = true; - if (firstComplete) - { - break; - } + break; } - else + } + else + { + result = false; + if (!firstComplete) { - result = false; - if (!firstComplete) - { - break; - } + break; } } } } } } - return result; } From 6d7dce144e4c76244df2459bdf41a26a8f25a20f Mon Sep 17 00:00:00 2001 From: jcule Date: Tue, 29 May 2018 14:48:39 +0100 Subject: [PATCH 6/7] RM-6310: sc:securityMarksSearch is not properly updated when editing the content classification (affects the results from RM search results): fixed typo --- .../src/main/java/org/alfresco/rest/core/v0/BaseAPI.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java index 82813b7556..6ab96e8c14 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/BaseAPI.java @@ -131,7 +131,7 @@ public abstract class BaseAPI */ protected String getPropertyValue(JSONObject result, String nodeRef, String propertyName) { - String propertValue = ""; + String propertyValue = ""; try { JSONArray items = result.getJSONArray("items"); @@ -140,7 +140,7 @@ public abstract class BaseAPI JSONObject item = items.getJSONObject(i); if(nodeRef.equals(item.getString("nodeRef"))) { - propertValue = item.getJSONObject("properties").getString(propertyName); + propertyValue = item.getJSONObject("properties").getString(propertyName); } } } @@ -149,7 +149,7 @@ public abstract class BaseAPI throw new RuntimeException("Unable to parse result", error); } - return propertValue; + return propertyValue; } /** From 1ece45f8344b79ca2da3f9eadd321024f711b664 Mon Sep 17 00:00:00 2001 From: Roxana Lucanu-Ghetu Date: Wed, 30 May 2018 09:38:25 +0300 Subject: [PATCH 7/7] RM-6337 Code review changes --- .../disposition/DispositionServiceImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/disposition/DispositionServiceImpl.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/disposition/DispositionServiceImpl.java index c9d33dd7f9..abe1efba5f 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/disposition/DispositionServiceImpl.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/disposition/DispositionServiceImpl.java @@ -824,9 +824,10 @@ public class DispositionServiceImpl extends ServiceBaseImpl { NodeRef accessionNodeRef = di.getDispositionActionDefinitionByName("accession").getNodeRef(); if (accessionNodeRef != null) { - if (this.nodeService.getProperty(accessionNodeRef, PROP_COMBINE_DISPOSITION_STEP_CONDITIONS) != null) + Boolean combineStepsProp = (Boolean)this.nodeService.getProperty(accessionNodeRef, PROP_COMBINE_DISPOSITION_STEP_CONDITIONS); + if (combineStepsProp != null) { - combineSteps = (Boolean)this.nodeService.getProperty(accessionNodeRef, PROP_COMBINE_DISPOSITION_STEP_CONDITIONS); + combineSteps = combineStepsProp; } } } @@ -834,7 +835,7 @@ public class DispositionServiceImpl extends ServiceBaseImpl Boolean asOfDateInPast = false; if (asOf != null) { - asOfDateInPast = ((Date) this.nodeService.getProperty(nextDa.getNodeRef(), PROP_DISPOSITION_AS_OF)).before(new Date()); + asOfDateInPast = asOf.before(new Date()); } if (asOfDateInPast && !combineSteps) {