RM-1053: Error cause when Rule "Set property value" try change not enable for editing property

* property value subsitution now available on setProperty action (in RM)
 * this means properties can be set based on other property values or date context
 * provides a (simple atm) means of defining a id generation scheme scoped by file plan context



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@56374 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2013-10-08 05:52:50 +00:00
parent 48bcd03bd9
commit 54ce637b20
4 changed files with 15 additions and 16 deletions

View File

@@ -940,6 +940,7 @@
<property name="delegateAction" ref="set-property-value" /> <property name="delegateAction" ref="set-property-value" />
<property name="adhocPropertiesAllowed" value="true" /> <property name="adhocPropertiesAllowed" value="true" />
<property name="checkFrozen" value="true" /> <property name="checkFrozen" value="true" />
<property name="allowParameterSubstitutions" value="true" />
</bean> </bean>
<!-- add record types --> <!-- add record types -->

View File

@@ -33,7 +33,7 @@ import org.alfresco.service.cmr.repository.NodeRef;
public abstract class PropertySubActionExecuterAbstractBase extends AuditableActionExecuterAbstractBase public abstract class PropertySubActionExecuterAbstractBase extends AuditableActionExecuterAbstractBase
{ {
/** Parameter processor component */ /** Parameter processor component */
private ParameterProcessorComponent parameterProcessorComponent; protected ParameterProcessorComponent parameterProcessorComponent;
/** Indicates whether parameter substitutions are allowed */ /** Indicates whether parameter substitutions are allowed */
protected boolean allowParameterSubstitutions = false; protected boolean allowParameterSubstitutions = false;

View File

@@ -67,6 +67,12 @@ public class DelegateAction extends RMActionExecuterAbstractBase
if (nodeService.exists(actionedUponNodeRef) == true && if (nodeService.exists(actionedUponNodeRef) == true &&
(checkFrozen == false || freezeService.isFrozen(actionedUponNodeRef) == false)) (checkFrozen == false || freezeService.isFrozen(actionedUponNodeRef) == false))
{ {
// do the property subs (if any exist)
if (allowParameterSubstitutions == true)
{
parameterProcessorComponent.process(action, delegateActionExecuter.getActionDefinition(), actionedUponNodeRef);
}
delegateActionExecuter.execute(action, actionedUponNodeRef); delegateActionExecuter.execute(action, actionedUponNodeRef);
} }
} }

View File

@@ -25,10 +25,8 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.alfresco.error.AlfrescoRuntimeException; import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.service.cmr.action.ParameterDefinition;
import org.alfresco.service.cmr.action.ParameterizedItem; import org.alfresco.service.cmr.action.ParameterizedItem;
import org.alfresco.service.cmr.action.ParameterizedItemDefinition; import org.alfresco.service.cmr.action.ParameterizedItemDefinition;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeRef;
/** /**
@@ -66,19 +64,13 @@ public class ParameterProcessorComponent
for (Map.Entry<String, Serializable> entry : ruleItem.getParameterValues().entrySet()) for (Map.Entry<String, Serializable> entry : ruleItem.getParameterValues().entrySet())
{ {
String parameterName = entry.getKey(); String parameterName = entry.getKey();
Object parameterValue = entry.getValue();
// get the parameter definition // only sub string property values
ParameterDefinition def = ruleItemDefinition.getParameterDefintion(parameterName); if (parameterValue != null && parameterValue instanceof String)
if (def != null)
{ {
if (DataTypeDefinition.TEXT.equals(def.getType()) == true)
{
// get the parameter value
String parameterValue = (String)entry.getValue();
// set the updated parameter value // set the updated parameter value
ruleItem.setParameterValue(parameterName, process(parameterValue, actionedUponNodeRef)); ruleItem.setParameterValue(parameterName, process((String)parameterValue, actionedUponNodeRef));
}
} }
} }
} }