Bug 1032068 - Maintain id pool of activity chaining instances to keep on...

...ly one chaining
I really think you should be using Map here ... These logic are complex!