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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic UsersConfigRecordempty()Creates an empty UsersConfigRecord with all null/empty values.final booleanIndicates whether some other object is "equal to" this one.static UsersConfigRecordfromUsersNode(com.fasterxml.jackson.databind.JsonNode usersNode, org.slf4j.Logger logger) Parses a "users" JsonNode and creates a UsersConfigRecord.Gets the membersShipsInput as an Optional.Gets the stepManager as an Optional.Gets the stepUser as an Optional.booleanChecks if this configuration has any user source defined.final inthashCode()Returns a hash code value for this object.booleanChecks if this configuration has any static memberships.booleanChecks if this configuration has a dynamic membership input reference.booleanChecks if this configuration has any step manager reference.booleanChecks if this configuration has any step user reference.Returns the value of thememberShipsrecord component.Returns the value of themembersShipsInputrecord component.Parses the membersShipsInput into a StepFieldRef.Returns the value of thestepManagerrecord component.stepUser()Returns the value of thestepUserrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
USERS_KEY
JSON key for the users node.- See Also:
-
STEP_USER_KEY
JSON key for stepUser.- See Also:
-
STEP_MANAGER_KEY
JSON key for stepManager.- See Also:
-
MEMBERSHIPS_KEY
JSON key for memberShips.- See Also:
-
MEMBERSHIPS_INPUT_KEY
JSON key for membersShipsInput.- See Also:
-
-
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 referencestepManager- The step manager referencememberShips- The list of membership referencesmembersShipsInput- The dynamic membership input reference
-
-
Method Details
-
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
Gets the stepUser as an Optional.- Returns:
- Optional containing the stepUser, or empty if not defined
-
getStepManagerOptional
Gets the stepManager as an Optional.- Returns:
- Optional containing the stepManager, or empty if not defined
-
getMembersShipsInputOptional
Gets the membersShipsInput as an Optional.- Returns:
- Optional containing the membersShipsInput, or empty if not defined
-
parseMembersShipsInput
Parses the membersShipsInput into a StepFieldRef.- Returns:
- Optional containing the parsed StepFieldRef, or empty if not defined or invalid format
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
stepUser
Returns the value of thestepUserrecord component.- Returns:
- the value of the
stepUserrecord component
-
stepManager
Returns the value of thestepManagerrecord component.- Returns:
- the value of the
stepManagerrecord component
-
memberShips
Returns the value of thememberShipsrecord component.- Returns:
- the value of the
memberShipsrecord component
-
membersShipsInput
Returns the value of themembersShipsInputrecord component.- Returns:
- the value of the
membersShipsInputrecord component
-