Record Class MigrationTargets

java.lang.Object
java.lang.Record
com.axelor.workflow.migrate.MigrationTargets
Record Components:
nodes - the parkable nodes of the target plan this position may move to, in graph order
canCancel - whether Cancel is offered; always true
canEnd - whether the synthetic End target is offered; never on a branch
cancelEndsWholeRun - true on a branch, where cancelling takes down the fork and its siblings
blockedReason - why nodes is empty, or null

public record MigrationTargets(List<MigrationTargets.TargetNode> nodes, boolean canCancel, boolean canEnd, boolean cancelEndsWholeRun, String blockedReason) extends Record
Where one position may go on a chosen revision, and what else may be done to it. Apply re-checks requests against the same code.
  • Constructor Details

    • MigrationTargets

      public MigrationTargets(List<MigrationTargets.TargetNode> nodes, boolean canCancel, boolean canEnd, boolean cancelEndsWholeRun, String blockedReason)
      Creates an instance of a MigrationTargets record class.
      Parameters:
      nodes - the value for the nodes record component
      canCancel - the value for the canCancel record component
      canEnd - the value for the canEnd record component
      cancelEndsWholeRun - the value for the cancelEndsWholeRun record component
      blockedReason - the value for the blockedReason record component
  • Method Details

    • of

      public static MigrationTargets of(ParkedPosition position, WorkflowPlan target)
      The targets position has on target.
      Parameters:
      target - the chosen revision's plan, or null when it does not compile, which offers no targets
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • nodes

      Returns the value of the nodes record component.
      Returns:
      the value of the nodes record component
    • canCancel

      public boolean canCancel()
      Returns the value of the canCancel record component.
      Returns:
      the value of the canCancel record component
    • canEnd

      public boolean canEnd()
      Returns the value of the canEnd record component.
      Returns:
      the value of the canEnd record component
    • cancelEndsWholeRun

      public boolean cancelEndsWholeRun()
      Returns the value of the cancelEndsWholeRun record component.
      Returns:
      the value of the cancelEndsWholeRun record component
    • blockedReason

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