Class TransportOrder

java.lang.Object
org.ameba.integration.jpa.BaseEntity
org.ameba.integration.jpa.ApplicationEntity
org.openwms.tms.TransportOrder
All Implemented Interfaces:
Serializable, org.ameba.integration.TypedEntity<Long>

@Entity public class TransportOrder extends org.ameba.integration.jpa.ApplicationEntity implements Serializable
A TransportOrder is used to move TransportUnits from the current Location to another target (Location).
Author:
Heiko Scherrer
See Also:
  • Field Details

    • transportUnitBK

      @Min(value=1L, groups=ValidateBKAndTarget.class) private @Min(value=1L,groups=ValidateBKAndTarget.class) String transportUnitBK
      The bk of the TransportUnit to be moved by this TransportOrder. Allowed to be null to keep TransportOrders without TransportUnits.
    • priority

      private PriorityLevel priority
      A priority level of the TransportOrder. The lower the value the lower the priority.
      The priority level affects the execution of the TransportOrder. An order with high priority will be processed faster than those with lower priority.
    • startDate

      private Date startDate
      Date when the TransportOrder was started.
    • problem

      private Message problem
      Last reported problem on the TransportOrder.
    • endDate

      private Date endDate
      Date when the TransportOrder ended.
    • state

      private TransportOrderState state
      State of the TransportOrder.
    • sourceLocation

      private String sourceLocation
      The source Location of the TransportOrder.
      This property is set before the TransportOrder was started.
    • targetLocation

      private String targetLocation
      The target Location of the TransportOrder.
      This property is set before the TransportOrder was started.
    • targetLocationGroup

      @NotEmpty(groups=ValidateBKAndTarget.class) private @NotEmpty(groups=ValidateBKAndTarget.class) String targetLocationGroup
      A LocationGroup can also be set as target. At least one target must be set when the TransportOrder is being started.
  • Constructor Details

    • TransportOrder

      protected TransportOrder()
      Dear JPA...
    • TransportOrder

      public TransportOrder(String transportUnitBK)
      Create a TransportOrder with the given TransportUnit's business key.
      Parameters:
      transportUnitBK - TransportUnit business key
  • Method Details

    • setPersistentKey

      public void setPersistentKey(String pKey)
      Overrides:
      setPersistentKey in class org.ameba.integration.jpa.ApplicationEntity
    • getPriority

      public PriorityLevel getPriority()
      Returns the priority level of the TransportOrder.
      Returns:
      The priority
    • setPriority

      public void setPriority(PriorityLevel priority)
      Set the priority level of the TransportOrder.
      Parameters:
      priority - The priority to set
    • getStartDate

      public Date getStartDate()
      Returns the date when the TransportOrder was started.
      Returns:
      The date when started
    • setStartDate

      public void setStartDate(Date startDate)
      Set the date when the TransportOrder has been activated for processing.
      Parameters:
      startDate - The start date
    • getTransportUnitBK

      public String getTransportUnitBK()
      Get the TransportUnit assigned to the TransportOrder .
      Returns:
      The business key of the assigned TransportUnit
    • setTransportUnitBK

      public void setTransportUnitBK(String transportUnitBK)
      Assign a TransportUnit to the TransportOrder. Setting the TransportUnit to null is allowed here to unlink both.
      Parameters:
      transportUnitBK - The business key of the TransportUnit to be assigned
    • hasTransportUnitBK

      public boolean hasTransportUnitBK()
      Check whether this TransportOrder has a TransportUnit's business key set.
      Returns:
      true if a the business key is assigne
    • getState

      public TransportOrderState getState()
      Returns the state of the TransportOrder.
      Returns:
      The state of the order
    • setState

      public void setState(TransportOrderState state)
      Used for MapStruct only.
      Parameters:
      state - The state to set
    • changeState

      public TransportOrder changeState(StateManager stateManager, TransportOrderState newState)
      Change the state of the TransportOrder regarding some rules.
      Parameters:
      newState - The new state of the order
      Returns:
      The modified instance
      Throws:
      StateChangeException - in case
    • getTargetLocation

      public String getTargetLocation()
      Get the target Location of this TransportOrder.
      Returns:
      The targetLocation if any, otherwise null
    • hasTargetLocation

      public boolean hasTargetLocation()
    • setTargetLocation

      public TransportOrder setTargetLocation(String targetLocation)
      Set the target Location of this TransportOrder.
      Parameters:
      targetLocation - The location to move on
      Returns:
      this
    • getTargetLocationGroup

      public String getTargetLocationGroup()
      Get the targetLocationGroup.
      Returns:
      The targetLocationGroup if any, otherwise null
    • hasTargetLocationGroup

      public boolean hasTargetLocationGroup()
    • setTargetLocationGroup

      public TransportOrder setTargetLocationGroup(String targetLocationGroup)
      Set the targetLocationGroup.
      Parameters:
      targetLocationGroup - The targetLocationGroup to set.
      Returns:
      this
    • getProblem

      public Message getProblem()
      Get the last Message.
      Returns:
      The last problem.
    • setProblem

      public TransportOrder setProblem(Message problem)
      Set the last Message.
      Parameters:
      problem - The Message to set.
      Returns:
      this
    • getEndDate

      public Date getEndDate()
      Get the endDate.
      Returns:
      The date the order ended
    • setEndDate

      public void setEndDate(Date endDate)
      Set the date when the TransportOrder has been deactivated for processing.
      Parameters:
      endDate - The end date
    • getSourceLocation

      public String getSourceLocation()
      Get the sourceLocation.
      Returns:
      The sourceLocation
    • setSourceLocation

      public TransportOrder setSourceLocation(String sourceLocation)
      Set the sourceLocation.
      Parameters:
      sourceLocation - The sourceLocation to set
      Returns:
      this
    • hasProblem

      public boolean hasProblem()
      Check whether a problem was reported on this TO.
      Returns:
      true if so, otherwise false
    • hasTargetChanged

      boolean hasTargetChanged(TransportOrder transportOrder)
      Check whether one of the targets has changed between this TransportOrder and the one passed as transportOrder.
      Parameters:
      transportOrder - The TransportOrder to verify against
      Returns:
      true if targets has changed, otherwise false
    • equals

      public boolean equals(Object o)
      All fields.
      Overrides:
      equals in class org.ameba.integration.jpa.ApplicationEntity
    • hashCode

      public int hashCode()
      All fields.
      Overrides:
      hashCode in class org.ameba.integration.jpa.ApplicationEntity
    • toString

      public String toString()
      All fields.
      Overrides:
      toString in class Object