Highlighted
lgraeser Absent Member.
Absent Member.
966 views

ALM 12 stops working after connecting to a different project

Jump to solution

Hi there!

I have a small VBScript in the 'Common Script' file that disconnects the TDConnection Object from the current project and connects it to another project on the same server. The idea is to transfer a bug from one project to another. So after creating a new bug in the other project (and setting all necessary fields) I disconnect from the other project and reconnect to the original project.

Up to this point everything seems to work smoothly, however, when I try to do something in ALM now (editing a bug or clicking refresh) ALM crashes and I get the "ALM Client has stopped working" message.

This is a simplified version of my script that really just connects to another project and then reconnects to the original project, nothing else. And it still reproduces the same erroneous behavior.

Function ActionCanExecute(ActionName)
  'Use ActiveModule and ActiveDialogName to get
  'the current context.
  On Error Resume Next

'------------------------------------------------------------------------------
'Defect Transfer
'------------------------------------------------------------------------------
If ActionName = "UserDefinedActions.Defect_Transfer" Then

   ' Determination of target project with domain
   targetDomain = "GERMANY"
   targetProject = "RT_Easy_Factory"

   ' Save current project and domain
   curProject = TDConnection.ProjectName
   curDomain = TDConnection.DomainName

   ' Disconnect from current Project
   msgBox "Disconnecting from " & curDomain & "\" & curProject
   TDConnection.Disconnect

   ' Connect to target Project
   msgBox "Connect to: " & targetDomain & "/" & targetProject
   TDConnection.Connect targetDomain, targetProject

   'Disconnect from target Project
   msgBox "Disconnecting from " & targetDomain & "\" & targetProject
   TDConnection.Disconnect

   'Connect back to current Project
   msgBox "Connect to: " & curDomain & "/" & curProject
   TDConnection.Connect curDomain, curProject

End If


Am I using the TDConnection object wrong? Or am I forgetting cleaning up something?

Any help would be appreciated.

Cheers.

0 Likes
1 Solution

Accepted Solutions
Knowledge Partner Knowledge Partner
Knowledge Partner

Re: ALM 12 stops working after connecting to a different project

Jump to solution

Disconnecting your current session is like chopping off the treelimb that you are sitting on. Your session and browser are likely to crash even if you connect immediately like Beate suggests.

You can use the current login credentials like this:

tdc.Login User.UserName, tdc.Password

Getting the password like this assumes that you have set the DISABLE_PASSWORD_OTA_ENCRYPTION site parameter to Y.

 

Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
9 Replies
Outstanding Contributor.. Beate N Outstanding Contributor..
Outstanding Contributor..

Re: ALM 12 stops working after connecting to a different project

Jump to solution

Hi,

I used your script in my environment (ALM 12.53) and wasn't able to reproduce the issue.

I was able to get defect information from the newly connected project and after the reconnect to the original project I was able to work as usually - no crash, no nothing.

What ALM version do you use? 

Is there somethin in the qc log files?

Maybe get rid of the "on error resume next" ... you might hide an error.

best regards

Beate

lgraeser Absent Member.
Absent Member.

Re: ALM 12 stops working after connecting to a different project

Jump to solution

Thank you very much for your suggestions.

I am using ALM version 12.21

Unfortunately, I haven't made any progress solving this. I did set the "On Error GoTo 0" but that didn't yield any new insight. No error seems to be raised. Each line is executed.

I'm still working on getting the qc logs, though...

Cheers

0 Likes
Outstanding Contributor.. Beate N Outstanding Contributor..
Outstanding Contributor..

Re: ALM 12 stops working after connecting to a different project

Jump to solution

Hi,

maybe you want to get rid of the Error handling at all. Just for the time beeing... that's what I do. 

As long as I'm developing scripts I use a comment for those two lines.

best regards

Bea

0 Likes
Knowledge Partner Knowledge Partner
Knowledge Partner

Re: ALM 12 stops working after connecting to a different project

Jump to solution

You can't disconnect the default TDConnection object - that will terminate your current session, and you will be logged out from ALM.

You need to create a new connection. For example:

	Set tdc = CreateObject("tdapiole80.tdconnection")
	tdc.InitConnectionEx (http://yourqcserver/qcbin)
	tdc.Login user, password
Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
0 Likes
Outstanding Contributor.. Beate N Outstanding Contributor..
Outstanding Contributor..

Re: ALM 12 stops working after connecting to a different project

Jump to solution

Hi Jan,

Sorry, but I have to disagree...

The script is not logging out of the session but just disconnecting from the project. Therefore the session is not terminated. 

I added one line to the original script: TDConnection.Bugfactory.Item(6).Summary  --> just showing the name of the defect with ID 6 and this was working fine. I got the defect name from the other project. 

best regards

Bea

0 Likes
lgraeser Absent Member.
Absent Member.

Re: ALM 12 stops working after connecting to a different project

Jump to solution

As far as I understood the TDConnection object I can disconnect from a project without logging out from the server. My aim was to avoid prompting for username and password, because the current user is registered on both projects.

Is there a way to set up a new TDConnection using the credentials of the current user without prompting for them?

0 Likes
Knowledge Partner Knowledge Partner
Knowledge Partner

Re: ALM 12 stops working after connecting to a different project

Jump to solution

Disconnecting your current session is like chopping off the treelimb that you are sitting on. Your session and browser are likely to crash even if you connect immediately like Beate suggests.

You can use the current login credentials like this:

tdc.Login User.UserName, tdc.Password

Getting the password like this assumes that you have set the DISABLE_PASSWORD_OTA_ENCRYPTION site parameter to Y.

 

Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
Outstanding Contributor.. Beate N Outstanding Contributor..
Outstanding Contributor..

Re: ALM 12 stops working after connecting to a different project

Jump to solution

Hi Jan,

thanks! I didn't know this is possible.

best regards

Bea

0 Likes
lgraeser Absent Member.
Absent Member.

Re: ALM 12 stops working after connecting to a different project

Jump to solution

Thanks a lot, Jan!

That's what I needed!

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.