Hi Harsh,
I still don't think this is optimal and I have to jump through too many hoops to get a simple operation done. I still think that, despite the new mapper being able to do the work as shown above, it could be made simpler somehow.
Thinking about other ways and technologies:
XSLT
In XSLT you could select /Drivers/* in a foreach to get any node under drivers. Then you could get the sequential index using a position() function. That's quick and easy. If you use XSLT though, you don't need the mapper, and that's what a lot of advanced
BizTalk devlopers do. As soon as you don't need the mapper, some people start to question the whole platform and why they're spending so much on it - believe me, they do!
BizTalk
In the BizTalk map to solve this problem, the mapping was done in 2 stages:
1. The first to ordered everything in the correct sequence using mass copy to copy all of the sub nodes across. This created a sequential drivers structure. The map became a shared map to solve this kind of problem that appeared in about 30% of the integration
scenarios.
2. The second map was then able to get the position of the sequential drivers so that sequential ids could be generated.
In the new mapper, stage 1 would be harder because there is no mass copy.
New Mapper
I think that the new mapper would benefit from being able to generate a sequential id. Since the new mapper is no longer based on XSLT, it must be easier to hold state and decide how many Driver nodes, for example, have been generated.
Another solution would be to allow the MapEach to be scoped on more than one node, but that would be harder, I suspect.
Lastly, mass copy needs to be reintroduced too.
XAML vs XLST
I fear that, because MSFT have started again, creating their own mapping technology around XAML, that they may miss some of the features that allowed XSLT to become so prevalent and useful. Don't get me wrong though, the new mapper feels better than
the BizTalk mapper but it does have a way to go to become a compelling offering and ensure that developer productivity is very high.
Thanks
Rob