Basically this is what you need to do.
- Get the Task Flow binding of the region in the page definition, you need to have the full name
- Get the RootViewPortContext
- Find the ChildViewPortContext , use the TaskFlow full name
- Get the pageFlowScope Map of the ChildViewPortContext
Here some demo code.
Here you can download the demo workspace