mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
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:
@@ -33,7 +33,7 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
public abstract class PropertySubActionExecuterAbstractBase extends AuditableActionExecuterAbstractBase
|
||||
{
|
||||
/** Parameter processor component */
|
||||
private ParameterProcessorComponent parameterProcessorComponent;
|
||||
protected ParameterProcessorComponent parameterProcessorComponent;
|
||||
|
||||
/** Indicates whether parameter substitutions are allowed */
|
||||
protected boolean allowParameterSubstitutions = false;
|
||||
|
@@ -67,6 +67,12 @@ public class DelegateAction extends RMActionExecuterAbstractBase
|
||||
if (nodeService.exists(actionedUponNodeRef) == true &&
|
||||
(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);
|
||||
}
|
||||
}
|
||||
|
@@ -25,10 +25,8 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
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.ParameterizedItemDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
|
||||
/**
|
||||
@@ -66,20 +64,14 @@ public class ParameterProcessorComponent
|
||||
for (Map.Entry<String, Serializable> entry : ruleItem.getParameterValues().entrySet())
|
||||
{
|
||||
String parameterName = entry.getKey();
|
||||
|
||||
// get the parameter definition
|
||||
ParameterDefinition def = ruleItemDefinition.getParameterDefintion(parameterName);
|
||||
if (def != null)
|
||||
Object parameterValue = entry.getValue();
|
||||
|
||||
// only sub string property values
|
||||
if (parameterValue != null && parameterValue instanceof String)
|
||||
{
|
||||
if (DataTypeDefinition.TEXT.equals(def.getType()) == true)
|
||||
{
|
||||
// get the parameter value
|
||||
String parameterValue = (String)entry.getValue();
|
||||
|
||||
// set the updated parameter value
|
||||
ruleItem.setParameterValue(parameterName, process(parameterValue, actionedUponNodeRef));
|
||||
}
|
||||
}
|
||||
// set the updated parameter value
|
||||
ruleItem.setParameterValue(parameterName, process((String)parameterValue, actionedUponNodeRef));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user