Creating a Display That Adds Security Users
This example builds a GraphWorX display where an operator enters a user name and a password and selects a button to create a Security user. The display hashes the password before the command sends it, and a message on the display says whether the command created the user.
The Configure Security command shows nothing in runtime when it fails, and it returns no values that a later command can read. To give feedback, the button runs a Batch command. Its first step runs Configure Security, and the next step depends on whether that step succeeded or failed. Each of those steps uses Set Value to put a message in a local simulation tag that the display shows. Local simulation tags belong to the client, so each operator sees only the result of their own click.
To create a display that adds Security users:
-
In GraphWorX, select the display canvas or grid, and in the Properties panel, in Name, enter a name for the display, such as AddUserDisplay.
-
Go to the Dynamics ribbon and add a Data Entry process point to the display. In the Data section of its Dynamics panel, set the DataSource to localsim::NewUserName:String.
-
Add another data entry point for the password and set the following in its Dynamics panel:
-
In DataSource, enter localsim::NewUserPassword:String.
-
In the Dynamic Behavior section of the password data entry point's Dynamics panel, set these properties:
Property
Value
Password
True
PasswordHashing
Password-Based Key Derivation Function 2
-
-
Add a process point for the message and set its DataSource to localsim::SecurityResult:String.
-
Add a button for executing the command and set the following in its Dynamics panel:
-
In the Dynamic Behavior section, select Command, expand the drop-down list, and select Batch in the Global Commands section.
-
In CommandParameters, select Steps and click
to open the configuration.
-
-
In the Configure dialog, click
and add three steps with the following names and confiturations.-
Configure
-
Set Command to Configure Security.
-
Enter its parameters:
Parameter
Value
Action
CreateUser
UserName
{{localsim::NewUserName:String}}
Group
Optional: A group the new user should belong to
Policy
Blank, for the default account policy
Password
{{localsim::NewUserPassword:String}}
IsPasswordHash
True
-
In Continue With, set On Success to Go to step 'Success' and On Fail to Go to step 'Failure'.
-
-
Success
-
Set Command to Set Value.
-
Enter its parameters:
Parameter
Value
PointName
localsim::SecurityResult:String
ValueType
String
Value
A success message, such as x="The user was created."
Target
The name of the display, such as AddUserDisplay.
-
In Continue With, set both On Success and On Fail to Quit.
-
-
Failure
-
Set the same parameters as for the Success step, with a failure message in Value, such as: x="The user was not created."
-
In Continue With, set both On Success and On Fail to Quit.
-
-
-
When finished, click OK to save and close the configuration, and then switch to the runtime mode.
-
In runtime, enter a user name and a password and click the command button. The message shows whether the command created the user.