psdi.common.action

Class Action

  • All Implemented Interfaces:
    java.rmi.Remote, ActionRemote, MboConstants, MboRemote, MaxRemoteProxy


    public class Action
    extends Mbo
    implements ActionRemote
    Action is a task to be performed in workflow, escalation, SLA, etc. The attributes of ACTION are as follows: ACTION Action identifier. ACTIONID Unique Id Non-persistent value to hold classname. Non-persistent field for Expression Builder DESCRIPTION Description of action. DESCRIPTION_LONGDESCRIPTION Long Description for Action Description. EXPOBJECT Non-Persistent field for Expression Builder LANGCODE Language Column NEWSTATUS Non-persistent column for new status. The type of objects on which action can be applied. PARAMETER Parameter for class name. Type of action Action string of action.
    • Constructor Detail

      • Action

        public Action(MboSet ms)
               throws MXException,
                      java.rmi.RemoteException
        Construct the Action object
        Throws:
        MXException
        java.rmi.RemoteException
    • Method Detail

      • init

        public void init()
                  throws MXException
        Mbo Initialization routine. If an action is in use on a workflow process, SLA, or escalation, objectname field is readonly.
        Overrides:
        init in class Mbo
        Throws:
        MXException
      • setFieldFlags

        public void setFieldFlags(java.lang.String type)
                           throws MXException,
                                  java.rmi.RemoteException
        Method to set readonly flags for fields based on the type of action.
        Parameters:
        type - Type of the action.
        Throws:
        MXException
        java.rmi.RemoteException
      • isWoTktAppAction

        public boolean isWoTktAppAction()
                                 throws MXException,
                                        java.rmi.RemoteException
        Returns true if the action is one of these appactions (CREATESR, CREATEINCIDENT, CREATEPROBLEM, CREATEWO, CREATECHANGE, CREATERELEASE) for one of these objects (SR, Incident, Problem, WO, Change, Release, Activity). This method is used to determine whether the Parameter/Attribute field should be editable, and whether the Select Fields detail menu should bring up the relationship tree.
        Specified by:
        isWoTktAppAction in interface ActionRemote
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • isParameterPMAppAction

        public boolean isParameterPMAppAction()
                                       throws MXException,
                                              java.rmi.RemoteException
        Returns true if the action is one of these appactions (GENERATEFORCAST, GENERATEWORKORDER) for PM object. This method is used to determine whether the Parameter/Attribute field should be editable.
        Returns:
        boolean true if editable
        Throws:
        MXException
        java.rmi.RemoteException
      • isParameterInvoiceAppAction

        public boolean isParameterInvoiceAppAction()
                                            throws MXException,
                                                   java.rmi.RemoteException
        Returns true if the action is one of these appactions (REVERSEINVOICE) for INVOICE object. This method is used to determine whether the Parameter/Attribute field should be editable.
        Returns:
        boolean true if editable
        Throws:
        MXException
        java.rmi.RemoteException
      • addMembers

        public void addMembers(MboSetRemote actionSet)
                        throws MXException,
                               java.rmi.RemoteException
        Method to add the selected actions to the action group.
        Specified by:
        addMembers in interface ActionRemote
        Parameters:
        actionSet - Selected action set
        Throws:
        MXException
        java.rmi.RemoteException
      • executeAction

        public void executeAction(MboRemote target,
                                  java.lang.Object[] parameters)
                           throws MXException,
                                  java.rmi.RemoteException
        Executes an action. If it's an action group, executes all member actions in sequence.
        Specified by:
        executeAction in interface ActionRemote
        Parameters:
        mbo - The mbo on which the action is executed.
        parameters - Members of this array are added to the parameter array, used for custom actions.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.common.action
      • executeAction

        public void executeAction(MboRemote mbo)
                           throws MXException,
                                  java.rmi.RemoteException
        Executes an action. If it's an action group, executes all member actions in their sequence.
        Specified by:
        executeAction in interface ActionRemote
        Parameters:
        mbo - The mbo on which the action is executed.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        psdi.common.action.executeAction(MboRemote mbo)
      • executeActionGroup

        protected void executeActionGroup(MboRemote mbo,
                                          java.lang.Object[] parameters)
                                   throws MXException,
                                          java.rmi.RemoteException
        Execute an action of type GROUP. Go through the action members in the group one by one by their sequence. If any action throws an error, execution stops there.
        Parameters:
        mbo - The target of the action
        parameters - The parameters for any member of the group which is a custom action.
        Throws:
        MXException
        java.rmi.RemoteException
      • executeCustomClass

        protected void executeCustomClass(MboRemote mbo,
                                          java.lang.String className,
                                          java.lang.Object[] parameters)
                                   throws MXException,
                                          java.rmi.RemoteException
        Executes an action of type "CUSTOM".
        Parameters:
        mbo - The mbo on which the action is executed.
        className - The name of the custom class.
        parameter - The parameters to pass the target of the action to the custom class. The parameters[0] is the value from the Action's Parameter attribute. The rest were passed by to the executeAction method.
        Throws:
        MXException
        java.rmi.RemoteException
      • executeCommandLine

        protected void executeCommandLine(java.lang.String commandLine)
                                   throws MXException,
                                          java.rmi.RemoteException
        Executes a command line executable.
        Parameters:
        commandLine - The command line exe file with path.
        Throws:
        MXException
        java.rmi.RemoteException
      • executeSetValue

        protected void executeSetValue(MboRemote curMbo,
                                       MboRemote sourceMbo,
                                       java.lang.String attributeName,
                                       java.lang.String value)
                                throws MXException,
                                       java.rmi.RemoteException
        Executes a setValue action on the mbo.
        Parameters:
        curMbo - The current mbo in the context of a recursive call.
        sourceMbo - The original mbo that the action applies to.
        attributeName - The attribute name of the value to be set.
        value - The new value of the attribute, which can be an expression.
        Throws:
        MXException
        java.rmi.RemoteException
      • executeChangeStatus

        protected void executeChangeStatus(MboRemote mbo,
                                           java.lang.String newStatus,
                                           java.lang.String memo)
                                    throws MXException,
                                           java.rmi.RemoteException
        Executes a change status action.
        Parameters:
        mbo - The mbo whose status will be changed.
        newStatus - The new status to change to.
        Throws:
        MXException
        java.rmi.RemoteException
      • executeAppAction

        protected void executeAppAction(MboRemote mbo,
                                        java.lang.String value,
                                        java.lang.String parameter)
                                 throws MXException,
                                        java.rmi.RemoteException
        Executes an application action. param mbo The mbo on which the application action is executed.
        Parameters:
        value - Indicates what type of app action to execute.
        parameter - Parameter of the app action if needed.
        Throws:
        MXException
        java.rmi.RemoteException
      • executeWOTktAppAction

        protected void executeWOTktAppAction(java.lang.String appAction,
                                             MboRemote mbo,
                                             java.lang.String param)
                                      throws java.lang.Throwable
        Execute wo/ticket/pm application actions. Validates whether the mbo implements the AppActionInterface.
        Parameters:
        mbo - The mbo on which the action is applied.
        param - The parameter for creating the service request.
        Throws:
        MXException
        java.rmi.RemoteException
        java.lang.Throwable
      • executeApplySLA

        protected void executeApplySLA(MboRemote mbo)
                                throws MXException,
                                       java.rmi.RemoteException
        Execute application action ApplySLA. Validates whether the mbo is either a WORKORDER or a TICKET.
        Parameters:
        mbo - The mbo on which the action is applied.
        Throws:
        MXException
        java.rmi.RemoteException
      • executeWFInitiate

        protected void executeWFInitiate(MboRemote mbo,
                                         java.lang.String value)
                                  throws MXException,
                                         java.rmi.RemoteException
        Initiate workflow on the target Mbo.
        Parameters:
        mbo - Target Mbo.
        value - The name of the workflow process to initiate.
        Throws:
        MXApplicationException - Thrown with "workflow", "BgInitFailure" if the workflow can't be initiated in the background. The nested exception will have additional details.
        MXException
        java.rmi.RemoteException
        See Also:
        This method is used to initiate workflow.
      • executeWFAccept

        protected void executeWFAccept(MboRemote mbo,
                                       java.lang.String value)
                                throws MXException,
                                       java.rmi.RemoteException
        Completes the workflow assignment with the accept action.
        Parameters:
        mbo - The target Mbo which must be a WFAssignment.
        value - Used as the memo.
        Throws:
        MXApplicationException - Thrown with "workflow", "NotWorkflowAssignment" if the target Mbo isn't a WFAssignment.
        MXApplicationException - Thrown with "workflow", "BgCompFailure" if the workflow assignment can't be completed in the background. The nested exception will have additional details.
        MXException
        java.rmi.RemoteException
        See Also:
        This method is used to complete the workflow assignment.
      • executeWFReject

        protected void executeWFReject(MboRemote mbo,
                                       java.lang.String value)
                                throws MXException,
                                       java.rmi.RemoteException
        Completes the workflow assignment with the reject action.
        Parameters:
        mbo - The target Mbo which must be a WFAssignment.
        value - Used as the memo.
        Throws:
        MXApplicationException - Thrown with "workflow", "NotWorkflowAssignment" if the target Mbo isn't a WFAssignment.
        MXApplicationException - Thrown with "workflow", "BgCompFailure" if the workflow assignment can't be completed in the background. The nested exception will have additional details.
        MXException
        java.rmi.RemoteException
        See Also:
        This method is used to complete the workflow assignment.
      • executeWFEscalate

        protected void executeWFEscalate(MboRemote mbo,
                                         java.lang.String value)
                                  throws MXException,
                                         java.rmi.RemoteException
        Performs the basic workflow assignment escalation.
        Parameters:
        mbo - The target Mbo which must be a WFAssignment.
        value - Used as the memo.
        Throws:
        MXApplicationException - Thrown with "workflow", "NotWorkflowAssignment" if the target Mbo isn't a WFAssignment.
        MXException
        java.rmi.RemoteException
        See Also:
        This does the escalation.
      • getType

        public java.lang.String getType()
                                 throws MXException,
                                        java.rmi.RemoteException
        Returns the action type.
        Specified by:
        getType in interface ActionRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • skipCopyField

        protected boolean skipCopyField(MboValueInfo mvi)
                                 throws java.rmi.RemoteException,
                                        MXException
        Overrides the skipCopyField() in the Mbo. While this Action MBO is being copied, this method checks if each attribute needs to be copied by using the data from the static HashSet skipFieldCopy. This method also checks whether certain attributes whose "to copy or not to copy" status is instance-specific and cannot be added to the static HashSet should be copied for this object.
        Overrides:
        skipCopyField in class Mbo
        Parameters:
        MboValueInfo - object of the MboValue that needs to be copied.
        Returns:
        true if the field does not need to be copied. Otherwise, false is returned.
        Throws:
        java.rmi.RemoteException
        MXException
      • delete

        public void delete(long accessModifier)
                    throws MXException,
                           java.rmi.RemoteException
        Description copied from class: Mbo
        Mark the object to be deleted depending on the access modifier. This will usually be overridden in the subclass of Mbo as there may be application specific rules as to if and when an object can be deleted. Object is not actually deleted in the database until save() is called. This method will also mark all associated Long Description and Translation Mbos for deletion.
        Specified by:
        delete in interface MboRemote
        Overrides:
        delete in class Mbo
        Parameters:
        accessModifier - The bitwise flag specified to determine if certain normal security checks are to be bypassed for this delete request. For example: if the accessModifer is NOACCESSCHECK, then the check for the object's NODELETE flag and the call to the object's canDelete() method will not be performed. If the accessModifer is NONE, then all the access checks are performed before this object is marked delete.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Mbo.delete(long)
      • isObjectStatusable

        public boolean isObjectStatusable()
                                   throws MXException,
                                          java.rmi.RemoteException
        Checks whether the action's object is a statusable.
        Returns:
        TRUE if action's object type is statusable.
        Throws:
        MXException
        java.rmi.RemoteException
      • copy

        public MboRemote copy(MboSetRemote mboset,
                              long mboAddFlags)
                       throws MXException,
                              java.rmi.RemoteException
        Description copied from class: Mbo
        Adds a new mbo to the set passed in and copies the information for each of the fields into the new mbo from this. The new mbo will be added to the next of the current index.
        Specified by:
        copy in interface MboRemote
        Overrides:
        copy in class Mbo
        Parameters:
        mboset - The set into which the new mbo will be added.
        mboAddFlags - Flags to use when adding the new Mbo. Values on the attribute are always set with NOACCESSCHECK|NOVALIDATION_AND_NOACTION.
        Returns:
        The new mbo, with values copied from this mbo.
        Throws:
        MXException
        java.rmi.RemoteException
      • save

        protected void save()
                     throws MXException,
                            java.rmi.RemoteException
        Description copied from class: Mbo
        Save the object and other linked objects. Subclasses can code their save() logic to include any appropriate updates to other linked objects and call super.save().
        Overrides:
        save in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException