analysis2bsml appears to override the sourcename field in an analysis tag by setting the parameter to two directories above the value currently set. This only works now because our components usually pass in whatever is in the output option which means that two directories up is the iterator directory. However, if a sourcename was passed in that was 'correct' (or at least one that was not expected to be changed) analysis2bsml will change it to two directories up and this could cause serious problems if multiple instances of the same analysis are run.
Here are the lines in analysis2bsml:
261 ## make sure the sourcename is only the path to the output directory, not the output file itself.
262 for my $attribute ( $analysis->children('Attribute') ) {
263 if ( $attribute->att('name') eq 'sourcename' ) {
264 $attribute->set_att('content',dirname(dirname($attribute->att('content'))));
265 last;
266 }
267 }