@Override public String execute(final ConsignmentProcessModel process) { final ConsignmentModel consignment = process.getConsignment(); if (consignment != null) { consignment.setStatus(ConsignmentStatus.PICKUP_COMPLETE); getModelService().save(consignment); return Transition.OK.toString(); } LOG.error("Process has no consignment"); return Transition.ERROR.toString(); }
@Override public String execute(final ConsignmentProcessModel process) { final ConsignmentModel consignment = process.getConsignment(); if (consignment != null) { try { // Check if the Order is Cancelled if (OrderStatus.CANCELLED.equals(consignment.getOrder().getStatus()) || OrderStatus.CANCELLING.equals(consignment.getOrder().getStatus())) { return Transition.CANCEL.toString(); } else { getProcess2WarehouseAdapter().shipConsignment(process.getConsignment()); if (consignment.getDeliveryMode() instanceof PickUpDeliveryModeModel) { return Transition.PICKUP.toString(); } else { return Transition.DELIVERY.toString(); } } } catch (final Exception e) { return Transition.ERROR.toString(); } } return Transition.ERROR.toString(); }