Class UserAction<R>
- java.lang.Object
-
- com.mendix.core.actionmanagement.internal.InternalCoreAction<R>
-
- com.mendix.core.actionmanagement.CoreAction<R>
-
- com.mendix.systemwideinterfaces.core.UserAction<R>
-
- All Implemented Interfaces:
ICoreAction<R>
,java.util.concurrent.Callable<R>
- Direct Known Subclasses:
CustomJavaAction
,LoginAction
public abstract class UserAction<R> extends CoreAction<R>
Abstract class for user actions.
Usage:
- extend this class (define R!)
- implement the method executeAction()
Example:
public class ExampleAction extends UserAction {
private String param;
public ExampleAction(String param) {
super();
this.param = param;
}
public String executeAction() throws Exception {
return "Hello world! ("+this.param+")";
}
public String toString() {
return "ExampleAction:: param="+this.param;
}
}
-
-
Constructor Summary
Constructors Constructor Description UserAction(IContext context)
Creates a user action.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description IContext
context()
Returns the context in which this action executes.R
execute()
This, already implemented, method callsexecuteAction
on execution of this Action.abstract R
executeAction()
Implement this method, this method will be called when this action is executed.-
Methods inherited from class com.mendix.core.actionmanagement.CoreAction
getUnwrappedAction
-
Methods inherited from class com.mendix.core.actionmanagement.internal.InternalCoreAction
addDatavalidationFeedback, addDataValidationFeedback, call, clone, getActionName, getClonedContext, getContext, getEventObjects, getException, getMetaInfo, getState, handleConcurrentExecution, setActionName, setAllowsConcurrentExecution, setContext, setEventObjects, setException, setMetaInfo, setState
-
-
-
-
Constructor Detail
-
UserAction
public UserAction(IContext context)
Creates a user action.- Parameters:
context
- the context in which the action executes
-
-
Method Detail
-
context
public IContext context()
Returns the context in which this action executes.- Returns:
- the execution context
-
execute
public R execute() throws java.lang.Exception
This, already implemented, method callsexecuteAction
on execution of this Action.- Specified by:
execute
in classInternalCoreAction<R>
- Returns:
- returns the result of the execution
- Throws:
java.lang.Exception
- when executing the action failed
-
executeAction
public abstract R executeAction() throws java.lang.Exception
Implement this method, this method will be called when this action is executed.- Returns:
- returns the result of the execution
- Throws:
java.lang.Exception
-
-