Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

Implementing lock, unlock, lockstatusget method for object in teamcenter with different access level

Solution Partner Experimenter Solution Partner Experimenter
Solution Partner Experimenter

Requirement  :: We are implementing required lock, unlock, lockstatusget method for object operation. What we expect(ideal behaviour), when object is lock by dba user, other gorup (lower authority) user should get status as already locked (whether lock or unlock)  and can not lock (modify content of object) it.

If regular user lock the object, dba user should get status as already locked and dba user want unlock the object, it can be possible as he is super group user.  

While using ITK method to implement above we are getting error, when object alreay lock, while fetching lockstatusget (POM_ask_instance_lock).

  

To work with lock, unlock, lockstatusget functionality we have used AOM_referesh(objTag,true),AOM_referesh(objTag,false) and  POM_ask_instance_lock(objTag, &locktoken) ITK method.

While checking the above method for functionality, we found following behaviour.

 

1 when object lock by dba group user,

  A. if same user tried to check lock status(POM_ask_instance_lock) in another session, it gives us POM_no_lock and error          code indiacates, object instance not loaded.

  

  B. if above user tries to lock the above object, it allow to lock it.

  

  C. if another user from same group tries to check lock status(POM_ask_instance_lock) in another session, it gives us      POM_no_lock and error code indiacates, object could not loaded.

 

  D. if another user from engineer group tries to lock the above object, it doest not allow to lock it, returns error.

 

 

2. when object lock by engineer group user,

  

  A. if same user tried to check lock status(POM_ask_instance_lock) in another session, it gives us POM_no_lock and error          code indicates, object instance not loaded.

  

  B. if above user tries to lock the above object, it allow to lock it.

 

  C. if another user from dba group tries to check lock status(POM_ask_instance_lock) in another session, it gives us           POM_no_lock and error code indiacates, object could not loaded.

 

  D. if another user from dba group tries to lock the above object, it allow to lock it.

 

Is anything missing above implementing ?

Please let us know, how can locking, unlockng done in teamcenter, so other user can do operation if object already locked.

Is there any other method to implement lock,unlock object ? 

 

It will be great, if you help any above any concern.

4 REPLIES 4

Re: Implementing lock, unlock, lockstatusget method for object in teamcenter with different access l

Siemens Genius Siemens Genius
Siemens Genius

Just some thoughts (no guarantee for consistency with Siemens official information):

 

1. Requirement

Your requirement seems different to locking mechanism as used by Teamcenter. I'm not sure is the locking system is customizable, but I do not think so. You can implement your own lock/unlock tables on POM level, but it will not be reflected by the OOTB lock functionality.

 

2. My imagination of Teamcenter locking

The lock/unlock mechanism is short time low-level protection against data inconsistency. Nobody is allowed to produce data inconsistency and therefore nobody can bypass it regardless of rights.

The process shall lock all objects which shall be modified consistently, save them and unlock as fast as possible.

 

3. Feeled lock behaviour

Before a user locks an object the user rights and existing locks are verified. The user can not lock for modify any object where he does not have write right. Locks of not existing sessions are remove automatically.

If the object is locked, the process wait couple of seconds and try the lock again (in assumption that locking is short-term process). The maximal wait time is about minute.

If a lock is created, it is written in lock table with object,user, session and lock type. The lock is valid until an unlock is performed or the session ends.

I'm not sure about locks of the same user in multiple sessions. My feeling is that the user can modify the object in both sessions and so corrupt it.

 

4. Bypass lock

There is probably possibility to bypass lock on Teamcenter application level. At least I have seen folders corrupted this way.

 

 

Is anything missing above implementing ?

Difficult to say, the approach seems doubtful for me.

 

Please let us know, how can locking, unlocking done in Teamcenter, so other user can do operation if object already locked.

Lock, Modify,Save,Unlock - Nobody other can change the object between Lock and Unlock. (period, no discussion)

 

Is there any other method to implement lock,unlock object ? 

You can consider the Check Out/Check in mechanism. This is for long term reservation, can be controlled by access manager, restrict the object modification up to some point and is visualised in GUI

 

Kind regards

Svatos

 

Re: Implementing lock, unlock, lockstatusget method for object in teamcenter with different access l

Solution Partner Experimenter Solution Partner Experimenter
Solution Partner Experimenter

Thanks Svatos for your reply,

We are trying to lock objects before doing mutpliple operation on objects, so that no other user(lower authority) can modify and cause for data inconsistency, that's why we triing above method for lock unlock.

 

As per your following comment.

You can implement your own lock/unlock tables on POM level, but it will not be reflected by the OOTB lock functionality.

Have you tried it before in Teamcenter ? If yes, could you please guide us on the same ?

 

 

If the object is locked, the process wait couple of seconds and try the lock again (in assumption that locking is short-term process). The maximal wait time is about minute.

If a lock is created, it is written in lock table with object,user, session and lock type. The lock is valid until an unlock is performed or the session ends.

I'm not sure about locks of the same user in multiple sessions. My feeling is that the user can modifythe object in both sessions and so corrupt it.

Yes, user can modify it (by directly appling lock), But before that i'm asking whether object has lock applied, but method give error code reteurning object instance not loaded.

 

Thanks for your view.

 

 

 

 

 

 

 

Re: Implementing lock, unlock, lockstatusget method for object in teamcenter with different access l

Siemens Genius Siemens Genius
Siemens Genius

As per your following comment.

You can implement your own lock/unlock tables on POM level, but it will not be reflected by the OOTB lock functionality.

Have you tried it before in Teamcenter ? If yes, could you please guide us on the same ?

 

No, I have never implemented something similar.

 

 

Yes, user can modify it (by directly appling lock), But before that i'm asking whether object has lock applied, but method give error code reteurning object instance not loaded.

If you got "instance not loaded" you might try to load the instance without locking and ask again.

Alternatively you can create POM enquiry, which will search in the lock table for the locked object(s)

 

Kind regards

Svatos

 

Re: Implementing lock, unlock, lockstatusget method for object in teamcenter with different access l

Legend
Legend

Hi,

 

Why do you need this functionallity? Because of a bug or because you need extra custom function?

On what version of Teamcenter are you?

We have issue in TC11.6.4/NX12.0.2MP8 that readonly parts are locked after save as to new items from NX.

It is blocking our PLM upgrade.

So i'm very interested in this thread.

 

thanks

br

Fred

Frederik Verscheure
Evolve Consulting bvba
Freelance NX & Teamcenter consultant
frederik@evolve-consulting.be