protected Transition executeAction(final OrderProcessModel process) { ServicesUtil.validateParameterNotNull(process, "Process cannot be null"); LOG.info("Process: " + process.getCode() + " in step " + getClass().getSimpleName()); final OrderModel order = process.getOrder(); ServicesUtil.validateParameterNotNull(order, "Order in process cannot be null"); ServicesUtil.validateParameterNotNull( order.getFraudulent(), "Fraudulent value in order cannot be null"); final OrderHistoryEntryModel historyLog = createHistoryLog("Order Manually checked by CSA - Fraud = " + order.getFraudulent(), order); modelService.save(historyLog); LOG.info( "The fraud condition of the order " + order.getCode() + " is " + order.getFraudulent().booleanValue()); if (order.getFraudulent().booleanValue()) { order.setStatus(OrderStatus.SUSPENDED); getModelService().save(order); return Transition.NOK; } else { order.setStatus(OrderStatus.FRAUD_CHECKED); getModelService().save(order); return Transition.OK; } }
protected Transition executeAction(final OrderProcessModel process) { ServicesUtil.validateParameterNotNull(process, "Process cannot be null"); final OrderModel order = process.getOrder(); ServicesUtil.validateParameterNotNull(order, "Order in process cannot be null"); if (order.getFraudulent() != null) { final OrderHistoryEntryModel historyLog = createHistoryLog( "Order Manually checked by CSA - Fraud = " + order.getFraudulent(), order); modelService.save(historyLog); if (order.getFraudulent().booleanValue()) { order.setStatus(OrderStatus.SUSPENDED); getModelService().save(order); return Transition.NOK; } return Transition.OK; } return Transition.UNDEFINED; }