Package org.alfresco.repo.action
Class ActionImpl
- java.lang.Object
-
- org.alfresco.repo.action.ParameterizedItemImpl
-
- org.alfresco.repo.action.ActionImpl
-
- All Implemented Interfaces:
java.io.Serializable,Action,ParameterizedItem
- Direct Known Subclasses:
CompositeActionImpl,QuickShareLinkExpiryActionImpl,RenditionDefinitionImpl,ReplicationDefinitionImpl
public class ActionImpl extends ParameterizedItemImpl implements Action
Action implementation- Author:
- Roy Wetherall
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ActionImpl(Action action)ActionImpl(Action action, java.lang.String actionDefinitionName)ActionImpl(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.lang.String id, java.lang.String actionDefinitionName)ConstructorActionImpl(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.lang.String id, java.lang.String actionDefinitionName, java.util.Map<java.lang.String,java.io.Serializable> parameterValues)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddActionCondition(int index, ActionCondition actionCondition)Add an action condition at the given indexvoidaddActionCondition(ActionCondition actionCondition)Add an action condition to the actionvoidaddParameterValues(java.util.Map<java.lang.String,java.io.Serializable> values)Adds aMapof parameter values to theActionjava.util.Set<java.lang.String>getActionChain()Get the action chainActionConditiongetActionCondition(int index)Get the action condition at a given indexjava.util.List<ActionCondition>getActionConditions()Gets a list of the action conditions for this actionjava.lang.StringgetActionDefinitionName()Get the name of the action definition that relates to this actionActiongetCompensatingAction()Get the compensating action.java.util.DategetCreatedDate()Get the date the action was createdjava.lang.StringgetCreator()Get the name of the user that created the actionjava.lang.StringgetDescription()Get the description of the actionbooleangetExecuteAsychronously()A guide for the ActionService; Should the action be executed asychronously or not? It is not a general purpose flag to indicate the action is running asychronously.java.util.DategetExecutionEndDate()Gets the date that the action (last) finished execution at.java.lang.StringgetExecutionFailureMessage()Gets the message of the exception which caused the Action execution failure, or null if the Action hasn't failed / has been retried.intgetExecutionInstance()When there is more than one instance of the action executing, both with the same ID, which one is this? This crops up most often with persisted actions, with two copies running, one on each of two different target nodes.java.util.DategetExecutionStartDate()Gets the date that the action (last) began executing at.ActionStatusgetExecutionStatus()Gets the current execution status of the action, such as Running or Completed.java.util.DategetModifiedDate()Get the date that the action was last modifiedjava.lang.StringgetModifier()Get the name of the user that last modified the actionorg.alfresco.service.cmr.repository.NodeRefgetNodeRef()Gets the node ref that represents the saved action node.java.lang.StringgetRunAsUser()java.lang.StringgetTenantId()java.lang.StringgetTitle()Get the title of the actionjava.lang.BooleangetTrackStatus()booleanhasActionConditions()Indicates whether the action has any conditions specifiedintindexOfActionCondition(ActionCondition actionCondition)Gets the index of an action conditionvoidremoveActionCondition(ActionCondition actionCondition)Removes an action conditionvoidremoveAllActionConditions()Removes all action conditionsvoidsetActionChain(java.util.Set<java.lang.String> actionChain)Set the action chainvoidsetActionCondition(int index, ActionCondition actionCondition)Replaces the current action condition at the given index with the action condition provided.voidsetCompensatingAction(Action action)Set the compensating action.voidsetCreatedDate(java.util.Date createdDate)Set the created datevoidsetCreator(java.lang.String creator)Set the creatorvoidsetDescription(java.lang.String description)Set the description of the actionvoidsetExecuteAsynchronously(boolean executeAsynchronously)Set the value that indicates whether the action should be executed asychronously or not.voidsetExecutionEndDate(java.util.Date endDate)Records the date when the action finished execution, normally called by theActionServicewhen the action completes or fails.voidsetExecutionFailureMessage(java.lang.String message)Records the message of the exception which caused the Action to fail, if any.voidsetExecutionInstance(int instance)Called by the ActionService when the action begins running.voidsetExecutionStartDate(java.util.Date startDate)Records the date when the action began execution, normally called by theActionServicewhen it starts running the action.voidsetExecutionStatus(ActionStatus status)Updates the current execution status.voidsetModifiedDate(java.util.Date modifiedDate)Set the modified datevoidsetModifier(java.lang.String modifier)Set the modifiervoidsetNodeRef(org.alfresco.service.cmr.repository.NodeRef nodeRef)Set the node referencevoidsetRunAsUser(java.lang.String runAsUserName)voidsetTenantId(java.lang.String tenantId)voidsetTitle(java.lang.String title)Set the title of the actionvoidsetTrackStatus(java.lang.Boolean trackStatus)Set whether the action should be tracked or not.java.lang.StringtoString()-
Methods inherited from class org.alfresco.repo.action.ParameterizedItemImpl
equals, getId, getParameterValue, getParameterValues, hashCode, setParameterValue, setParameterValues
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.alfresco.service.cmr.action.ParameterizedItem
getId, getParameterValue, getParameterValues, setParameterValue, setParameterValues
-
-
-
-
Constructor Detail
-
ActionImpl
public ActionImpl(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.lang.String id, java.lang.String actionDefinitionName)Constructor- Parameters:
nodeRef- the action node reference (null if not saved)id- the action idactionDefinitionName- the name of the action definition
-
ActionImpl
public ActionImpl(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.lang.String id, java.lang.String actionDefinitionName, java.util.Map<java.lang.String,java.io.Serializable> parameterValues)Constructor- Parameters:
nodeRef- the action node reference (null if not saved)id- the action idactionDefinitionName- the action definition nameparameterValues- the parameter values
-
ActionImpl
public ActionImpl(Action action, java.lang.String actionDefinitionName)
-
ActionImpl
public ActionImpl(Action action)
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getTitle
public java.lang.String getTitle()
Description copied from interface:ActionGet the title of the action
-
setTitle
public void setTitle(java.lang.String title)
Description copied from interface:ActionSet the title of the action
-
getDescription
public java.lang.String getDescription()
Description copied from interface:ActionGet the description of the action- Specified by:
getDescriptionin interfaceAction- Returns:
- the description of the action
-
setDescription
public void setDescription(java.lang.String description)
Description copied from interface:ActionSet the description of the action- Specified by:
setDescriptionin interfaceAction- Parameters:
description- the description of the action
-
getTrackStatus
public java.lang.Boolean getTrackStatus()
- Specified by:
getTrackStatusin interfaceAction- Returns:
- true if the action must be tracked by the
ActionTrackingService, false if it must NOT be tracked or null to use the action definition's default.
-
setTrackStatus
public void setTrackStatus(java.lang.Boolean trackStatus)
Description copied from interface:ActionSet whether the action should be tracked or not. The option of tracking can be null i.e. unset, indicating that the defaults of the action definition should be used. This is to allow manual overriding of the property when it becomes supported by the UI.- Specified by:
setTrackStatusin interfaceAction- Parameters:
trackStatus- true if the action must be tracked by theActionTrackingService, false if it must NOT be tracked or null to use the action definition's default.
-
getExecuteAsychronously
public boolean getExecuteAsychronously()
Description copied from interface:ActionA guide for the ActionService; Should the action be executed asychronously or not? It is not a general purpose flag to indicate the action is running asychronously.The default is to execute the action synchronously.
- Specified by:
getExecuteAsychronouslyin interfaceAction- Returns:
- true if the action should be executed asychronously, false otherwise.
-
setExecuteAsynchronously
public void setExecuteAsynchronously(boolean executeAsynchronously)
Description copied from interface:ActionSet the value that indicates whether the action should be executed asychronously or not.- Specified by:
setExecuteAsynchronouslyin interfaceAction- Parameters:
executeAsynchronously- true if the action is to be executed asychronously, false otherwise.
-
getCompensatingAction
public Action getCompensatingAction()
Description copied from interface:ActionGet the compensating action.This action is executed if the failure behaviour is to compensate and the action being executed fails.
- Specified by:
getCompensatingActionin interfaceAction- Returns:
- the compensating action
-
setCompensatingAction
public void setCompensatingAction(Action action)
Description copied from interface:ActionSet the compensating action.- Specified by:
setCompensatingActionin interfaceAction- Parameters:
action- the compensating action
-
getCreatedDate
public java.util.Date getCreatedDate()
Description copied from interface:ActionGet the date the action was created- Specified by:
getCreatedDatein interfaceAction- Returns:
- action creation date
-
setCreatedDate
public void setCreatedDate(java.util.Date createdDate)
Set the created date- Parameters:
createdDate- the created date
-
getCreator
public java.lang.String getCreator()
Description copied from interface:ActionGet the name of the user that created the action- Specified by:
getCreatorin interfaceAction- Returns:
- user name
-
setCreator
public void setCreator(java.lang.String creator)
Set the creator
-
getModifiedDate
public java.util.Date getModifiedDate()
Description copied from interface:ActionGet the date that the action was last modified- Specified by:
getModifiedDatein interfaceAction- Returns:
- aciton modification date
-
setModifiedDate
public void setModifiedDate(java.util.Date modifiedDate)
Set the modified date
-
getModifier
public java.lang.String getModifier()
Description copied from interface:ActionGet the name of the user that last modified the action- Specified by:
getModifierin interfaceAction- Returns:
- user name
-
setModifier
public void setModifier(java.lang.String modifier)
Set the modifier
-
getActionDefinitionName
public java.lang.String getActionDefinitionName()
Description copied from interface:ActionGet the name of the action definition that relates to this action- Specified by:
getActionDefinitionNamein interfaceAction- Returns:
- the action defintion name
-
hasActionConditions
public boolean hasActionConditions()
Description copied from interface:ActionIndicates whether the action has any conditions specified- Specified by:
hasActionConditionsin interfaceAction- Returns:
- true if the action has any conditions specified, flase otherwise
-
indexOfActionCondition
public int indexOfActionCondition(ActionCondition actionCondition)
Description copied from interface:ActionGets the index of an action condition- Specified by:
indexOfActionConditionin interfaceAction- Parameters:
actionCondition- the action condition- Returns:
- the index
-
getActionConditions
public java.util.List<ActionCondition> getActionConditions()
Description copied from interface:ActionGets a list of the action conditions for this action- Specified by:
getActionConditionsin interfaceAction- Returns:
- list of action conditions
-
getActionCondition
public ActionCondition getActionCondition(int index)
Description copied from interface:ActionGet the action condition at a given index- Specified by:
getActionConditionin interfaceAction- Parameters:
index- the index- Returns:
- the action condition
-
addActionCondition
public void addActionCondition(ActionCondition actionCondition)
Description copied from interface:ActionAdd an action condition to the action- Specified by:
addActionConditionin interfaceAction- Parameters:
actionCondition- an action condition
-
addActionCondition
public void addActionCondition(int index, ActionCondition actionCondition)Description copied from interface:ActionAdd an action condition at the given index- Specified by:
addActionConditionin interfaceAction- Parameters:
index- the indexactionCondition- the action condition
-
setActionCondition
public void setActionCondition(int index, ActionCondition actionCondition)Description copied from interface:ActionReplaces the current action condition at the given index with the action condition provided.- Specified by:
setActionConditionin interfaceAction- Parameters:
index- the indexactionCondition- the action condition
-
removeActionCondition
public void removeActionCondition(ActionCondition actionCondition)
Description copied from interface:ActionRemoves an action condition- Specified by:
removeActionConditionin interfaceAction- Parameters:
actionCondition- an action condition
-
removeAllActionConditions
public void removeAllActionConditions()
Description copied from interface:ActionRemoves all action conditions- Specified by:
removeAllActionConditionsin interfaceAction
-
setActionChain
public void setActionChain(java.util.Set<java.lang.String> actionChain)
Set the action chain- Parameters:
actionChain- the list of actions that lead to this action
-
getActionChain
public java.util.Set<java.lang.String> getActionChain()
Get the action chain- Returns:
- the list of actions that lead to this action
-
getRunAsUser
public java.lang.String getRunAsUser()
-
getTenantId
public java.lang.String getTenantId()
-
setRunAsUser
public void setRunAsUser(java.lang.String runAsUserName)
-
setTenantId
public void setTenantId(java.lang.String tenantId)
-
getNodeRef
public org.alfresco.service.cmr.repository.NodeRef getNodeRef()
Description copied from interface:ActionGets the node ref that represents the saved action node. Returns null id unsaved.- Specified by:
getNodeRefin interfaceAction- Returns:
- the action node reference
-
setNodeRef
public void setNodeRef(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Set the node reference- Parameters:
nodeRef- the node reference
-
addParameterValues
public void addParameterValues(java.util.Map<java.lang.String,java.io.Serializable> values)
Description copied from interface:ActionAdds aMapof parameter values to theAction- Specified by:
addParameterValuesin interfaceAction- Parameters:
values- A map of values to be added
-
getExecutionInstance
public int getExecutionInstance()
When there is more than one instance of the action executing, both with the same ID, which one is this? This crops up most often with persisted actions, with two copies running, one on each of two different target nodes.
-
setExecutionInstance
public void setExecutionInstance(int instance)
Called by the ActionService when the action begins running.
-
getExecutionStartDate
public java.util.Date getExecutionStartDate()
Description copied from interface:ActionGets the date that the action (last) began executing at. Null if the action has not yet been run. For a saved action, this will be the last time at ran.- Specified by:
getExecutionStartDatein interfaceAction- Returns:
- The date the action (last) began executing at, or null.
-
setExecutionStartDate
public void setExecutionStartDate(java.util.Date startDate)
Records the date when the action began execution, normally called by theActionServicewhen it starts running the action.
-
getExecutionEndDate
public java.util.Date getExecutionEndDate()
Description copied from interface:ActionGets the date that the action (last) finished execution at. Null if the action has not yet been run, or is currently running. For a saved action, this will normally be the last time it finished running.- Specified by:
getExecutionEndDatein interfaceAction- Returns:
- The date the action last finished exeucting at, or null.
-
setExecutionEndDate
public void setExecutionEndDate(java.util.Date endDate)
Records the date when the action finished execution, normally called by theActionServicewhen the action completes or fails.
-
getExecutionStatus
public ActionStatus getExecutionStatus()
Description copied from interface:ActionGets the current execution status of the action, such as Running or Completed.- Specified by:
getExecutionStatusin interfaceAction- Returns:
- The current execution status
-
setExecutionStatus
public void setExecutionStatus(ActionStatus status)
Updates the current execution status. This is normally called by theActionServiceas it progresses the Action's execution.
-
getExecutionFailureMessage
public java.lang.String getExecutionFailureMessage()
Description copied from interface:ActionGets the message of the exception which caused the Action execution failure, or null if the Action hasn't failed / has been retried.- Specified by:
getExecutionFailureMessagein interfaceAction- Returns:
- The exception message, if the action has failed
-
setExecutionFailureMessage
public void setExecutionFailureMessage(java.lang.String message)
Records the message of the exception which caused the Action to fail, if any.
-
-