Related activities do not show up in the BAM portal
This is the sort of thing you usually only get to do towards the end of a phase in a project (or the end of the project, or not at all in many cases), which is usually just a little bit too late, but gladly in my current engagement we got to it early enough as tracking is a key requirement from our engine.
Anyway, while I've been busy creating activities and developing pipelines and pipeline components to write to them, I was less concerned about displaying the information
I know there's the BAM portal, but with very specific requirements for tracking and viewing tracked data, with the need to integrate this into our existing portal, and having a great web development team, we pretty much assume we will be developing cusotm UI to display the information, possibly utilizing the BAM web services, possibly not.
So you can understand why my only concern was to get the data into the BAMPrimaryImport database, so I put a lot of effort into defining the activities correctly, and writing to them appropriately and setting up relationships between them, but I've put very little effort into defining views as I do not plan to use them. to me - as long as the activies were populated and their relationships were created ok, my worries were over.
Regardless, I've decided to see what the BAM portal can do for me, mainly because I was tried of trying to make sense of rows in tables in the SQL management studio during development.
The BAM portal is actually quite nice as a basic tool to view activities., you can query your acitivites to find specific ones, and then see all the information about them, and you can see all the related activities for the once you've selected apparently.
Only that for some reason, while I knew that for a single activity I should have a lot of related acitvies defined, and I know they are linked correctly in the database, I could not see any appear on the screen.
I've decided to look into it so I've opened up sql profiler an quickly found out that the stored procedure called to get the related acitivtied for a particular activity is passed the name of the view to use for the lookup as a parameter. that seemed ok enough.
Looked into the stored procedure it self it became clear that the query does not look for any related activity that exist, but only realted instances of activities included in that view.
I guess that makes sense as activity id is not guarenteed to be unique across activity types, so you cannot look for "123" as your related acitivity, you need to look for "PO 123".
In my case - the view I created, mainly because I did not care much for the views as explained earlier, only included to top level activity, the related activities were not included in the view, and there fore did not appear on the portal.
After I've changed my view to include all the related activities I could infact see the related acitivites list in the portal populated.