Saturday, August 6, 2011

Dependency analysis in a set of OSB Projects

It is very important to keep track of dependencies in a OSB project.

* Who does what
* Who uses what
* Who is used by whom

In a sbconfig.jar, ExportInfo contains all info on the dependencies amongst artifacts, using a list of properties "extrefs"


NB: in order to evaluate these XPaths with XmpSpy/Xml/Evaluate XPath, you might have to tweak the document adding xmlns:imp definition to the root element:

xml-fragment name="" version="v2" xmlns:imp="http://www.bea.com/wli/config/importexport"



Xpath to retrieve all artifacts:
/xml-fragment/imp:exportedItemInfo/@instanceId

Xpath to retrieve all artifacts of a given type:
/xml-fragment/imp:exportedItemInfo[@typeId='Xquery']/@instanceId


Xpath to retrieve all dependencies of a given artifact:
/xml-fragment/imp:exportedItemInfo[@instanceId='InterfacesBLA/CommonSchemas/FilterTypes']/imp:properties/imp:property[@name='extrefs']/@value


At this point it's not difficult to write a small HTML Report Writer who formats all this info in a nice way

No comments: