OAB Diagram Contents navigation

Hi,
The attached snippet of code is trying to retrieve the contents of an OAB diagram, specifically the Actors and their Activities. I am able to retrieve the Actors but can not get the activities contained in the diagram (for each Actor).
I can’t seem to arrive at the correct syntax for retrieving the activities for each Actor on the diagram. Note that I don’t want all of the activities allocated to the Actor, only the ones on the diagram that are visible.
Thank you.

I think the following should do the trick (the forum seems to add spaces and remove spaces be careful when copy/pasting):
{m:let visibleActivities = diagram.representationElements.target->filter(oa::OperationalActivity)}
{m:for actor | diagram.representationElements.target->filter(oa::OperationalActor) ->sortedBy(actor | actor.name)}
{m:for activity | actor.allocatedOperationalActivities->select(activity | visibleActivities->includes(activity))->sortedBy(oa | oa.name)}

  • {m:activity.name}
    {m:endfor}
    {m:endfor}
    {m:endlet}

Hi Yvan,
Thank you for the reply. I will certainly try it.
Best Regards,
Maria