Skip to main content
14-Alexandrite
November 4, 2022
Solved

How to create a WTChangeRequest2 with Affected Objects and Affected End Items using API

  • November 4, 2022
  • 1 reply
  • 2204 views

I was creating a WTChangeRequest2 with the below code mentioned

 

WTChangeRequest2 ecr = createChangeRequest();

WTSet links = new WTHashSet();
int count1 =0;
createdDocs.stream().forEach(e->{
Changeable2 co = e;
RelevantRequestData2 relevantRequestData;
try {
relevantRequestData = RelevantRequestData2.newRelevantRequestData2(co, ecr);
relevantRequestData.setDescription("some description:"+count1);
links.add(relevantRequestData);
} catch (WTException | WTPropertyVetoException e1) {
e1.printStackTrace();
}
});
ChangeHelper2.service.storeAssociations(ecr, links);

 

 

 

@HelesicPetr 

Best answer by HelesicPetr

Hi @STEVEG 

I guess that the code works. 

@Manoj_Dokku4 just needed to know what the inputs are co - affected object and ecr - ChangeRequest

 

// example for one affected object
RelevantRequestData2
ecrtochangeable = RelevantRequestData2.newRelevantRequestData2(affectedPart, newCR);
ecrtochangeable = (RelevantRequestData2) PersistenceHelper.manager.store(ecrtochangeable);

PetrH

1 reply

14-Alexandrite
November 5, 2022

Resolved

21-Topaz I
November 7, 2022

Hi @Manoj_Dokku4 

Can you explain how this was resolved and also mark it as answered?

HelesicPetr
22-Sapphire II
22-Sapphire II
November 8, 2022

Hi @STEVEG 

I guess that the code works. 

@Manoj_Dokku4 just needed to know what the inputs are co - affected object and ecr - ChangeRequest

 

// example for one affected object
RelevantRequestData2
ecrtochangeable = RelevantRequestData2.newRelevantRequestData2(affectedPart, newCR);
ecrtochangeable = (RelevantRequestData2) PersistenceHelper.manager.store(ecrtochangeable);

PetrH