It's all about the answers!

Ask a question

Plugin Running twice while saving link [Tracks Requirement].

Abhishek Kumar (49621) | asked Jan 15 '16, 12:46 a.m.
 Hello Everyone,

We have created a follow-up operation that will extract the data of a few attributes from RTC[5.0.2] and create a module in DOORS[9.6] via OLSC.
It is observed that after every restart of any of the servers (ccm or DWA) when ever the plugin runs for the first time there is  dwa window popup that asks the user to authenticate.
After successful authentication the plugin is rerun and another duplicate module object is created and this object link is added to the Tracks requirement Link of RTC, whereas the original module object which was created is not linked to RTC which is causing duplication in the doors system.
public void createLinkToRequirement(IWorkItem currentWI, String doorsLocation, IProgressMonitor monitor) throws TeamRepositoryException {
IWorkItemReferences currentWorkItemReferences = workItemServer.resolveWorkItemReferences(currentWI, null);
ILinkType parentChildLinkType = ILinkTypeRegistry.INSTANCE.getLinkType(WorkItemLinkTypes.TRACKS_REQUIREMENT);
    URI uri = URI.create(location);
    currentWorkItemReferences.add(parentChildLinkType.getTargetEndPointDescriptor(), IReferenceFactory.INSTANCE.createReferenceFromURI(uri));
    Set<String> additionalParams = new HashSet<String>();
    IStatus saveStatus = workItemServer.saveWorkItem3((IWorkItem)currentWI.getWorkingCopy(), currentWorkItemReferences, null, additionalParams);
    if (saveStatus.isOK()) {
         getLog().info(currentWI.getId()+": Link to doors complete"+location);
On a sumary
1. workitem saved by the user
2. a new object in DOORS is created by the followup operation (say o1)
3. then the createLinkToRequirement to requirement function is called which in turn calles the                       saveworkitem3 method
4. if this plugin is running to the first time after a server restart (ccm or dwa) a DWA login popup appears 
5. the user logs in succesfully into DWA.
    6. Insted of saving o1 as the requirement link the plugin is rerun and another object o2 is created and linked to the workitem 
I am encountering this issue only for the first time when the plugin runs after a server restart, else the behavior is as expected from the 2nd run.

can anyone help me out on this?? what is the cause of this problem

Thanks in Advance.

Maeve OReilly commented Jan 15 '16, 4:53 a.m.

I'm not fully understanding this.   Is it a timing thing?  e.g. user  has dwa-sessionA and creates o1.  That session becomes invalid due to a restart and she has to login again, gets dwa-sessionB - and now doesn't know anything that went on in dwa-sessionA?

Abhishek Kumar commented Jan 17 '16, 11:20 p.m.
We have a custom workflow in RTC and when ever the work item reaches the end state a Requirement has to be created in DOORS [9.5.2]. So have created a follow-up operation that will extract the required attributes from the work item and create a new object in DOORS. Also a link of type tracks requirement will be established between the two artifacts.
We have used Lyo packages to create the object in DOORS which runs from the follow-up operation and returns the Object location.
now we have to save the this returned URI of the object in the RTC system as a tracks requirement link. 
Here i am facing issues.
If this follow-up operation is running for the first time after a server restart(DWA or CCM) the plugin creates the  new object in DOORS system and then returns the URI. now when the save link method(see question) is called a DWA popup appears which asks the user to authenticate to DWA  after succesful login this plugin is not saving the the original object (o1) instead it is running again and creating a new object (o2) and linking this newly created object to RTC.

Maeve OReilly commented Jan 19 '16, 1:20 p.m. | edited Jan 19 '16, 5:06 p.m.

 But are you getting asking to login to DWA twice?  

Abhishek Kumar commented Jan 19 '16, 10:25 p.m.

Only for the fist time the user is asked to login. then until the DWA or the CCM server is shut down i am not encountering this behaviour.

Abhishek Kumar commented Jan 19 '16, 10:26 p.m.

 Only for the fist time the user is asked to login. then until the DWA or the CCM server is shut down i am not encountering this behaviour.

Be the first one to answer this question!

Register or to post your answer.