com.ibm.tivoli.maximo.script

Class AbstractScriptDriver

  • java.lang.Object
    • com.ibm.tivoli.maximo.script.AbstractScriptDriver
    • Constructor Detail

      • AbstractScriptDriver

        public AbstractScriptDriver()
    • Method Detail

      • runScript

        public final void runScript(java.lang.String name,
                                    java.util.Map context)
                             throws MXException,
                                    java.rmi.RemoteException
        Description copied from interface: ScriptDriver
        Executes the script identified by name
        Specified by:
        runScript in interface ScriptDriver
        Parameters:
        name - - the name of the script to execute
        context - - the execution context for the script runtime
        Throws:
        MXException
        java.rmi.RemoteException
      • isParamErrorKey

        public boolean isParamErrorKey(java.lang.String contextParam)
        Parameters:
        contextParam -
        Returns:
        boolean
      • isParamErrorGroup

        public boolean isParamErrorGroup(java.lang.String contextParam)
        Parameters:
        contextParam -
        Returns:
        boolean
      • evalScript

        protected abstract void evalScript(ScriptInfo scriptInfo,
                                           java.util.Map context)
                                    throws MXException,
                                           java.rmi.RemoteException
        Parameters:
        scriptInfo -
        context -
        Throws:
        MXException
        java.rmi.RemoteException
      • evalINParams

        protected void evalINParams(ScriptInfo scriptInfo,
                                    java.util.Map context,
                                    java.util.Map calculatedParamValues)
                             throws MXException,
                                    java.rmi.RemoteException
        Parameters:
        scriptInfo -
        context -
        Throws:
        MXException
        java.rmi.RemoteException
      • isChildAttribute

        protected boolean isChildAttribute(java.lang.String attrBindingValue)
      • isNull

        protected boolean isNull(java.lang.String s)
        Parameters:
        s -
        Returns:
        boolean
      • printMap

        protected void printMap(java.util.Set entries,
                                java.lang.String text)
      • evalOUTParams

        protected void evalOUTParams(ScriptInfo scriptInfo,
                                     java.util.Map context,
                                     java.util.Map clonedContext,
                                     java.util.Map calculatedParamValues)
                              throws MXException,
                                     java.rmi.RemoteException
        Evaluate OUT/INOUT parameters.
        Parameters:
        scriptInfo - the ScriptInfo object
        context - the context map passed to the script
        clonedContext - the cloned version of the context map
        Throws:
        MXException
        java.rmi.RemoteException
      • checkForScriptError

        protected void checkForScriptError(java.util.Map context)
                                    throws MXException
        Verifies if the script has set the error flag - indicating an MXException has to be generated.
        Parameters:
        context - the variable context passed to the script engine.
        Throws:
        MXException
      • setValue

        protected void setValue(MboRemote mbo,
                                java.lang.String attributeName,
                                java.lang.Object value,
                                long flag)
                         throws MXException,
                                java.rmi.RemoteException
        Set value to mbo attribute.
        Parameters:
        mbo - the mbo
        attributeName - the attribute
        value - the value to set
        flag - the field flag
        Throws:
        MXException
        java.rmi.RemoteException
      • getLogger

        protected MXLogger getLogger(java.lang.String name)
        Returns:
        the logger instance
      • hasValueChanged

        protected boolean hasValueChanged(java.lang.String contextVar,
                                          java.util.Map context,
                                          java.util.Map clonedContext)
        Verifies if the parameter value has been modified by the script.
        Parameters:
        contextVar - the context param name
        context - the context that is passed to the s script execution engine
        clonedContext - the cloned version of the context
        Returns:
        true if value has been modified by the script and false if not