Receive messages for Storage Unit Status changes
Fix logic in updateStorageUnitStatus helper method
@@ -140,12 +140,12 @@ public class StorageUnitDaoHelper
*/
public void updateStorageUnitStatus(StorageUnitEntity storageUnitEntity, StorageUnitStatusEntity storageUnitStatusEntity, String reason)
{
- // Update the entity with the new values.
- storageUnitEntity.setStatus(storageUnitStatusEntity);
-
// Save the current status value.
String oldStatus = storageUnitEntity.getStatus().getCode();
+ // Update the entity with the new values.
+ storageUnitEntity.setStatus(storageUnitStatusEntity);
+
// Add an entry to the storage unit status history table.
StorageUnitStatusHistoryEntity storageUnitStatusHistoryEntity = new StorageUnitStatusHistoryEntity();
storageUnitEntity.getHistoricalStatuses().add(storageUnitStatusHistoryEntity);
