Class PromptSetDefinition

java.lang.Object
com.uc4.api.objects.PromptSetDefinition

public class PromptSetDefinition extends Object
This class is created using the request com.uc4.communication.AddPromptSet An instance of this class can be added to executable Objects (for example Jobs) and default values for PromptElements can be set.
  • Constructor Details

    • PromptSetDefinition

      public PromptSetDefinition(Element doc)
      Internal use.
      Parameters:
      doc - XML document
    • PromptSetDefinition

      public PromptSetDefinition(PromptSetDefinition promptSetDefinition)
      This constructor is required for creating a copy of the PromptSetDefinition.
      Parameters:
      promptSetDefinition - PromptSetDefinition
  • Method Details

    • getName

      public UC4ObjectName getName()
      Returns:
      Name of the PromptSet object
    • getId

      public String getId()
      Returns:
      ID of the PromptSet object
    • getElementIDs

      public String[] getElementIDs()
      Returns an array of Prompt element IDs.
      Returns:
      Array of IDs
    • setValue

      public void setValue(String elementID, String value)
      Sets a value for the specified prompt element.
      Parameters:
      elementID - ID of the element
      value - Value
    • setPasswordValue

      public void setPasswordValue(String elementID, String value)
      Sets a value for the specified prompt element and encrypts it. This method should be used if the "Show as password" property is set.
      Parameters:
      elementID - ID of the element
      value - Value
    • setAlternativeValue

      public void setAlternativeValue(String elementID, String value)
      Sets a value for the specified prompt element. It should be used if the default value of a Prompt element is a script variable. Use the getValue() method to read the result back.
      Parameters:
      elementID - ID of the element
      value - Value
    • setValues

      public void setValues(String elementID, String[] values)
      Sets values as an array for the specified prompt element.
      Parameters:
      elementID - ID of the element
      values - Array of values
    • resetPromptValue

      public void resetPromptValue(String elementID)
      Sets values of the element to use the default. will not be saved and default in parent will be used. If you need to save it, call setValue afterwards again and the value will be overwritten
      Parameters:
      elementID - ID of the element
    • getReadFromTable

      public PromptSetDefinition.PromptElementTable getReadFromTable(String elementID)
      Returns the table the value is currently stored in
      Parameters:
      elementID - ID of the element
      Returns:
      the PromptSetDefinition.PromptElementTable of the table the value is read from, or null if none found
      Throws:
      IllegalArgumentException - if the value is not registered in the PromptSetDefinition.PromptElementTable enum.
    • setReadFromTable

      public void setReadFromTable(String elementID, PromptSetDefinition.PromptElementTable table)
    • getReadFromTableName

      public String getReadFromTableName(String elementID)
      Returns the raw string name of the table the value is currently stored in
      Parameters:
      elementID - ID of the element
      Returns:
      the String value of the table the value is read from, or null if none was returned from backend
      Throws:
      NullPointerException - in case the element is not contained
    • hasAlternativeView

      public boolean hasAlternativeView(String elementID)
      Returns true if the value of the specified prompt element is shown in an alternative view. In this case the User Interface shows a text field instead of a control corresponding to the type (check box, time control, ...) The text field can be used to enter the name of a Script variable (for example &MYVARIABLE1).
      Parameters:
      elementID - ID of the element
      Returns:
      Alternative view enabled?
    • getValue

      public String getValue(String elementID)
      Returns the value of the specified ID.
      Parameters:
      elementID - ID of the element
      Returns:
      Value
    • getValues

      public String[] getValues(String elementID)
      Returns the values of the specified ID.
      Parameters:
      elementID - ID of the element
      Returns:
      Array of values
    • hasList

      public boolean hasList(String elementID)
      Returns true if the the specified ID contains an array of values otherwise false.
      Parameters:
      elementID - the ID of the element
      Returns:
      true/false
    • store

      protected void store(com.uc4.util.XMLDocument doc, Element tree)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • isDirty

      public boolean isDirty(String elementID)
      Is the given element dirty (changed by user before saving)