// First activities in the activities List are associated with MessageEvent objects.
Map result = new HashMap(messageEvents.size());
for (int m = 0; m < getMessageEvents().size(); m++) {
try {
Activity activity = (Activity) getActivities().get(m);
if (messageEvents.get(m) == null) {
throw new ProcessStructuralException("An activity in this Pick container is not associated with " +
"any MessageEvent, please check that all activities created in this " +
"container is properly associated with an event.");