YD
Hello Community,
I would like to know if there is a function for report or macro that can check whether the selected model/object is locked or not?
Thanks in advance!
(I'm using ARIS 10.0.3 - mentioned methods may be unavailable in other ARIS versions, or function in a different way)
For Reports:
- The simplest way is probably to just use the .getLockOwner() Model-object-method, and check whether the returned String == null (null means there is no lock, because there is no lock owner). Available for models and object definitions.
- Another option is to load the "Locking" component (Context.getComponent("Locking")), and use it to determine the lock state of the model/object definition. You can find information about that in the ARIS Script documentation > Contents tab > ARIS Script > Methods for reports and semantic checks > Global Objects > report component interfaces > Locking > all the sub-pages of Locking. Specifically you'd use a method from the Locking interface to get a LockInfo object, and then use a method from the LockInfo class to determine the lock state of the object
For Macros:
- For what you want to do I don't think there is a way around the Locking macro component interface. You don't have to load components in macros, so it's a bit easier. You'd just use Locking.getLockInfo(objectToCheck).getLockState() == Constants.LOCKING_STATE_UNLOCKED to check the state of the object you want to check