Class PromptQueryActionViewModel

java.lang.Object
de.xima.fc.workflow.designer.model.prompt_query.PromptQueryActionViewModel
All Implemented Interfaces:
Serializable

public final class PromptQueryActionViewModel extends Object implements Serializable
View model for the prompt query workflow action configuration UI.
Since:
8.5.0
See Also:
  • Constructor Details

    • PromptQueryActionViewModel

      public PromptQueryActionViewModel(String error)
      Creates a new view model for the prompt query action configuration UI; when an error occurred.
    • PromptQueryActionViewModel

      public PromptQueryActionViewModel(ValueDescriptorFormModel jsonPropertiesForm, List<FileControl<?>> fileControls, boolean producesFiles)
      Creates a new view model for the prompt query action configuration UI; when the configuration could be loaded successfully.
      Parameters:
      jsonPropertiesForm - The dynamic form model for the JSON input parameters of the selected prompt query.
      fileControls - The controls for editing the file parameters.
      producesFiles - Whether the selected prompt query produces file outputs.
  • Method Details

    • getError

      public String getError()
      Gets the error message if an error occurred while loading the configuration for the selected prompt query.
      Returns:
      The error message, or null if no error occurred.
    • getFileControls

      public List<FileControl<?>> getFileControls()
      Gets the file controls for the file inputs.
      Returns:
      The list of file controls.
    • getJsonPropertiesForm

      public ValueDescriptorFormModel getJsonPropertiesForm()
      Gets the dynamic form model for the JSON input parameters of the selected prompt query. Each prompt query may have a different set of input parameters. This dynamic form model reflects the structure of those parameters.
      Returns:
      The dynamic form model for the input parameters.
    • isHasError

      public boolean isHasError()
      Whether this model represents a prompt query that could not be loaded correctly. An error usually occurs due to a missing plugin or an error in the plugin that handles the prompt query. When this returns true, getJsonPropertiesForm() and other methods will return empty or null values. Use getError() to get the error message.
      Returns:
      true if there is an error, false otherwise.
    • isProducesFiles

      public boolean isProducesFiles()
      Whether the currently selected prompt query produces file outputs.
      Returns:
      true if the prompt query produces file outputs, false otherwise.