Question
IBM
IN
Last activity: 13 Feb 2018 5:53 EST
Automate Message Box By Pega Robotics
Hi,
Can Anyone suggest a method how to automate message box generated by Message Dialog component(That is i just want the message box to appear for few second and then disappear ) ..
Please find the attachment.
Thanks and Regards,
Akash Kumar
***Edited by Moderator Marissa to update categories***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
US
You cannot do this with the MessageDialog. You'd need to create a Windows form (we'll call this the dialog form) and then call the Hide method after a few seconds. I would use a Parallel Process. On one one thread, show the dialog form, on the other, call SignalWait (add a SignalComponent to the GlobalContainer). On the completion of both threads, you would continue. On the SignalWait thread, wait for the amount of time that you'd like the dialog visible. If it returns true, do nothing. If it returns false, call the Hide() method of the form.
On a separate automation, use the VisibleChanged event of the dialog form to check its Visible property. If Visible is false, call the SignalAll() method of the Signal component (this will release anything waiting on it and have those return True).
Pegasystems Inc.
US
You can spawn the message and use a timer to wait for a few seconds, then kill it.
IBM
IN
But how can i spy the message as its generated by pega robotics iteself(I want that to be automated)
Standard Chartered Global Business Services
IN
I'm not sure how we can close the Message from Message Dialog component. However, why not create a custom message (using window form) and close it when required?
Accepted Solution
Pegasystems Inc.
US
You cannot do this with the MessageDialog. You'd need to create a Windows form (we'll call this the dialog form) and then call the Hide method after a few seconds. I would use a Parallel Process. On one one thread, show the dialog form, on the other, call SignalWait (add a SignalComponent to the GlobalContainer). On the completion of both threads, you would continue. On the SignalWait thread, wait for the amount of time that you'd like the dialog visible. If it returns true, do nothing. If it returns false, call the Hide() method of the form.
On a separate automation, use the VisibleChanged event of the dialog form to check its Visible property. If Visible is false, call the SignalAll() method of the Signal component (this will release anything waiting on it and have those return True).
IBM
IN
Hi Sasant,
Can You Please Share the flow diagram
-
Ashish Kumar Roopa Seeri
Pegasystems Inc.
US
Here you go.
Standard Chartered Global Business Services
IN
Thanks, Thomas. Learnt something new today! :)
IBM
IN
Thanks Sasnt really learnt a new thing.
Pegasystems Inc.
US
As Thomas indicated, the MessageDialog uses the ShowDialog method to be shown which blocks the thread. If you want to suspend action ShowDialog is the way to go. If you are just wanting to provide information but allow the user to work, then use the Show method on a form as suggested. Either way, you have complete control when you use a Form instead of the MessageDialog.
An alternate way to close the form would be to place a timer on the form. On VisibleChanged (Visible=true) start the timer and on the Tick event hide the form if you used Show or set the DialogResult if you used ShowDialog and then stop the timer.