// get the contact address to pass over
GenericValue contactAddress = null;
try {
List addresses = delegator.findByAnd("OrderContactMech", UtilMisc.toMap("orderId", orderId, "contactMechPurposeTypeId", "BILLING_LOCATION"));
if (addresses.size() == 0)
addresses = delegator.findByAnd("OrderContactMech", UtilMisc.toMap("orderId", orderId, "contactMechPurposeTypeId", "SHIPPING_LOCATION"));
GenericValue contactMech = EntityUtil.getFirst(addresses);
contactAddress = delegator.findByPrimaryKey("PostalAddress", UtilMisc.toMap("contactMechId", contactMech.getString("contactMechId")));
} catch (GenericEntityException e) {
Debug.logWarning(e, "Problems getting order contact information", module);
}