Skip to content
Snippets Groups Projects
Commit c9a1e567 authored by buczekp's avatar buczekp
Browse files

changed definition of top sample to allow registration of data set for a...

changed definition of top sample to allow registration of data set for a sample that has more than one parent

SVN: 18953
parent c96134de
No related branches found
No related tags found
No related merge requests found
......@@ -385,12 +385,14 @@ public class SamplePE extends AttachmentHolderPE implements IIdAndCodeHolder, Co
@Transient
public SamplePE getTop()
{
SamplePE parentPE = getGeneratedFrom();
if (parentPE != null)
// traverse through parent relationship graph and stops on first sample that doesn't
// have parents or has more than one parent
final List<SamplePE> parents = getParents();
if (parents.size() == 1)
{
return parentPE.getTop() == null ? parentPE : parentPE.getTop();
return parents.get(0).getTop();
}
return null;
return this;
}
@Transient
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment