Package org.openwms.tms
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 Summary
FieldsModifier and TypeFieldDescriptionprivate DateDate when theTransportOrderended.private PriorityLevelA priority level of theTransportOrder.private MessageLast reported problem on theTransportOrder.private StringThe sourceLocationof theTransportOrder.
This property is set before theTransportOrderwas started.private DateDate when theTransportOrderwas started.private TransportOrderStateState of theTransportOrder.private StringThe targetLocationof theTransportOrder.
This property is set before theTransportOrderwas started.private @NotEmpty(groups=ValidateBKAndTarget.class) StringALocationGroupcan also be set as target.private @Min(value=1L,groups=ValidateBKAndTarget.class) StringThe bk of theTransportUnitto be moved by thisTransportOrder.Fields inherited from class org.ameba.integration.jpa.ApplicationEntity
C_ID -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDear JPA...TransportOrder(String transportUnitBK) Create a TransportOrder with the given TransportUnit's business key. -
Method Summary
Modifier and TypeMethodDescriptionchangeState(StateManager stateManager, TransportOrderState newState) Change the state of theTransportOrderregarding some rules.booleanAll fields.Get the endDate.Returns the priority level of theTransportOrder.Get the lastMessage.Get the sourceLocation.Returns the date when theTransportOrderwas started.getState()Returns the state of theTransportOrder.Get the targetLocationof thisTransportOrder.Get the targetLocationGroup.Get theTransportUnitassigned to theTransportOrder.inthashCode()All fields.booleanCheck whether a problem was reported on this TO.(package private) booleanhasTargetChanged(TransportOrder transportOrder) Check whether one of the targets has changed between this TransportOrder and the one passed astransportOrder.booleanbooleanbooleanCheck whether thisTransportOrderhas aTransportUnit's business key set.voidsetEndDate(Date endDate) Set the date when the TransportOrder has been deactivated for processing.voidsetPersistentKey(String pKey) voidsetPriority(PriorityLevel priority) Set the priority level of theTransportOrder.setProblem(Message problem) Set the lastMessage.setSourceLocation(String sourceLocation) Set the sourceLocation.voidsetStartDate(Date startDate) Set the date when the TransportOrder has been activated for processing.voidsetState(TransportOrderState state) Used for MapStruct only.setTargetLocation(String targetLocation) Set the targetLocationof thisTransportOrder.setTargetLocationGroup(String targetLocationGroup) Set the targetLocationGroup.voidsetTransportUnitBK(String transportUnitBK) Assign aTransportUnitto theTransportOrder.toString()All fields.Methods inherited from class org.ameba.integration.jpa.ApplicationEntity
getPersistentKey, hasPersistentKey, onEntityPersist, onPersistMethods inherited from class org.ameba.integration.jpa.BaseEntity
getCreatedBy, getCreateDt, getLastModifiedBy, getLastModifiedDt, getOl, getPk, isNew, setCreatedBy, setCreateDt, setLastModifiedBy, setLastModifiedDt, setOl
-
Field Details
-
transportUnitBK
@Min(value=1L, groups=ValidateBKAndTarget.class) private @Min(value=1L,groups=ValidateBKAndTarget.class) String transportUnitBKThe bk of theTransportUnitto be moved by thisTransportOrder. Allowed to be null to keepTransportOrders withoutTransportUnits. -
priority
A priority level of theTransportOrder. The lower the value the lower the priority.
The priority level affects the execution of theTransportOrder. An order with high priority will be processed faster than those with lower priority. -
startDate
Date when theTransportOrderwas started. -
problem
Last reported problem on theTransportOrder. -
endDate
Date when theTransportOrderended. -
state
State of theTransportOrder. -
sourceLocation
The sourceLocationof theTransportOrder.
This property is set before theTransportOrderwas started. -
targetLocation
The targetLocationof theTransportOrder.
This property is set before theTransportOrderwas started. -
targetLocationGroup
@NotEmpty(groups=ValidateBKAndTarget.class) private @NotEmpty(groups=ValidateBKAndTarget.class) String targetLocationGroupALocationGroupcan also be set as target. At least one target must be set when theTransportOrderis being started.
-
-
Constructor Details
-
TransportOrder
protected TransportOrder()Dear JPA... -
TransportOrder
Create a TransportOrder with the given TransportUnit's business key.- Parameters:
transportUnitBK- TransportUnit business key
-
-
Method Details
-
setPersistentKey
- Overrides:
setPersistentKeyin classorg.ameba.integration.jpa.ApplicationEntity
-
getPriority
Returns the priority level of theTransportOrder.- Returns:
- The priority
-
setPriority
Set the priority level of theTransportOrder.- Parameters:
priority- The priority to set
-
getStartDate
Returns the date when theTransportOrderwas started.- Returns:
- The date when started
-
setStartDate
Set the date when the TransportOrder has been activated for processing.- Parameters:
startDate- The start date
-
getTransportUnitBK
Get theTransportUnitassigned to theTransportOrder.- Returns:
- The business key of the assigned
TransportUnit
-
setTransportUnitBK
Assign aTransportUnitto theTransportOrder. Setting theTransportUnitto null is allowed here to unlink both.- Parameters:
transportUnitBK- The business key of theTransportUnitto be assigned
-
hasTransportUnitBK
public boolean hasTransportUnitBK()Check whether thisTransportOrderhas aTransportUnit's business key set.- Returns:
trueif a the business key is assigne
-
getState
Returns the state of theTransportOrder.- Returns:
- The state of the order
-
setState
Used for MapStruct only.- Parameters:
state- The state to set
-
changeState
Change the state of theTransportOrderregarding some rules.- Parameters:
newState- The new state of the order- Returns:
- The modified instance
- Throws:
StateChangeException- in case- the newState is null or
- the newState is less than the old state or
- the
TransportOrderis in stateTransportOrderState.CREATEDand shall be manually turned into something else thenTransportOrderState.INITIALIZEDorTransportOrderState.CANCELED - the
TransportOrderisTransportOrderState.CREATEDand shall beTransportOrderState.INITIALIZEDbut it is incomplete
-
getTargetLocation
Get the targetLocationof thisTransportOrder.- Returns:
- The targetLocation if any, otherwise null
-
hasTargetLocation
public boolean hasTargetLocation() -
setTargetLocation
Set the targetLocationof thisTransportOrder.- Parameters:
targetLocation- The location to move on- Returns:
- this
-
getTargetLocationGroup
Get the targetLocationGroup.- Returns:
- The targetLocationGroup if any, otherwise null
-
hasTargetLocationGroup
public boolean hasTargetLocationGroup() -
setTargetLocationGroup
Set the targetLocationGroup.- Parameters:
targetLocationGroup- The targetLocationGroup to set.- Returns:
- this
-
getProblem
Get the lastMessage.- Returns:
- The last problem.
-
setProblem
Set the lastMessage.- Parameters:
problem- TheMessageto set.- Returns:
- this
-
getEndDate
Get the endDate.- Returns:
- The date the order ended
-
setEndDate
Set the date when the TransportOrder has been deactivated for processing.- Parameters:
endDate- The end date
-
getSourceLocation
Get the sourceLocation.- Returns:
- The sourceLocation
-
setSourceLocation
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
Check whether one of the targets has changed between this TransportOrder and the one passed astransportOrder.- Parameters:
transportOrder- The TransportOrder to verify against- Returns:
- true if targets has changed, otherwise false
-
equals
All fields.- Overrides:
equalsin classorg.ameba.integration.jpa.ApplicationEntity
-
hashCode
public int hashCode()All fields.- Overrides:
hashCodein classorg.ameba.integration.jpa.ApplicationEntity
-
toString
All fields.
-