Class ExecuteObject


  • public class ExecuteObject
    extends XMLRequest
    Executes an UC4 Object.
    • Constructor Detail

      • ExecuteObject

        public ExecuteObject​(UC4ObjectName name)
        Constructs a ExecuteObject using the specified object name. The method Connection#sendRequest has to be used if this object needs interactive input (Form). In this case Connection#sendRequestAndWait would block infinitely.
        Parameters:
        name - name of the UC4 object.
    • Method Detail

      • setInstanceParameter

        public void setInstanceParameter​(java.lang.String name,
                                         java.lang.String value)
        This method can be used to set additional parameters which are shown in the details of the task. The value will be replaced if a parameter with the same name already exists.
        Parameters:
        name - Name of the detail value; max 200 characters
        value - Value, null is not allowed
      • putPromptBuffer

        public void putPromptBuffer​(java.lang.String variable,
                                    java.lang.String value)
        Puts the name and content of a script variable to the input buffer. See :PUT_READ_BUFFER, :PUT_PROMPT_BUFFER in the documentation.
        Parameters:
        variable - Variable name without &
        value - Value
        Since:
        V10
      • putPromptBuffer

        public void putPromptBuffer​(java.lang.String variable,
                                    java.lang.String[] array)
        Puts the name and content of a script array to the input buffer. See :PUT_READ_BUFFER, :PUT_PROMPT_BUFFER in the documentation.
        Parameters:
        variable - Variable name without &, for example CHECKGROUP1#
        array - Content of the variable
        Since:
        V10
      • getSrc

        protected java.lang.String getSrc()
        Description copied from class: XMLRequest
        Returns the request source. This method is used internally.
        Specified by:
        getSrc in class XMLRequest
        Returns:
        Source
      • executeOnce

        public void executeOnce​(DateTime startDate,
                                DateTime logicalDate,
                                UC4TimezoneName tz,
                                boolean waitForManualRelease,
                                ExecuteTestOptions options)
        Executes a task only once. An IllegalStateException is thrown if startDate is set (not null) and waitForManualRelease is true. The task is executed using the CLIENT_QUEUE.
        Parameters:
        startDate - Start date and time or null if the task should start immediately.
        logicalDate - Start date and time of the logical start date or null if not used.
        tz - Timezone or null if not used
        waitForManualRelease - specifies if the task should wait for manual release
        options - Testoptions or null if not used
      • setWaitForManualRelease

        public void setWaitForManualRelease​(boolean flag)
        Waits for manual release, this method only works if executeOnce is selected.
        Parameters:
        flag - Option to wait for a manual release, true=wait, false=start immediately
      • getRecurringDefinition

        public ExecuteRecurring getRecurringDefinition()
        Returns the settings of the periodic task.
        Returns:
        Recurring settings
      • setDebug

        protected void setDebug​(boolean debug)
        Enables debugging, subclasses may override. Internal use only, therefore this method is not public A native message handler needs to be set if debugging is enabled
        Parameters:
        debug - true if debug should be enabled
      • executeOnce

        public void executeOnce​(DateTime startDate,
                                DateTime logicalDate,
                                UC4TimezoneName tz,
                                boolean waitForManualRelease,
                                ExecuteTestOptions options,
                                UC4ObjectName queue)
        Executes a task only once. An IllegalStateException is thrown if startDate is set (not null) and waitForManualRelease is true.
        Parameters:
        startDate - Start date and time or null if the task should start immediately.
        logicalDate - Start date and time of the logical start date or null if not used.
        tz - Timezone or null if not used
        waitForManualRelease - specifies if the task should wait for manual release
        options - Testoptions or null if not used
        queue - Queue which should be used
      • executeOnce

        public void executeOnce​(DateTime startDate,
                                DateTime logicalDate,
                                UC4TimezoneName tz,
                                boolean waitForManualRelease,
                                ExecuteTestOptions options,
                                UC4ObjectName queue,
                                UC4Alias aliasName)
        Executes a task only once. An IllegalStateException is thrown if startDate is set (not null) and waitForManualRelease is true.
        Parameters:
        startDate - Start date and time or null if the task should start immediately.
        logicalDate - Start date and time of the logical start date or null if not used.
        tz - Timezone or null if not used
        waitForManualRelease - specifies if the task should wait for manual release
        options - Testoptions or null if not used
        queue - Queue which should be used
        aliasName - Alias
      • executeRecurring

        public void executeRecurring​(ExecuteRecurring recurring)
        Executes a task in a defined period.
        Parameters:
        recurring - Settings
      • isDirectStart

        public boolean isDirectStart()
        Returns the execution mode.
        Returns:
        Returns true if the execution is not recurring or execute once otherwise false
      • isExecuteOnce

        public boolean isExecuteOnce()
        Returns the execution mode.
        Returns:
        Returns true if execution mode is execute once otherwise false
      • allowImmediateStart

        public void allowImmediateStart​(boolean flag)
        This method can be used to set the behaviour in case the start time lies in the past. The default value is true for compatibility reasons.
        Parameters:
        flag - true if an UC4 Object should be allowed to start immediately, false if not.
      • createRequest

        protected void createRequest​(com.uc4.util.XMLDocument doc,
                                     org.w3c.dom.Element request,
                                     ConnectionAttributes sessionInfo)
        Description copied from class: XMLRequest
        Creates the XML Document for the request. This method is used internally.
        Specified by:
        createRequest in class XMLRequest
        Parameters:
        doc - Document, used to create new Elements
        request - Request Element - classes append information to this request element
        sessionInfo - Information about the session
      • isExecuteReccuring

        public boolean isExecuteReccuring()
        Returns true if this is a recurring execution.
        Returns:
        Recurring
      • handleContent

        protected void handleContent​(com.uc4.util.XMLDocument doc,
                                     ConnectionAttributes session)
        Description copied from class: XMLRequest
        Sub classes extract the values from the XML document and provide public getter methods.
        Overrides:
        handleContent in class XMLRequest
        Parameters:
        doc - XML Document
        session - Info about the user session
      • getRunID

        public int getRunID()
        Returns the RunID of this request. If the UC4 Object could not be generated this method returns 0 and the method getMsgbox() returns the error message. The return value is also 0 if the request has never been sent.
        Returns:
        RunID or 0 if there was an error. Use the method getMessageNumber() and getMessageInsert() to get more information
      • getMessageNumber

        public int getMessageNumber()
        This method returns a message number in case that the execution failed. A return value of 0 means that there was no error.
        Returns:
        Message Number
      • getMessageInsert

        public java.lang.String getMessageInsert()
        This method returns a message insert for the message number returned by getMessageNumber.
        Returns:
        Message Insert, the return value can be an empty String but it is never null
      • getMessageText

        public java.lang.String getMessageText()
        Returns the error message translated in the language of the user.
        Returns:
        Error message if the execution failed, the return value can be an empty String but it is never null
      • executeFirstTimeTask

        public void executeFirstTimeTask()
        This method will set the startImmediate to Zero.