src/main/java/org/edgegallery/appstore/application/inner/OrderService.java
public void updateOrderStatus(String token, Order order) {
        if (StringUtils.isEmpty(order.getMecPackageId())) {
            LOGGER.error("mecm package id is null.");
            return;
        }
        MecmDeploymentInfo mecmDeploymentInfo = mecmService.getDeploymentStatus(token, order.getMecPackageId(),
            order.getUserId());
        if (mecmDeploymentInfo == null || mecmDeploymentInfo.getMecmOperationalStatus() == null) {
            LOGGER.error("mecm deployment info is null.");
            return;
        }
        if (mecmDeploymentInfo.getMecmOperationalStatus().equalsIgnoreCase("Finished")) {
            order.setStatus(EnumOrderStatus.ACTIVATED);
            LOGGER.info("Distributed and instantiated success, modify status to activated");
        } else if (mecmDeploymentInfo.getMecmOperationalStatus().equalsIgnoreCase("Distribute Error")
            || mecmDeploymentInfo.getMecmOperationalStatus().equalsIgnoreCase("Instantiate Error")
            || mecmDeploymentInfo.getMecmOperationalStatus().equalsIgnoreCase("Create Error")) {
            order.setStatus(EnumOrderStatus.ACTIVATE_FAILED);
            LOGGER.error("Distributed or Instantiated failed, modify status to activate failed");
        }
        orderRepository.updateOrder(order);
    }
/**
     * update order status.
     *
     * @param token access token
     * @param order order info
     */
update order status.
@param token access token
@param order order info
update order status . @param token access token @param order order info
public void updateOrderStatus(String token, Order order) {
        if (StringUtils.isEmpty(order.getMecPackageId())) {
            LOGGER.error("mecm package id is null.");
            return;
        }
        MecmDeploymentInfo mecmDeploymentInfo = mecmService.getDeploymentStatus(token, order.getMecPackageId(),
            order.getUserId());
        if (mecmDeploymentInfo == null || mecmDeploymentInfo.getMecmOperationalStatus() == null) {
            LOGGER.error("mecm deployment info is null.");
            return;
        }
        if (mecmDeploymentInfo.getMecmOperationalStatus().equalsIgnoreCase("Finished")) {
            order.setStatus(EnumOrderStatus.ACTIVATED);
            LOGGER.info("Distributed and instantiated success, modify status to activated");
        } else if (mecmDeploymentInfo.getMecmOperationalStatus().equalsIgnoreCase("Distribute Error")
            || mecmDeploymentInfo.getMecmOperationalStatus().equalsIgnoreCase("Instantiate Error")
            || mecmDeploymentInfo.getMecmOperationalStatus().equalsIgnoreCase("Create Error")) {
            order.setStatus(EnumOrderStatus.ACTIVATE_FAILED);
            LOGGER.error("Distributed or Instantiated failed, modify status to activate failed");
        }
        orderRepository.updateOrder(order);
    }
public void updateOrderStatus ( String token , Order order ) { if ( StringUtils . isEmpty ( order . getMecPackageId ( ) ) ) { LOGGER . error ( "mecm package id is null." ) ; return ; } MecmDeploymentInfo mecmDeploymentInfo = mecmService . getDeploymentStatus ( token , order . getMecPackageId ( ) , order . getUserId ( ) ) ; if ( mecmDeploymentInfo == null || mecmDeploymentInfo . getMecmOperationalStatus ( ) == null ) { LOGGER . error ( "mecm deployment info is null." ) ; return ; } if ( mecmDeploymentInfo . getMecmOperationalStatus ( ) . equalsIgnoreCase ( "Finished" ) ) { order . setStatus ( EnumOrderStatus . ACTIVATED ) ; LOGGER . info ( "Distributed and instantiated success, modify status to activated" ) ; } else if ( mecmDeploymentInfo . getMecmOperationalStatus ( ) . equalsIgnoreCase ( "Distribute Error" ) || mecmDeploymentInfo . getMecmOperationalStatus ( ) . equalsIgnoreCase ( "Instantiate Error" ) || mecmDeploymentInfo . getMecmOperationalStatus ( ) . equalsIgnoreCase ( "Create Error" ) ) { order . setStatus ( EnumOrderStatus . ACTIVATE_FAILED ) ; LOGGER . error ( "Distributed or Instantiated failed, modify status to activate failed" ) ; } orderRepository . updateOrder ( order ) ; }
update order status.
update order status .