Class InternalCoreAction<R>
- java.lang.Object
-
- com.mendix.core.actionmanagement.internal.InternalCoreAction<R>
-
- Type Parameters:
R- the result type of the action
- All Implemented Interfaces:
ICoreAction<R>,java.util.concurrent.Callable<R>
- Direct Known Subclasses:
CoreAction
public abstract class InternalCoreAction<R> extends java.lang.Object implements ICoreAction<R>
Provides the (internal) interface to an action that can be executed. This is an internal class that is not to be used and may change any time.
-
-
Constructor Summary
Constructors Constructor Description InternalCoreAction(CoreActionHandler handler)Creates an action with a handler.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddDatavalidationFeedback(IMendixIdentifier id, java.util.Map<java.lang.String,java.lang.String> errorFields)Adds validation feedback to this action.voidaddDataValidationFeedback(DataValidationInfo dvInfo)Adds validation feedback to this action.Rcall()Invokes the action handler for this action.InternalCoreAction<R>clone()Returns a clone of this action.abstract Rexecute()Executes the action and returns the result.java.lang.StringgetActionName()Returns the name of this action.IContextgetClonedContext(IMendixIdentifier currentIdentifier, java.util.List<IMendixIdentifier> constraint)Returns a copy of the context of this action with the specified identifier and context objects.IContextgetContext()Returns the context of the action.java.util.List<IMendixObject>getEventObjects()Returns the event objects of this action.java.lang.ExceptiongetException()Returns the exception that was set for this action (if any).com.mendix.thirdparty.org.json.JSONObjectgetMetaInfo()Returns the meta-info of this action, containing additional details about the action.ActionStategetState()Returns the state of this action (if any).voidhandleConcurrentExecution()Throws a concurrent execution exception.voidsetActionName(java.lang.String actionName)Sets the name of this action.voidsetAllowsConcurrentExecution(java.lang.Boolean enabled)Sets whether this action allows concurrent execution.voidsetContext(IContext context)Sets the context for the action to execute in.voidsetEventObjects(java.util.List<IMendixObject> eventObjects)Sets the event objects of this action.voidsetException(java.lang.Exception exception)Sets the specified exception for this action.voidsetMetaInfo(com.mendix.thirdparty.org.json.JSONObject metaInfo)Sets the meta-info of this action.voidsetState(ActionState state)Sets the state of this action.
-
-
-
Constructor Detail
-
InternalCoreAction
public InternalCoreAction(CoreActionHandler handler)
Creates an action with a handler.- Parameters:
handler- the action handler for executing the action
-
-
Method Detail
-
getContext
public IContext getContext()
Description copied from interface:ICoreActionReturns the context of the action.- Specified by:
getContextin interfaceICoreAction<R>- Returns:
- the context for executing the action
-
setContext
public void setContext(IContext context)
Description copied from interface:ICoreActionSets the context for the action to execute in.- Specified by:
setContextin interfaceICoreAction<R>- Parameters:
context- the context for executing the action
-
execute
public abstract R execute() throws java.lang.Exception
Executes the action and returns the result.- Returns:
- the execution result
- Throws:
java.lang.Exception- when executing the action failed
-
call
public R call()
Description copied from interface:ICoreActionInvokes the action handler for this action.- Specified by:
callin interfacejava.util.concurrent.Callable<R>- Specified by:
callin interfaceICoreAction<R>- Returns:
- the execution result
-
addDatavalidationFeedback
public void addDatavalidationFeedback(IMendixIdentifier id, java.util.Map<java.lang.String,java.lang.String> errorFields)
Adds validation feedback to this action.- Parameters:
id- the identifier of the Mendix object that was validatederrorFields- the validation messages by attribute name
-
addDataValidationFeedback
public void addDataValidationFeedback(DataValidationInfo dvInfo)
Adds validation feedback to this action.- Parameters:
dvInfo- the validation feedback details
-
handleConcurrentExecution
public void handleConcurrentExecution() throws UserException, CoreExceptionThrows a concurrent execution exception.- Throws:
UserException- alwaysCoreException
-
getEventObjects
public java.util.List<IMendixObject> getEventObjects()
Description copied from interface:ICoreActionReturns the event objects of this action.- Specified by:
getEventObjectsin interfaceICoreAction<R>- Returns:
- the Mendix objects
-
setEventObjects
public void setEventObjects(java.util.List<IMendixObject> eventObjects)
Sets the event objects of this action.- Parameters:
eventObjects- the event objects to set
-
getMetaInfo
public com.mendix.thirdparty.org.json.JSONObject getMetaInfo()
Description copied from interface:ICoreActionReturns the meta-info of this action, containing additional details about the action.The contents will differ depending on the type of action.
- Specified by:
getMetaInfoin interfaceICoreAction<R>- Returns:
- the meta-info
-
setMetaInfo
public void setMetaInfo(com.mendix.thirdparty.org.json.JSONObject metaInfo)
Sets the meta-info of this action.- Parameters:
metaInfo- the meta-info to set
-
getActionName
public java.lang.String getActionName()
Description copied from interface:ICoreActionReturns the name of this action.- Specified by:
getActionNamein interfaceICoreAction<R>- Returns:
- the action name
-
setActionName
public void setActionName(java.lang.String actionName)
Sets the name of this action.- Parameters:
actionName- the name to set
-
getException
public java.lang.Exception getException()
Returns the exception that was set for this action (if any).- Returns:
- the exception if it was set; null otherwise
-
setException
public void setException(java.lang.Exception exception)
Sets the specified exception for this action.- Parameters:
exception- the exception to set
-
getState
public ActionState getState()
Returns the state of this action (if any).- Returns:
- the action state if it was set; null otherwise
-
setState
public void setState(ActionState state)
Sets the state of this action.- Parameters:
state- the state to set
-
setAllowsConcurrentExecution
public void setAllowsConcurrentExecution(java.lang.Boolean enabled)
Sets whether this action allows concurrent execution.If concurrent execution is not allowed,
handleConcurrentExecution()will be called if this action is called concurrently with itself.- Parameters:
enabled- true if concurrent execution is allowed; false otherwise
-
getClonedContext
public IContext getClonedContext(IMendixIdentifier currentIdentifier, java.util.List<IMendixIdentifier> constraint)
Returns a copy of the context of this action with the specified identifier and context objects.- Parameters:
currentIdentifier- the identifier to set on the copied context; if null, the existing identifier is not overwrittenconstraint- the context objects to set on the copied context; if null, the existing objects are not overwritten
-
clone
public InternalCoreAction<R> clone()
Returns a clone of this action.- Overrides:
clonein classjava.lang.Object- Returns:
- the cloned action
-
-