Class JoinId

java.lang.Object
com.yworkflow.definition.model.value.JoinId
All Implemented Interfaces:
DestinationId, ModelId

public class JoinId extends Object implements DestinationId
Represents a unique identifier for a workflow join. JoinId is an immutable value object that identifies a specific join operation within a workflow definition.

JoinId implements the DestinationId interface, making it suitable for use as a destination in workflow transitions. It supports both a value (required) and an optional name for human-readable identification.

Joins are used to synchronize multiple parallel workflow paths by waiting for all incoming active states to complete their transitions before activating the resulting state. Each join must have a unique identifier within the workflow definition.

Since:
1.0
See Also:
  • Method Details

    • getValue

      public String getValue()
      Returns the string value of this join ID.
      Specified by:
      getValue in interface DestinationId
      Specified by:
      getValue in interface ModelId
      Returns:
      the join identifier string
    • getName

      public Optional<String> getName()
      Returns the optional human-readable name of this join.
      Specified by:
      getName in interface DestinationId
      Returns:
      an Optional containing the name if present, empty otherwise
    • isJoinId

      public boolean isJoinId()
      Returns true since this is a JoinId.
      Specified by:
      isJoinId in interface DestinationId
      Returns:
      always true
    • joinId

      public static JoinId joinId(String value)
      Creates a new JoinId with the specified value and no name.
      Parameters:
      value - the join identifier string
      Returns:
      a new JoinId instance
      Throws:
      IllegalArgumentException - if the value is invalid
    • joinId

      public static JoinId joinId(String value, String name)
      Creates a new JoinId with the specified value and name.
      Parameters:
      value - the join identifier string
      name - the optional human-readable name
      Returns:
      a new JoinId instance
      Throws:
      IllegalArgumentException - if the value is invalid
    • name

      public JoinId name(String name)
      Creates a new JoinId with the same value but a different name.
      Parameters:
      name - the new name for this join ID
      Returns:
      a new JoinId instance with the specified name
    • equals

      public boolean equals(Object object)
      Compares this JoinId with another object for equality. Two JoinId instances are equal if they have the same string value.
      Overrides:
      equals in class Object
      Parameters:
      object - the object to compare with
      Returns:
      true if the objects are equal, false otherwise
    • hashCode

      public int hashCode()
      Returns the hash code for this JoinId based on its string value.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code for this JoinId
    • toString

      public String toString()
      Returns a string representation of this JoinId.
      Overrides:
      toString in class Object
      Returns:
      a string representation including the ID