use of org.broadleafcommerce.core.workflow.ProcessContext in project BroadleafCommerce by BroadleafCommerce.
the class OrderServiceImpl method updateProductOptionsForItem.
@Override
@Transactional(value = "blTransactionManager", rollbackFor = { UpdateCartException.class })
public Order updateProductOptionsForItem(Long orderId, OrderItemRequestDTO orderItemRequestDTO, boolean priceOrder) throws UpdateCartException {
try {
CartOperationRequest cartOpRequest = new CartOperationRequest(findOrderById(orderId), orderItemRequestDTO, priceOrder);
ProcessContext<CartOperationRequest> context = (ProcessContext<CartOperationRequest>) updateProductOptionsForItemWorkflow.doActivities(cartOpRequest);
context.getSeedData().getOrder().getOrderMessages().addAll(((ActivityMessages) context).getActivityMessages());
return context.getSeedData().getOrder();
} catch (WorkflowException e) {
throw new UpdateCartException("Could not product options", getCartOperationExceptionRootCause(e));
}
}
use of org.broadleafcommerce.core.workflow.ProcessContext in project BroadleafCommerce by BroadleafCommerce.
the class PricingServiceImpl method executePricing.
public Order executePricing(Order order) throws PricingException {
try {
ProcessContext<Order> context = (ProcessContext<Order>) pricingWorkflow.doActivities(order);
Order response = context.getSeedData();
return response;
} catch (WorkflowException e) {
throw new PricingException("Unable to execute pricing for order -- id: " + order.getId(), e);
}
}
Aggregations