Here we will have a look at the Locking System. We will learn how to lock and unlock objects using locks. Locks are used to make sure objects are only used by one owner.
There are three phases to locking: locking, checking and unlocking.
We will now create a lock:
Create a new workflow and add a scriptable task.
Add the following variables as input:
Name
Type
Section
Use
object
String
IN
Any string
owner
String
IN
Any string
Enter the following script:
LockingSystem.lockAndWait(object ,owner);
Add the workflow Display all Locks at the end.
Save and run the workflow. Enter as object any string, such as
Test
and as owner or any other string such asGoofy
.Check the logs.
We will now check if an object is locked:
Create a new workflow and add a scriptable task.
Add the following variables as input:
Name
Type
Section...
The rest of the chapter is lockedRegister for a free Packt account to unlock a world of extra content!A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.Unlock this book and the full library FREE for 7 daysGet unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think ofRenews at €14.99/month. Cancel anytime}Authors (1)
Personalised recommendations for you
Based on your interests and search pattern