Queries this object's lock state. This helper method examines the object's lock-related properties and determines the object's lock state. An alternative approach is to call the LockObject method and handle any exception thrown if the method fails.

Note that this method returns an approximation of the locked state at the time of the call. Once this method executes and returns the value, the object's lock state could be immediately changed by another application's call to the LockObject method or the lock could expire.

Before calling this method, make sure that the object's LockToken, LockTimeout, and DateLastModified properties have relatively fresh values. If any of those properties is missing, they are silently fetched from the server and added to the object's property cache.

The IsLocked method returns False if the LockTimeout property is not set or if the lock has expired. The lock is determined to be expired if the DateLastModified property value plus the number of seconds specified by the LockTimeout property is less than the current system time. (All millisecond components are dropped from the calculation.) If the DateLastModified property is not set, this method returns False because the check against the lock timeout value or the lock token will reflect that the object is not locked. As soon as some action locks the object, the DateLastModified property will be updated and can then be used for the expiration calculation.

Note: Note: To successfully run IsLocked and other cooperative locking methods, system clocks on the IBM FileNet P8 platform engine machines must be synchronized. The calculation performed by the IsLocked() method is done on the client system. If the client and server machine clocks are not synchronized, the result of this calculation might be incorrect.


Namespace: FileNet.Api.Core
Assembly: FileNet.Api (in filenet.api.dll)

Syntax

Visual Basic (Declaration)
Function IsLocked() As Nullable(Of Boolean)
C#
Nullable<bool> IsLocked()
C++
Nullable<bool> IsLocked() abstract 
J#
Nullable<bool> IsLocked()
JScript
function IsLocked() : Nullable<bool>

Return Value

True if this object is locked; otherwise, returns False.

See Also