Record Class UsersConfigRecord

java.lang.Object
java.lang.Record
com.bonitasoft.processbuilder.records.UsersConfigRecord
Record Components:
stepUser - Reference to a step whose executor becomes a candidate (nullable)
stepManager - Reference to a step whose executor's manager becomes a candidate (nullable)
memberShips - Static list of membership references defined in BDM (nullable)
membersShipsInput - Dynamic membership reference in format "step_xxx:field_yyy" (nullable)

public record UsersConfigRecord(String stepUser, String stepManager, List<String> memberShips, String membersShipsInput) extends Record
A record representing the user configuration for task assignation.

This record is parsed from a JSON structure with the following format:


 {
   "users": {
     "stepUser": "step_xxx",
     "stepManager": "step_yyy",
     "memberShips": ["membership_1", "membership_2"],
     "membersShipsInput": "step_zzz:field_www"
   }
 }
 

All fields are nullable, allowing flexible configuration for different task assignation scenarios.

Since:
1.0
Author:
Bonitasoft
  • Field Details

  • Constructor Details

    • UsersConfigRecord

      public UsersConfigRecord(String stepUser, String stepManager, List<String> memberShips, String membersShipsInput)
      Compact constructor ensuring memberShips is immutable.
      Parameters:
      stepUser - The step user reference
      stepManager - The step manager reference
      memberShips - The list of membership references
      membersShipsInput - The dynamic membership input reference
  • Method Details

    • empty

      public static UsersConfigRecord empty()
      Creates an empty UsersConfigRecord with all null/empty values.
      Returns:
      An empty UsersConfigRecord instance
    • fromUsersNode

      public static UsersConfigRecord fromUsersNode(com.fasterxml.jackson.databind.JsonNode usersNode, org.slf4j.Logger logger)
      Parses a "users" JsonNode and creates a UsersConfigRecord.

      This method extracts all user configuration fields from the provided JsonNode. Missing or null fields result in null/empty values in the record.

      Parameters:
      usersNode - The JsonNode containing the users configuration (nullable)
      logger - Logger for debug messages (nullable)
      Returns:
      A UsersConfigRecord with parsed values, or empty record if usersNode is null
    • hasStepUser

      public boolean hasStepUser()
      Checks if this configuration has any step user reference.
      Returns:
      true if stepUser is not null and not blank
    • hasStepManager

      public boolean hasStepManager()
      Checks if this configuration has any step manager reference.
      Returns:
      true if stepManager is not null and not blank
    • hasMemberShips

      public boolean hasMemberShips()
      Checks if this configuration has any static memberships.
      Returns:
      true if memberShips is not empty
    • hasMembersShipsInput

      public boolean hasMembersShipsInput()
      Checks if this configuration has a dynamic membership input reference.
      Returns:
      true if membersShipsInput is not null and not blank
    • hasAnySource

      public boolean hasAnySource()
      Checks if this configuration has any user source defined.
      Returns:
      true if any of stepUser, stepManager, memberShips, or membersShipsInput is defined
    • getStepUserOptional

      public Optional<String> getStepUserOptional()
      Gets the stepUser as an Optional.
      Returns:
      Optional containing the stepUser, or empty if not defined
    • getStepManagerOptional

      public Optional<String> getStepManagerOptional()
      Gets the stepManager as an Optional.
      Returns:
      Optional containing the stepManager, or empty if not defined
    • getMembersShipsInputOptional

      public Optional<String> getMembersShipsInputOptional()
      Gets the membersShipsInput as an Optional.
      Returns:
      Optional containing the membersShipsInput, or empty if not defined
    • parseMembersShipsInput

      public Optional<StepFieldRef> parseMembersShipsInput()
      Parses the membersShipsInput into a StepFieldRef.
      Returns:
      Optional containing the parsed StepFieldRef, or empty if not defined or invalid format
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • stepUser

      public String stepUser()
      Returns the value of the stepUser record component.
      Returns:
      the value of the stepUser record component
    • stepManager

      public String stepManager()
      Returns the value of the stepManager record component.
      Returns:
      the value of the stepManager record component
    • memberShips

      public List<String> memberShips()
      Returns the value of the memberShips record component.
      Returns:
      the value of the memberShips record component
    • membersShipsInput

      public String membersShipsInput()
      Returns the value of the membersShipsInput record component.
      Returns:
      the value of the membersShipsInput record component