@Produces @Named("orderEntity") @PersistentOrder public Order getOrderEntity() { Order o = entityManager.find(Order.class, businessProcess.getVariable("orderId")); return o; }
public OrderEntity getOrderEntity() { if (orderEntity == null) { // Load the order entity from the database if not already cached orderEntity = orderBusinessLogic.getOrder((Long) businessProcess.getVariable("orderId")); } return orderEntity; }