Class OrderProcessUtil

java.lang.Object
com.skava.oms.flow.util.OrderProcessUtil

public final class OrderProcessUtil extends Object
This class contains the common methods needed for order process.
Since:
Feb 28, 2019
Author:
Infosys Equinox
  • Method Details

    • getPatchOrderItemInfo

      public static PatchOrderRequest getPatchOrderItemInfo(Order order, PatchOrderRequest patchOrderRequest)
      This method generates orderitem information for patchOrderRequest model from the given order
      Parameters:
      order - - order object
      patchOrderRequest - - patch order input
      Returns:
      - patch order updated object
    • getDisplayStatus

      public static String getDisplayStatus(org.camunda.bpm.engine.delegate.DelegateExecution execution, String displayStatus)
      This method checks and returns the display status if present in BPMN
      Parameters:
      execution - delegate
      displayStatus - status to be updated
      Returns:
      status to be updated
    • getDisplayStatus

      public static String getDisplayStatus(org.camunda.bpm.engine.delegate.DelegateTask execution, String displayStatus)
      This method checks and returns the display status if present in BPMN
      Parameters:
      execution - delegate task
      displayStatus - status to be updated
      Returns:
      status to be updated
    • allowedPatchFieldsforItesms

      public static OrderItem[] allowedPatchFieldsforItesms(String allowedPatchFields, Order order)
      Adds allowedPatchfileds for cancelled and return the the available order/items
      Parameters:
      allowedPatchFields - - value for allowedPatchFields
      order - details of order
      Returns:
      Debug logger has been added to this method.
    • allowedPathFieldForItem

      public static void allowedPathFieldForItem(AllowedPatchFields[] allowedPatchFields, OrderItem oi)
      Parameters:
      allowedPatchFields - Indicates the status of the order item for which the given configuration needs to be applied.
      oi - order item information about an order.
    • allowedPatchFieldsEmptyforItesms

      public static OrderItem[] allowedPatchFieldsEmptyforItesms(OrderItem[] items)
      Adds allowedPatchfileds for cancelled and return the the available order/items
      Parameters:
      items - number of items
      Returns:
      returns the order items Debug logger has been added to this method.
    • allowedPatchFields

      public static AllowedPatchFields[] allowedPatchFields(String patchFields)
      Adds allowedPatchfileds for cancelled and return the the available order/items
      Parameters:
      patchFields - - value for allowedPatchFields
      Returns:
      returns the values Debug logger has been added to this method.
    • allowedPatchFieldsforOrder

      public static AllowedPatchFields[] allowedPatchFieldsforOrder(AllowedPatchFields[] allowedPatchFields, Order order)
      Adds allowedPatchfileds for order checking with nextStatus
      Parameters:
      allowedPatchFields - - value for allowedPatchFields
      order - - orderdetails of order
      Returns:
      returns the arrays Debug logger has been added to this method.
    • getPatchedOrderItems

      public static List<OrderItem> getPatchedOrderItems(OrderItemPatchDTO patchitemdto, List<OrderItem> splittedOrderItems)
      This method will extract the updated order items based on the given request.
      Parameters:
      patchitemdto - orderitems from patch reqeust
      splittedOrderItems - orderitems after splitting based on the given quantity and available quantity
      Returns:
      affected order items
    • recalcAllowedPatchFields

      public static void recalcAllowedPatchFields(org.camunda.bpm.engine.delegate.DelegateExecution execution, Order order)
      This method set null value or other status in item level and order level.
      Parameters:
      execution - delteageexecution to get and validatevariable
      order - order detail info
    • constructPatchFields

      public static PatchOrderRequest constructPatchFields(Order order, String status, boolean isParentOrderUpdate)
    • getOrderDisplayStatusMap

      public static Map<String,String> getOrderDisplayStatusMap(org.camunda.bpm.engine.delegate.DelegateExecution execution)
    • getOrderStatusMap

      public static Map<String,String> getOrderStatusMap(org.camunda.bpm.engine.delegate.DelegateExecution execution)
    • getOrderDisplayStatusMap

      public static Map<String,String> getOrderDisplayStatusMap(org.camunda.bpm.engine.delegate.DelegateTask execution)
    • getOrderStatusMap

      public static Map<String,String> getOrderStatusMap(org.camunda.bpm.engine.delegate.DelegateTask execution)
    • updateLoyaltyUserInfo

      public static void updateLoyaltyUserInfo(Order order, PreProcessLoyaltyEventRequest.LoyaltyUserInfo userInfo)
      This method updates loyalty user info
      Parameters:
      order - indicates order details
      userInfo - indicates user info
    • constructPatchFields

      public static PatchOrderRequest constructPatchFields(Order order, String status)
      Parameters:
      order -
      status -
      Returns:
    • getTraceContextFromOrderTraceString

      public static brave.propagation.TraceContext getTraceContextFromOrderTraceString(Order order)
      Parameters:
      order -
      Returns:
    • logDebug

      public static void logDebug(org.camunda.bpm.engine.delegate.DelegateExecution execution, Order order, brave.Tracer tracer)
      Parameters:
      execution -
      order -
      tracer -
    • logDebug

      public static void logDebug(org.camunda.bpm.engine.delegate.DelegateTask execution, Order order, brave.Tracer tracer)
      Parameters:
      execution -
      order -
      tracer -