Map routingOutMap = dispatcher.runSync("getProductRouting", routingInMap);
routing = (GenericValue)routingOutMap.get("routing");
listRoutingTaskAssoc = (List)routingOutMap.get("tasks");
if (routing == null) {
// try to find a routing linked to the virtual product
BOMTree tree = null;
ArrayList components = new ArrayList();
try {
tree = new BOMTree(product.getString("productId"), "MANUF_COMPONENT", requiredByDate, BOMTree.EXPLOSION_SINGLE_LEVEL, delegator, dispatcher, userLogin);
tree.setRootQuantity(quantity);
tree.print(components, true);
if (components.size() > 0) components.remove(0);
} catch (Exception exc) {
Debug.logWarning(exc.getMessage(), module);
tree = null;
}
if (tree != null && tree.getRoot() != null && tree.getRoot().getProduct() != null) {
routingInMap = UtilMisc.toMap("productId", tree.getRoot().getProduct().getString("productId"), "userLogin", userLogin);
routingOutMap = dispatcher.runSync("getProductRouting", routingInMap);
routing = (GenericValue)routingOutMap.get("routing");
}
}
} catch (GenericServiceException gse) {