//TODO this is a situation-specific code. Generalize sometime.
if("event".equals(message) && (messageSubscriptions==null || messageSubscriptions.size()==0)){
messageSubscriptions = new Vector();
final Vector finalSubscribedScopes = messageSubscriptions;
ActivityForLoop findingLoopForRunningScopeActivity = new ActivityForLoop(){
public void logic(Activity activity) {
if(activity instanceof ScopeActivity){
try {
if(isRunning(activity.getTracingTag()) && ((ScopeActivity)activity).getEventHandlers()!=null)
finalSubscribedScopes.add(activity.getTracingTag());
} catch (Exception e) {
}
}
}
};
findingLoopForRunningScopeActivity.run(getProcessDefinition());
}
return messageSubscriptions;
}