- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2018 06:37 AM
Hi,
please explain about Lock , how it will works ?? and Don't Copy paste servicenow wiki information.
explain it in real time scenario
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2018 07:30 AM
If you use it right, you can set it up that way, but I wouldn't. You can't be sure that access runs first or iphone runs first.
Based on your use case, you don't need a lock.
If you had a case where iPhones were being requested several times an hour, then you might consider one. Let's say you are keeping track of an inventory count of how many iPhones you have. That inventory table has a "unit" and "quantity". I would consider using a lock on the workflow when the workflow gets to the point when it needs to decrement the count from that table. If you had all workflows accessing at the same time, your count would be off for that record. If you use a lock, you ensure only one record is decrementing at a time.
Again, it doesn't sound like you need a lock so don't bother.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2018 07:30 AM
If you use it right, you can set it up that way, but I wouldn't. You can't be sure that access runs first or iphone runs first.
Based on your use case, you don't need a lock.
If you had a case where iPhones were being requested several times an hour, then you might consider one. Let's say you are keeping track of an inventory count of how many iPhones you have. That inventory table has a "unit" and "quantity". I would consider using a lock on the workflow when the workflow gets to the point when it needs to decrement the count from that table. If you had all workflows accessing at the same time, your count would be off for that record. If you use a lock, you ensure only one record is decrementing at a time.
Again, it doesn't sound like you need a lock so don't bother.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2018 07:34 AM
Thanks , It is Great stuff
i understood now!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2018 08:08 AM
Glad you were able to get an answer to your question, I'm only posting a reply in the event others read this thread and haven't considered how the lock activity can affect the integrity of workflow integrations.
In the past I've developed workflows which relied on a series of REST calls to negotiate the collection or registration of data. Having multiple workflow contexts running in parallel attempting to do the same sequence can create issues in getting data associated with the correct process. Using the lock/unlock provides a convenient method to resolve these points of contention. You must always ensure the unlock activity is processed, including if your workflow throws an exception or times out. Keep the lock/unlock portions to as discreet a level as possible. Do not wrap your entire workflow in a lock/unlock sequence!
Also, it's been my experience on Helsinki that running workflows which encounter a lock set by another context of the same workflow will only check to see if they can proceed (and set their own lock) in 10 min intervals. I haven't tested in later versions. Keep these things in mind if you have processes which can execute on a high number of concurrent contexts. I've been bitten by not paying attention to the potential of workflow activities reaching a timeout condition.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2018 10:10 AM
Thanks William