Class ActionImpl

    • 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 id
        actionDefinitionName - 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 id
        actionDefinitionName - the action definition name
        parameterValues - 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:
        toString in class java.lang.Object
      • getTitle

        public java.lang.String getTitle()
        Description copied from interface: Action
        Get the title of the action
        Specified by:
        getTitle in interface Action
        Returns:
        the title of the action
      • setTitle

        public void setTitle​(java.lang.String title)
        Description copied from interface: Action
        Set the title of the action
        Specified by:
        setTitle in interface Action
        Parameters:
        title - the title of the action
      • getDescription

        public java.lang.String getDescription()
        Description copied from interface: Action
        Get the description of the action
        Specified by:
        getDescription in interface Action
        Returns:
        the description of the action
      • setDescription

        public void setDescription​(java.lang.String description)
        Description copied from interface: Action
        Set the description of the action
        Specified by:
        setDescription in interface Action
        Parameters:
        description - the description of the action
      • getTrackStatus

        public java.lang.Boolean getTrackStatus()
        Specified by:
        getTrackStatus in interface Action
        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: Action
        Set 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:
        setTrackStatus in interface Action
        Parameters:
        trackStatus - 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.
      • getExecuteAsychronously

        public boolean getExecuteAsychronously()
        Description copied from interface: Action
        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.

        The default is to execute the action synchronously.

        Specified by:
        getExecuteAsychronously in interface Action
        Returns:
        true if the action should be executed asychronously, false otherwise.
      • setExecuteAsynchronously

        public void setExecuteAsynchronously​(boolean executeAsynchronously)
        Description copied from interface: Action
        Set the value that indicates whether the action should be executed asychronously or not.
        Specified by:
        setExecuteAsynchronously in interface Action
        Parameters:
        executeAsynchronously - true if the action is to be executed asychronously, false otherwise.
      • getCompensatingAction

        public Action getCompensatingAction()
        Description copied from interface: Action
        Get the compensating action.

        This action is executed if the failure behaviour is to compensate and the action being executed fails.

        Specified by:
        getCompensatingAction in interface Action
        Returns:
        the compensating action
      • setCompensatingAction

        public void setCompensatingAction​(Action action)
        Description copied from interface: Action
        Set the compensating action.
        Specified by:
        setCompensatingAction in interface Action
        Parameters:
        action - the compensating action
      • getCreatedDate

        public java.util.Date getCreatedDate()
        Description copied from interface: Action
        Get the date the action was created
        Specified by:
        getCreatedDate in interface Action
        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: Action
        Get the name of the user that created the action
        Specified by:
        getCreator in interface Action
        Returns:
        user name
      • setCreator

        public void setCreator​(java.lang.String creator)
        Set the creator
      • getModifiedDate

        public java.util.Date getModifiedDate()
        Description copied from interface: Action
        Get the date that the action was last modified
        Specified by:
        getModifiedDate in interface Action
        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: Action
        Get the name of the user that last modified the action
        Specified by:
        getModifier in interface Action
        Returns:
        user name
      • setModifier

        public void setModifier​(java.lang.String modifier)
        Set the modifier
      • getActionDefinitionName

        public java.lang.String getActionDefinitionName()
        Description copied from interface: Action
        Get the name of the action definition that relates to this action
        Specified by:
        getActionDefinitionName in interface Action
        Returns:
        the action defintion name
      • hasActionConditions

        public boolean hasActionConditions()
        Description copied from interface: Action
        Indicates whether the action has any conditions specified
        Specified by:
        hasActionConditions in interface Action
        Returns:
        true if the action has any conditions specified, flase otherwise
      • indexOfActionCondition

        public int indexOfActionCondition​(ActionCondition actionCondition)
        Description copied from interface: Action
        Gets the index of an action condition
        Specified by:
        indexOfActionCondition in interface Action
        Parameters:
        actionCondition - the action condition
        Returns:
        the index
      • getActionConditions

        public java.util.List<ActionCondition> getActionConditions()
        Description copied from interface: Action
        Gets a list of the action conditions for this action
        Specified by:
        getActionConditions in interface Action
        Returns:
        list of action conditions
      • getActionCondition

        public ActionCondition getActionCondition​(int index)
        Description copied from interface: Action
        Get the action condition at a given index
        Specified by:
        getActionCondition in interface Action
        Parameters:
        index - the index
        Returns:
        the action condition
      • addActionCondition

        public void addActionCondition​(ActionCondition actionCondition)
        Description copied from interface: Action
        Add an action condition to the action
        Specified by:
        addActionCondition in interface Action
        Parameters:
        actionCondition - an action condition
      • addActionCondition

        public void addActionCondition​(int index,
                                       ActionCondition actionCondition)
        Description copied from interface: Action
        Add an action condition at the given index
        Specified by:
        addActionCondition in interface Action
        Parameters:
        index - the index
        actionCondition - the action condition
      • setActionCondition

        public void setActionCondition​(int index,
                                       ActionCondition actionCondition)
        Description copied from interface: Action
        Replaces the current action condition at the given index with the action condition provided.
        Specified by:
        setActionCondition in interface Action
        Parameters:
        index - the index
        actionCondition - the action condition
      • removeActionCondition

        public void removeActionCondition​(ActionCondition actionCondition)
        Description copied from interface: Action
        Removes an action condition
        Specified by:
        removeActionCondition in interface Action
        Parameters:
        actionCondition - an action condition
      • removeAllActionConditions

        public void removeAllActionConditions()
        Description copied from interface: Action
        Removes all action conditions
        Specified by:
        removeAllActionConditions in interface Action
      • 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: Action
        Gets the node ref that represents the saved action node. Returns null id unsaved.
        Specified by:
        getNodeRef in interface Action
        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: Action
        Adds a Map of parameter values to the Action
        Specified by:
        addParameterValues in interface Action
        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: Action
        Gets 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:
        getExecutionStartDate in interface Action
        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 the ActionService when it starts running the action.
      • getExecutionEndDate

        public java.util.Date getExecutionEndDate()
        Description copied from interface: Action
        Gets 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:
        getExecutionEndDate in interface Action
        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 the ActionService when the action completes or fails.
      • getExecutionStatus

        public ActionStatus getExecutionStatus()
        Description copied from interface: Action
        Gets the current execution status of the action, such as Running or Completed.
        Specified by:
        getExecutionStatus in interface Action
        Returns:
        The current execution status
      • setExecutionStatus

        public void setExecutionStatus​(ActionStatus status)
        Updates the current execution status. This is normally called by the ActionService as it progresses the Action's execution.
      • getExecutionFailureMessage

        public java.lang.String getExecutionFailureMessage()
        Description copied from interface: Action
        Gets the message of the exception which caused the Action execution failure, or null if the Action hasn't failed / has been retried.
        Specified by:
        getExecutionFailureMessage in interface Action
        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.