*/
public void doTrace(String productName) {
Product prod = fm.safeGetProductByName(productName);
Pedigree pedigree = new Pedigree(fm, this.listNotCataloged,
this.excludeTypeList);
System.out.println("");
System.out.println(REPORT_LINE_SEPARATOR);
System.out.println("Product: " + prod.getProductName());
System.out.println(REPORT_LINE_SEPARATOR);
prod.setProductReferences(fm.safeGetProductReferences(prod));
System.out.println("Location: " + fm.getFilePath(prod));
System.out.println(REPORT_LINE_SEPARATOR);
System.out.println("Metadata: ");
Metadata met = fm.safeGetMetadata(prod);
if (met != null && met.getHashtable() != null
&& met.getHashtable().keySet().size() > 0) {
for (Iterator i = met.getHashtable().keySet().iterator(); i.hasNext();) {
String key = (String) i.next();
List vals = met.getAllMetadata(key);
System.out.println(key + "=>" + vals);
}
}
System.out.println(REPORT_LINE_SEPARATOR);
System.out.println("Generated from workflow:");
System.out.println("");
WorkflowInstance inst = null;
try {
inst = getWorkflowInstanceById(wm.safeGetWorkflowInstances(), met
.getMetadata(JOB_ID));
System.out.println(inst.getWorkflow().getName() + ": ID: ["
+ inst.getId() + "]");
System.out.println("Status: " + inst.getStatus());
List wInstProds = pedigree.getWorkflowInstProds(inst.getId());
if (wInstProds != null && wInstProds.size() > 0) {
System.out.println("Associated products:");
System.out.println("");
for (Iterator i = wInstProds.iterator(); i.hasNext();) {
Product wInstProd = (Product) i.next();
System.out.println(wInstProd.getProductName());
}
}
} catch (Exception e) {
System.out.println("Unable to obtain workflow instance for product!");
}
System.out.println(REPORT_LINE_SEPARATOR);
System.out.println("Full lineage:");
System.out.println("");
System.out.println("Downstream:");
PedigreeTree downstreamLineageTree = pedigree.doPedigree(prod, false);
downstreamLineageTree.printPedigreeTree();
System.out.println("");
System.out.println("Upstream:");
PedigreeTree upstreamLineageTree = pedigree.doPedigree(prod, true);
upstreamLineageTree.printPedigreeTree();
}