|
It can be useful to know in an automation if a person has locked their workstation or if the network is no longer available or if the network has been restored. For instance, many call centers require when an agent leaves their desk and often additional actions are necessary such as indicating that the agent’s status is away. This is done using the Microsoft.Win32.SystemEvents class.
There are many events besides what is shown below. Some other events are low memory indication, and network availablity. It also allows an automation to see the power mode changing such as when a laptop is suspended/hibernated or resumed. You can even detect a person logging off or shutting down and then cancel it.
The SessionSwitch event below gives an indication for user’s on a system as well as remote access into a system. Using this event, you can auto-logout someone from an application if they lock their station or conversely, start actions to keep them logged in while they are locked.
To do this, you add the System.dll from the global assembly cache into the toolbox by right-clicking the toolbox and selecting the Add/Remove option from the context menu. A dialog (below) appears and you can choose which events you will use by selecting the Static Members tab and scrolling down to the the SystemEvents class.

You then open the SystemEvents item and you will see a list of events that you can use in an OpenSpan Automation. Check the ones you want to have available.
Once you’ve selected the events and closed the Add/Remove dialog, the events will be in the Toolbox Tab you started from. You can create new tabs and drag and drop items into other tabs to organize them. Below you can see an image where a tab called System Events was created and some events placed in it.

Once the events are in the toolbox, you use them like any other Openspan toolbox member by dragging it onto an automation like the sample below. You will need to click on the arrows at the top right corner of the event on the automation to see its parameters.

There are many other events in the SystemEvents static members. By including them into the toolbox, you can use them within your OpenSpan automations.
|