|Re: [p2-dev] Executing a P2 traverse query|
Just to clarify, the code you use for creating the newIU below, do you use that for creating the IU's that you pass as roots to the traverse query? If that's the case, then I understand why you have a problem. The IU doesn't have any requirements so naturally, the query won't find any matches.
You need to query for the root iu's first, using a standard IU query (with id and version) and then use the result from that query as root IU's into the traverse query. This can be done using two queries but you can also do it one single query also, like so:
select(iu | $0.exists(v | v.id == iu.id && v.version == iu.version)).traverse(parent | ...
You then pass a collection of IVersionedID instances as $0. There is an implementation class called VersionedID that takes a constructor with id and version that you can use.
On 2010-12-14 00:20, David Orme wrote: