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:
@@ -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 -->
|
||||||
|
@@ -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;
|
||||||
|
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -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,20 +64,14 @@ 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
|
|
||||||
ParameterDefinition def = ruleItemDefinition.getParameterDefintion(parameterName);
|
// only sub string property values
|
||||||
if (def != null)
|
if (parameterValue != null && parameterValue instanceof String)
|
||||||
{
|
{
|
||||||
if (DataTypeDefinition.TEXT.equals(def.getType()) == true)
|
// set the updated parameter value
|
||||||
{
|
ruleItem.setParameterValue(parameterName, process((String)parameterValue, actionedUponNodeRef));
|
||||||
// get the parameter value
|
}
|
||||||
String parameterValue = (String)entry.getValue();
|
|
||||||
|
|
||||||
// set the updated parameter value
|
|
||||||
ruleItem.setParameterValue(parameterName, process(parameterValue, actionedUponNodeRef));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user