Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: utkarsh on June 05, 2009, 06:20:46 am

Title: ApplyUserLock() not working
Post by: utkarsh on June 05, 2009, 06:20:46 am
Hi,

ApplyUserlock() on a package/element works sometimes fine but at some other times it throws SEHexception.

No idea how to solve it.

Please guide.

thanks
Title: Re: ApplyUserLock() not working
Post by: utkarsh on June 07, 2009, 12:16:33 pm
More explanation on the issue i am facing.

I have elements inside a package. First i am locking the elements using (ApplyUserlock()) , then locking the package. Then I deleted all elemtns under it one by one. Now I locked the parent pakage of the package containing elements and then I am trying to delete teh package but it thows a SEHException.

It works fine sometimes and the package containing elements gets deleted but sometimes it throws exception.

Any idea why it happens will be of great help to me.

Thanks.
Title: Re: ApplyUserLock() not working
Post by: x_honzi on June 08, 2009, 11:13:15 pm
Hi,
I have similar problem but I still can't find out how make it works. I wanna change package user lock but nothing worked. I tried ReleaseUserLock(), ApplyUserLock() and ApplyGroupLock(...). Everytime it gave me an exception. Problem should be that I wanna change it without proper rights for this package as I'm logged on as different user but strange is that it is possible release lock of another user or group in EA GUI. Why I can do that through EA COM? You' re more familiar with this so is there some way how get just one functional step of code? Just one released lock for just one package? Anybody. It's only mentioned in help file but as I can see there's documented some older version ReleaseLock and nobody knows if it is the same as ReleaseUserLock and if it is still used. So I hope we find some way out.

Have a nice day
Thanks
Title: Re: ApplyUserLock() not working
Post by: twin on June 30, 2009, 08:26:06 pm
Hello,
I have a problem when I try to use ApplyUserLock() over an Element. it gives me the following error : "The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))"

Any idea about why this can happen?

Thank you,
twin
Title: Re: ApplyUserLock() not working
Post by: ALL_IN_ONE on July 02, 2009, 11:45:20 pm
hello folks,

I would like to know what version of EA you all are using.

I am using EA 7.5 build 845 and there is no manual option of Apply?UserLock and ReleaseUserLock. Also the API's dont have that option. But the older version of EA i.e 7.1 build 834 had these options and they work fine. but due to some additional features in 7.5 (845) I had to switch over to it. But now this version doesnt provide me the ApplyUserLock() and ReleaseUserLock().
Title: Re: ApplyUserLock() not working
Post by: RoyC on July 03, 2009, 09:55:58 am
I can't resolve the actual problem for you - perhaps submit a bug report to sparx support.  

However, as the earlier posters have said, the EA Automation Interface has the methods ApplyUserLock(), ApplyGroupLock() and ReleaseUserLock() in the Element, Package  and Diagram collections. They have all been there for some time, and are still there in Release 7.5 right through to the soon-to-be released build 846.

BUT the ReleaseUserLock() method (which releases both user locks and group locks) was listed in the Help for some collections in error as ReleaseLock(). This has been corrected in the Help for build 846.
Title: Re: ApplyUserLock() not working
Post by: ALL_IN_ONE on July 06, 2009, 03:45:39 pm
Hello RoyC,

I am a bit confused about your reply. So what I understand is that the EA 7.5 (build 844 or 845) doesnt have the ApplyuserLock/ReleaseUserLock facility manually and through automation? Am I right? but it will be in soon to be released in EA 7.5 build 846. I hope I have understood you reply correctly.
Title: Re: ApplyUserLock() not working
Post by: «Midnight» on July 06, 2009, 11:56:37 pm
I think Roy is saying that the function is there (at least in the API) but was erroneously documented with an incorrect name. The name will be correctly identified in the next release (Build 846).

If my interpretation is correct you should be able to use the function now, but you will have to call ReleaseUserLock instead of ReleaseLock. [The latter name is the one in the EA documentation through build 845 inclusive; the former name will be used in future documentation updates.]
Title: Re: ApplyUserLock() not working
Post by: utkarsh on July 07, 2009, 12:59:37 am
Can you please guide me how to solve the issue of ReleaseUserLock() throwing exception sometimes. I frequently get exception when releasing package. But I am unable to find the root cause of it. As I mentioned earlier exception occurs sometimes but not always. It is wierd.

Is it a bug in the API?
Please guide.

Thanks.
Title: Re: ApplyUserLock() not working
Post by: RoyC on July 07, 2009, 08:57:59 am
Hello Utkarsh

I have made our security expert aware of the issues in this thread. Have you submitted a bug report? I suspect that we will need some further details of what is happening when you use the methods. By the way, is it ApplyUserLock or ReleaseUserLock, or both?

David, thanks for the interjection. The method was, is, and always should be ReleaseUserLock(). I apologise for the errors in calling it something else.