We are using ACS Starter 7.3
I have created a custom action with a boolean parameter.
public class testAction extends ActionExecuterAbstractBase {
private static Log logger = LogFactory.getLog(testAction.class);
public static final String NAME = "test-action";
public static final String PARAM_TEST_BOOL = "test-param";
@override
protected void executeImpl(Action action, NodeRef actionedUponNodeRef) {
try {
Boolean test = (Boolean) action.getParameterValue(PARAM_TEST_BOOL);
logger.debug("TEST:" + test);
} catch (Exception e) {
logger.error("Error test'" + actionedUponNodeRef + "':", e);
}
}
@override
protected void addParameterDefinitions(List<ParameterDefinition> paramList) {
paramList.add(new ParameterDefinitionImpl(PARAM_TEST_BOOL, DataTypeDefinition.BOOLEAN, true, getParamDisplayLabel(PARAM_TEST_BOOL)));
}
}
The action is being used from a rule in Alfresco Share....so, when the user is editing the rule,
the form shows a check box (Up to here all good) Now,
if the user doesn't check the box, the next time the rule is edited, all remains good. if the user checks the box and saves the rule, the next time the rule is edited, the form is displayed wrong an after saving the rule an error is thrown. Caused by: org.springframework.extensions.webscripts.WebScriptException: 02100000 Failed to process template org/alfresco/folder-rules.ftl content-model-share_1 | at org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process(FTLTemplateProcessor.java:196) content-model-share_1 | at org.springframework.extensions.webscripts.WebTemplateProcessor.executeBody(WebTemplateProcessor.java:439) content-model-share_1 | ... 61 more content-model-share_1 | Caused by: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing: content-model-share_1 | ==> ruleset [in template "org/alfresco/folder-rules.ftl" at line 18, column 12] content-model-share_1 | content-model-share_1 | ---- content-model-share_1 | Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? content-model-share_1 | ---- content-model-share_1 | content-model-share_1 | ---- FTL stack trace ("~" means nesting-related): content-model-share_1 | - Failed at: #if ruleset.linkedToRuleSet?? [in template "org/alfresco/folder-rules.ftl" at line 18, column 7] content-model-share_1 | - Reached through: @markup id="bd" [in template "org/alfresco/folder-rules.ftl" at line 12, column 4] content-model-share_1 | ~ Reached through: #nested [in template "org/alfresco/include/alfresco-template.ftl" in macro "templateBody" at line 87, column 1] content-model-share_1 | ~ Reached through: @templateBody [in template "org/alfresco/folder-rules.ftl" at line 6, column 1]
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.