It's all about the answers!

Ask a question

Children Linking Order in Operation Advisor.

Arun Batra (14612326) | asked Jan 16 '17, 3:21 a.m.
reverted Jan 16 '17, 3:24 a.m.

 When linking child work items in an operation advisor, the list of children as seen from the parent links view is in a random order, even if the work items are being linked sequentially.

What could be the issue?

The code used is this.
for (IWorkItem child : children) {
IWorkItemReferences references = saveParameter.getNewReferences();
List<IReference> allrefs = references.getReferences(WorkItemEndPoints.CHILD_WORK_ITEMS);
for (IReference iReference : allrefs) {
System.out.println(iReference.getLink() +" : "+ iReference.getComment());
workItemService.saveWorkItem2(child, null, null);
IReference newReference = IReferenceFactory.INSTANCE.createReferenceToItem(child,child.getHTMLSummary().getPlainText());
   references.add(WorkItemEndPoints.CHILD_WORK_ITEMS, newReference);

When using the SYSOUT, the order is correctly displayed in the console. Just RTC is showing it as shown in the screen shot. Please Advise.

One answer

permanent link
Ralph Schoon (61.8k33643) | answered Jan 16 '17, 3:26 a.m.
edited Jan 16 '17, 3:29 a.m.

If you perform changes to a work item in an advisor you likely violate the interface. see . An advisor basically only advises e.g. prevents a save.

The order of elements in whatever list and the order of how they are displayed by a user interface are not necessarily the same. For example you get alphabetical order in some places.

Your answer

Register or to post your answer.