Question
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Anthem
US
Last activity: 6 Nov 2018 20:02 EST
Openspan lock and signal
Please send a example for lock and signal objects with screenshot
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-05/e90c12b7-5a50-45b6-9408-8644c06fabca.jpg?h=9bedb0c7&itok=I_lzpbin)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-05/e90c12b7-5a50-45b6-9408-8644c06fabca.jpg?h=9bedb0c7&itok=I_lzpbin)
Pegasystems Inc.
US
Is your signal local in Scope? Make sure it is Global or place it in a Global Container. Also, I assume both buttons are on the same windows form. If so, your Click events need to be set to asynchronous or the UI thread will be blocked while those steps are executing. That will prevent you from clicking button 2 until the signal for button 1 has timed out.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689973000/3a78fee4-a7e7-4a05-b0f7-356e3689e691.png?itok=nN1zP2KU)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689973000/3a78fee4-a7e7-4a05-b0f7-356e3689e691.png?itok=nN1zP2KU)
Pegasystems Inc.
US
http://help.openspan.com/80/Components/How_to_use_the_Signal_component.htm
http://help.openspan.com/80/Components/How_to_Use_the_Lock_Component.htm
Updated: 4 Aug 2017 16:47 EDT
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-05/e90c12b7-5a50-45b6-9408-8644c06fabca.jpg?h=9bedb0c7&itok=I_lzpbin)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-05/e90c12b7-5a50-45b6-9408-8644c06fabca.jpg?h=9bedb0c7&itok=I_lzpbin)
Pegasystems Inc.
US
The signal component allows you to wait for a signal in one thread and trigger the signal in another. A good use case for the signal is for a situation where you need to wait for a control to be created or another control to be destroyed. Without a signal, you can't really wait for both of those events at the same time. You could use the Created/Destroyed events for those controls to trigger the signal (SignalOne method or SignalAll) and call Wait on the Signal component in your automation where you need to detect either of those events.
The lock is somewhat outdated and is mostly replaced by the InteractionFramework. It allows you to "hold" a thread at the lock so only one can go through at a time. Basically, the same as Activities in the Interaction Framework. In the past, you might use it off of a UI event to prevent your automations from launching twice on top of one another.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Anthem
US
Hi,
Thank you for your replies. From the help what I understand is,
signalwait wait for n seconds(that we specified). if the Signalone occured within n seconds, it will go to True path otherwise False path. But my understanding is wrong.
I tried the attached example. It always went to false path regardless of signal after n seconds. Please let me know what I missing?
Accepted Solution
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-05/e90c12b7-5a50-45b6-9408-8644c06fabca.jpg?h=9bedb0c7&itok=I_lzpbin)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-05/e90c12b7-5a50-45b6-9408-8644c06fabca.jpg?h=9bedb0c7&itok=I_lzpbin)
Pegasystems Inc.
US
Is your signal local in Scope? Make sure it is Global or place it in a Global Container. Also, I assume both buttons are on the same windows form. If so, your Click events need to be set to asynchronous or the UI thread will be blocked while those steps are executing. That will prevent you from clicking button 2 until the signal for button 1 has timed out.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Anthem
US
Thank you. I understood now
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Anthem
US
can you please give a example for this question
https://collaborate.pega.com/question/openspan-message-manifest
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Anthem
US
If the lock is called in a automation, what it will lock? will it lock the target application? My target web application is freezing when I use robotics. is this because of the lock I used?
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-05/e90c12b7-5a50-45b6-9408-8644c06fabca.jpg?h=9bedb0c7&itok=I_lzpbin)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-05/e90c12b7-5a50-45b6-9408-8644c06fabca.jpg?h=9bedb0c7&itok=I_lzpbin)
Pegasystems Inc.
US
What are you trying to use the lock for? It is not commonly used any longer, so I would caution against it unless you have a specific need. It merely holds a thread in-place until the lock has been released. The ReleaseLock must be called on the same thread as RequestLock, or the component will never allow another thread through.