Apama 10.15.0 | Building and Using Apama Dashboards | Building Dashboard Clients | Defining Dashboard Commands | Defining commands for creating an instance
 
Defining commands for creating an instance
To add the Create function to a dashboard, you need to add control objects such as text fields and check boxes to the dashboard to prompt the user for the values of input variables. You need to then create dashboard variables to hold the values of the control objects and the objects bound to the variables through their varToSet property.
You next need to add a control object, such as a push button, to the dashboard to perform the command. In the Define Apama Command dialog, select the command Create DataView instance and use the dashboard variables as the values for the variables.
*To define commands for creating a DataView instance
1. Open the file tutorial-create.rtv by selecting Create Instance in the tutorial main page.
2. Double-click the object labeled Test to display the dashboard in a new window such that the control objects are enabled.
This dashboard displays a summary table of all instances of the tutorial DataView and a form for creating new instances.
3. In the form enter APPL for the Instrument and 100 for the Clip Size and click the Create button. This will create a new instance.
This dashboard has the dashboard variables $instrument and $clipSize defined. The text fields are bound to these such that the variables are set when text is entered in the fields. The actionCommand property for the Create button is set to perform the Create command and use the value of the variables as command parameters.
4. Select the Create button and in the properties panel double-click the actionCommand property.
If the test window appears, you need to first close it so that you can select Create button in the Dashboard Builder main window.
Here the command is defined to create an instance of the tutorial DataView on the default correlator. You can see that the values for the input variables Instrument and Clip Size are set to the value of the dashboard variables $instrument and $clipSize.
When creating an instance, you must specify a value for each of the input variables. If you do not, you will receive an error when you try to perform the command.