Custom Dyanmic Widget

I'm using UCMDB 10.20 and browser 4.0


I like the Impact Simulation widget in the UCMDB browser, but I'm trying to dumb it down by creating my own Dynamic Widget.


All I want to show is any BusinessApplication which has a direct or indirect relationship with any InfrastructureElement CI.


For example, if I search for a node, switch, rack, location, etc, I'd like the widget to only display the BusinessApplications which are impacted.  The out of the box Impact Simulation widget does this, but again, there is too much detail in that widget, and I'm trying to make a simple one.


Does anyone have an idea of the TQL would look like?  In my new Dynamic Widget, I have 2 CI types; Businesss Application and InfrastructureElement.  The InfrastructureElement is the Contact Query Node.  I just don't know what kind of relationship to put between these CI types.