diff --git a/source/java/org/alfresco/repo/forms/processor/action/ActionFormProcessor.java b/source/java/org/alfresco/repo/forms/processor/action/ActionFormProcessor.java index 2a2da6428f..33d11e0558 100644 --- a/source/java/org/alfresco/repo/forms/processor/action/ActionFormProcessor.java +++ b/source/java/org/alfresco/repo/forms/processor/action/ActionFormProcessor.java @@ -26,6 +26,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.alfresco.repo.action.executer.ActionExecuter; import org.alfresco.repo.forms.Field; import org.alfresco.repo.forms.FormData; import org.alfresco.repo.forms.FormException; @@ -56,7 +57,7 @@ import org.springframework.beans.factory.NoSuchBeanDefinitionException; * @author Neil Mc Erlean * @since 4.0 */ -public class ActionFormProcessor extends FilteredFormProcessor +public class ActionFormProcessor extends FilteredFormProcessor { public static final String ITEM_KIND = "action"; @@ -140,7 +141,7 @@ public class ActionFormProcessor extends FilteredFormProcessor. + */ +package org.alfresco.repo.forms.processor.action; + +import org.alfresco.service.cmr.action.Action; +import org.alfresco.util.ParameterCheck; + +/** + * Class used purely to represent the result of an action being + * executed via the {@link ActionFormProcessor}. + * + * This class holds the {@link Action} executed and any optional + * results stored by the action. + * + * @author Gavin Cornwell + */ +public class ActionFormResult +{ + private Action action; + private Object result; + + /** + * Default constructor. + * + * @param action The action that was executed, can not be null + * @param result The result from the action, can be null + */ + public ActionFormResult(Action action, Object result) + { + ParameterCheck.mandatory("action", action); + + this.action = action; + this.result = result; + } + + /** + * Returns the action that was executed + * + * @return The executed Action + */ + public Action getAction() + { + return this.action; + } + + /** + * Returns the result from the executed action + * + * @return The result or null if there were no results + */ + public Object getResult() + { + return this.result; + } + + @Override + public String toString() + { + StringBuilder builder = new StringBuilder(this.action.toString()); + builder.append(" result=").append(this.result); + return builder.toString(); + } +}