Class TaskPromptSetContent

java.lang.Object
com.uc4.communication.requests.XMLRequest
com.uc4.communication.requests.TaskPromptSetContent
All Implemented Interfaces:
Iterable<PromptElement>

public class TaskPromptSetContent extends XMLRequest implements Iterable<PromptElement>
This request reads the content of a PromptSet (List of PromptElements) for a specified task. Sample for read and modify PromptSet: TaskPromptSetContent prompt = null; TaskPromptSetNames names = new TaskPromptSetNames(runID); connection.sendRequestAndWait(names); Iterator<TaskPromptSetName> it = names.iterator(); while (it.hasNext()) { TaskPromptSetName promptName = (TaskPromptSetName) it.next(); if( promptName.getName().getName().compareTo("JOBS.FTP.LS") == 0 ) { prompt = new TaskPromptSetContent(promptName, runID); connection.sendRequestAndWait(prompt); prompt.ocvValues().changeValue("prompt_0_sourceDir", "/bin"); SubmitPrompt sumbit = new SubmitPrompt(names, prompt); connection.sendRequestAndWait(sumbit); break; } }
  • Constructor Details

    • TaskPromptSetContent

      @Deprecated public TaskPromptSetContent(UC4ObjectName promptSetName, int runID)
      Deprecated.
      Use the constructor TaskPromptSetContent(TaskPromptSetName promptSetName, int runID) instead.

      Creates a request to get the content of a PromptSet for execution.

      Parameters:
      promptSetName - Name of the PromptSet
      runID - RunID of the task
    • TaskPromptSetContent

      public TaskPromptSetContent(PromptSet promptSet)
      Preview of a prompt set object.
      Parameters:
      promptSet - Prompt Set
    • TaskPromptSetContent

      public TaskPromptSetContent(TaskPromptSetName promptSetName, int runID)
      Creates a request to get the content of a PromptSet for execution.
      Parameters:
      promptSetName - Name of the PromptSet
      runID - RunID of the task
    • TaskPromptSetContent

      @Deprecated public TaskPromptSetContent(PromptSetDefinition promptSetDef)
      Deprecated.
      Use TaskPromptSetContent(PromptSetDefinition promptSetDef, UC4Object obj) instead
      Creates a request to get the content of a PromptSet of a JOBP task.
      Parameters:
      promptSetDef - Prompt Set definition
    • TaskPromptSetContent

      public TaskPromptSetContent(PromptSetDefinition promptSetDef, UC4Object obj)
      Creates a request to get the content of a PromptSet of an object.
      Parameters:
      promptSetDef - Prompt Set definition
      obj - UC4 Object
    • TaskPromptSetContent

      public TaskPromptSetContent(PromptSetDefinition promptSetDef, String idnr)
      Creates a request to get the content of a PromptSet of an object.
      Parameters:
      promptSetDef - Prompt Set definition
      idnr - the idnr of the object to be requested
    • TaskPromptSetContent

      public TaskPromptSetContent(PromptSetDefinition promptSetDef, ITaskItem task)
      Creates a request to get the content of a PromptSet of a JOBP task.
      Parameters:
      promptSetDef - Prompt Set definition
      task - Workflow task
    • TaskPromptSetContent

      public TaskPromptSetContent(PromptSetDefinition promptSetDef, JobPlanMonitor.Task task)
      Creates a request to get the content of a PromptSet of a JOBP task that was executed.
      Parameters:
      promptSetDef - Prompt Set definition
      task - The JobPlanMonitor task
    • TaskPromptSetContent

      public TaskPromptSetContent(UC4ObjectName promptSetName, ITaskItem task)
      Creates a request to get the content of a PromptSet of a JOBP task.
      Parameters:
      promptSetName - Name of the promptSet
      task - Workflow task
    • TaskPromptSetContent

      public TaskPromptSetContent(TaskPromptSetContent original, PromptSetDefinition def)
      Clone the given original TaskPromptSetContent for the given task, and using the given PromptSetDefinition
  • Method Details

    • createRequest

      protected void createRequest(com.uc4.util.XMLDocument doc, 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
    • 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
    • applyMissingDefinitions

      public void applyMissingDefinitions()
      Elements missing in the promptset definition, but present in the prompt will be added
      Parameters:
      promptsElements2 -
    • getRaAgentName

      public UC4HostName getRaAgentName()
      Returns the name of the Agent if this is an RA panel.
      Returns:
      Name of the Agent or an empty UC4HostName instance, never null
    • getRaJobtype

      public String getRaJobtype()
      Returns the job type if this is an RA panel. Otherwise null is returned.
      Returns:
      Job type or null if this is not an RA panel
    • getRaSubtype

      public String getRaSubtype()
      Returns the sub type of the Job if this is an RA panel. Otherwise null is returned.
      Returns:
      RA Job sub type or null if this is not an RA panel
    • getRaCaption

      public String getRaCaption()
      Returns the caption of the tab if this is an RA prompt.
      Returns:
      Caption or null if this is not an RA panel
    • iterator

      public Iterator<PromptElement> iterator()
      The returned Iterator can be used to set values of PromptElements the execution of an executable object. After all values are set (the method setValue() has been called for all PromptElements which are returned by this Iterator) the request SubmitPrompt is used to send the values to the Automation Engine. It is not possible to remove PromptElements by using the Iterator.remove() method. An Exception will be thrown in this case.
      Specified by:
      iterator in interface Iterable<PromptElement>
      Returns:
      Iterator over PromptElement
    • getText

      public String getText()
      Returns the caption of the prompt set.
      Returns:
      Caption
    • ocvValues

      public OCVPanel ocvValues()
      This method provides access to the RA Job values. If this Prompt is not a RA prompt the return value is null.
      Returns:
      Values or null if this prompt has not the type "RA"
    • getPromptSetName

      public UC4ObjectName getPromptSetName()
      Returns the name of the PromptSet.
      Returns:
      Name of the PromptSet
    • getPromptSetDef

      public PromptSetDefinition getPromptSetDef()
      Returns the definition of the PromptSet.
      Returns:
      PromptSetDefinition of the PromptSet
    • size

      public int size()
      Returns the number of PromptElements.
      Returns:
      Number of Prompt
    • getType

      public String getType()
      Returns the type of this prompt. If "RA" is returned the method ocvValues() can be used to read and modify values.
      Returns:
      "PROMPTSET" or "RA"
    • getPromptSetID

      public String getPromptSetID()
      Returns:
      ID of the PromptSet
    • getSrc

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

      protected boolean isAllowedInClientZero()
      Description copied from class: XMLRequest
      This method is used internally. Tests if this XMLRequest is allowed in client 0. The default implementation returns false, subclasses may override.
      Overrides:
      isAllowedInClientZero in class XMLRequest
      Returns:
      true if this request is allowed in client 0, false otherwise
    • getTaskIdnr

      public String getTaskIdnr()
    • getTaskSrc

      public String getTaskSrc()