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;
    }
  }
 @Override
 protected boolean shouldHandleEvent(final OrderCancelledEvent event) {
   final OrderModel order = event.getProcess().getOrder();
   ServicesUtil.validateParameterNotNullStandardMessage("event.order", order);
   final BaseSiteModel site = order.getSite();
   ServicesUtil.validateParameterNotNullStandardMessage("event.order.site", site);
   return SiteChannel.B2C.equals(site.getChannel());
 }
 @Override
 protected boolean shouldHandleEvent(final SendReadyForPickupMessageEvent event) {
   final AbstractOrderModel order = event.getProcess().getConsignment().getOrder();
   ServicesUtil.validateParameterNotNullStandardMessage("event.order", order);
   final BaseSiteModel site = order.getSite();
   ServicesUtil.validateParameterNotNullStandardMessage("event.order.site", site);
   return SiteChannel.TELCO.equals(site.getChannel());
 }
  @Override
  public Transition executeAction(final OrderProcessModel process) {
    LOG.info("Process: " + process.getCode() + " in step " + getClass());
    ServicesUtil.validateParameterNotNull(process, "Process can not be null");
    ServicesUtil.validateParameterNotNull(process.getOrder(), "Order can not be null");

    final double scoreLimit =
        Double.parseDouble(
            Config.getParameter(
                HybrisTestFulfilmentProcessConstants.EXTENSIONNAME + ".fraud.scoreLimitExternal"));
    final double scoreTolerance =
        Double.parseDouble(
            Config.getParameter(
                HybrisTestFulfilmentProcessConstants.EXTENSIONNAME
                    + ".fraud.scoreToleranceExternal"));

    final OrderModel order = process.getOrder();
    final FraudServiceResponse response =
        getFraudService().recognizeOrderSymptoms(getProviderName(), order);
    final double score = response.getScore();
    if (score < scoreLimit) {
      final FraudReportModel fraudReport =
          createFraudReport(providerName, response, order, FraudStatus.OK);
      final OrderHistoryEntryModel historyEntry =
          createHistoryLog(providerName, order, FraudStatus.OK, null);
      order.setFraudulent(Boolean.FALSE);
      order.setPotentiallyFraudulent(Boolean.FALSE);
      order.setStatus(OrderStatus.FRAUD_CHECKED);
      modelService.save(fraudReport);
      modelService.save(historyEntry);
      modelService.save(order);
      return Transition.OK;
    } else if (score < scoreLimit + scoreTolerance) {
      final FraudReportModel fraudReport =
          createFraudReport(providerName, response, order, FraudStatus.CHECK);
      final OrderHistoryEntryModel historyEntry =
          createHistoryLog(providerName, order, FraudStatus.CHECK, fraudReport.getCode());
      order.setFraudulent(Boolean.FALSE);
      order.setPotentiallyFraudulent(Boolean.TRUE);
      order.setStatus(OrderStatus.FRAUD_CHECKED);
      modelService.save(fraudReport);
      modelService.save(historyEntry);
      modelService.save(order);
      return Transition.POTENTIAL;
    } else {
      final FraudReportModel fraudReport =
          createFraudReport(providerName, response, order, FraudStatus.FRAUD);
      final OrderHistoryEntryModel historyEntry =
          createHistoryLog(providerName, order, FraudStatus.FRAUD, fraudReport.getCode());
      order.setFraudulent(Boolean.TRUE);
      order.setPotentiallyFraudulent(Boolean.FALSE);
      order.setStatus(OrderStatus.FRAUD_CHECKED);
      modelService.save(fraudReport);
      modelService.save(historyEntry);
      modelService.save(order);
      return Transition.FRAUD;
    }
  }
  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;
  }