Enum Class ActionType

java.lang.Object
java.lang.Enum<ActionType>
com.bonitasoft.processbuilder.enums.ActionType
All Implemented Interfaces:
Serializable, Comparable<ActionType>, Constable

public enum ActionType extends Enum<ActionType>
Represents the type of action to be performed on a business object.

This enum defines the valid actions (INSERT, UPDATE, DELETE) and provides validation logic for each based on the presence and format of a persistence ID. This approach centralizes business rules, making the code more robust and easier to maintain.

  • Enum Constant Details

    • INSERT

      public static final ActionType INSERT
      Represents the creation of a new business object.

      For an INSERT action, a valid persistence ID string must be empty.

    • UPDATE

      public static final ActionType UPDATE
      Represents the modification of an existing business object.

      For an UPDATE action, a valid persistence ID string must be non-empty and contain only digits.

    • DELETE

      public static final ActionType DELETE
      Represents the deletion of an existing business object.

      For a DELETE action, a valid persistence ID string must be non-empty and contain only digits.

  • Method Details

    • values

      public static ActionType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ActionType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getKey

      public String getKey()
      Returns the unique string key associated with this criticality type.
      Returns:
      The criticality key (e.g., "High").
    • getDescription

      public String getDescription()
      Returns the business description of this criticality type.
      Returns:
      The description.
    • isValid

      public abstract boolean isValid(String persistenceId)
      Validates a persistence ID string against the requirements of the specific action type.
      Parameters:
      persistenceId - The string representation of the business object's persistence ID.
      Returns:
      true if the persistence ID is valid for the current action type, otherwise false.
    • getAllData

      public static Map<String,String> getAllData()
      Retrieves all process instance states as a read-only Map where the key is the technical key and the value is the description.
      Returns:
      A map containing all process state data (Key -> Description).
    • getAllKeysList

      public static List<String> getAllKeysList()
      Retrieves all technical keys as a read-only List of Strings.
      Returns:
      A list containing all technical keys.