Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Adding child iteration as first child?

To add a child iteration, there are two methods: IIteration::addChild(IIteration newChild) which creates a new iteration as the last child, and IIteration.insertChildAfter(IIteration newChild, IIteration afterThis) (actually, I'm not sure of the order of the parameters).

How do you add a child as the FIRST child of an iteration if there are already other children? I found out how to do it in the GUI---you pick the parent as the "new parent" rather than using the sibling function. But how do you do it through the Java api?

0 votes



2 answers

Permanent link
Just taking a guess, have you tried passing in a null parameter for
afterThis?

Cheers,
Geoff

On 4/23/2011 5:23 PM, ajberner wrote:
To add a child iteration, there are two methods:
IIteration::addChild(IIteration newChild)
which creates a new iteration as the last child, and
IIteration.insertChildAfter(IIteration newChild,
IIteration afterThis)
(actually, I'm not sure of the
order of the parameters).

How do you add a child as the FIRST child of an iteration if there are
already other children? I found out how to do it in the GUI---you
pick the parent as the "new parent" rather than using the
sibling function. But how do you do it through the Java api?

0 votes


Permanent link
The javadoc supports Geoff's guess:

"If the anchor is
* <code>null</code> the element is added at the beginning of the list.
*
* @param child a handle for the new child
* @param anchor the current child
"
If this method is not adding the anchor correctly, please file a defect against the Process component so we can look into it.

Thanks,
Martha
Jazz Developer, Process Component

Just taking a guess, have you tried passing in a null parameter for
afterThis?

Cheers,
Geoff

On 4/23/2011 5:23 PM, ajberner wrote:
To add a child iteration, there are two methods:
IIteration::addChild(IIteration newChild)
which creates a new iteration as the last child, and
IIteration.insertChildAfter(IIteration newChild,
IIteration afterThis)
(actually, I'm not sure of the
order of the parameters).

How do you add a child as the FIRST child of an iteration if there are
already other children? I found out how to do it in the GUI---you
pick the parent as the "new parent" rather than using the
sibling function. But how do you do it through the Java api?

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Apr 23 '11, 5:21 p.m.

Question was seen: 5,954 times

Last updated: Apr 23 '11, 5:21 p.m.

Confirmation Cancel Confirm