Interface MessageContainer


public interface MessageContainer
Container populated with error messages by the validate or onSave methods in a smart service class that extends AppianSmartService. If the MessageContainer contains any error messages, the process execution layer will prevent the activity from executing and display the validation messages added using addError.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addError(String acpKey, String messageKey, Object... messageValues)
    Add an error to the container.
    Gives the error messages that were added to the container as a single string with "[" and "]" delineating the messages.
    boolean
    Called by the process execution layer to determine if there are any validation errors that would prevent the smart service's run method from executing.
  • Method Details

    • addError

      void addError(String acpKey, String messageKey, Object... messageValues)
      Add an error to the container. Doing so will cause the smart service's run method to not be executed and will return the error messages to the user in the form (for attended nodes) or sent via alert for unattended nodes.
      Parameters:
      acpKey - the name of the ACP associated with the validation error. All errors must be associated with an ACP.
      messageKey - the key to the error message in the bundle
      messageValues - the parameters to be used with the message bundle to create the full message.
    • isEmpty

      boolean isEmpty()
      Called by the process execution layer to determine if there are any validation errors that would prevent the smart service's run method from executing.
      Returns:
      whether or not errors have been added to the container
    • getErrorMessage

      String getErrorMessage()
      Gives the error messages that were added to the container as a single string with "[" and "]" delineating the messages. Used by the process execution layer to create the message part of the error alert.
      Returns:
      a String representation of all errors added to the container