Info |
---|
To view a screencast of the Quick Start Guide, click here . |
...
- Log into the DAS Management Console and click on the Main tab. Under Manage, click Publishers to open the Available Publishers page.
- Click Add Event Publisher to open the Create a New Event Publisher page.
Enter information as follows to create the new event publisher named UIPublisher
.
Parameter Name | Description |
---|
Event Publisher Name | uiPublisher |
Event Source | org.wso2.event.sensor.filtered.stream:1.0.0 |
Output Event Adapter Type | ui |
Message Format | wso2event |
Click Add Event Publisher to save the information.
Step 9: Create a dashboard and a gadget
WSO2 Analytics Dashboard will be used as the tool to analyse the output of the event flow you created in this guide. This step creates a dashboard and a gadget which analyses events from the org.wso2.event.sensor.filtered.stream
stream published by the uiPublisher
publisher.
- Log into the DAS Management Console. In the Main tab, click Analytics Dashboard.
- Log into the Analytics Dashboard with your username and password.
- Click the menu icon and then click Gadgets to open the Gadgets page as demonstrated below.
Image Modified - Click GENERATE GADGET, and enter values in the Generate a Gadget wizard as follow.
Image Modified
- In the Select Provider field, select Realtime Data Source . Then click Next .
- In the Event Stream field, select org.wso2.event.sensor.filtered.stream:1.0.0 . Then click Next.
Configure a chart as follows.
Parameter Name | Value |
---|
Gadget Name | Sensor Value VS Timestamp |
Select Chart Type | Line Chart |
X-Axis | TIMESTAMP |
X type | time |
Y-Axis | sensorValue |
Y type | default |
Color domain | sensorName |
Max length | 30 |
- Click Add to Store, and then click Go to Portal. the Dashboards page appears again.
- Click CREATE DASHBOARD to open the Create a Dashboard page. Configure a new dashboard as follows.Image Modified
Enter a name and a description for the new dashboard as follows, and click Next.
Parameter Name | Value |
---|
Name of your Dashboard | Sensor Statistics |
Description | This dashboard indicates the sensor value at different times in a particular location. |
- Select the Single Column layout. A message appears to indicate that the dashboard is successfully created.
- Click the icon for gadgets. Then select and drag Sensor Value VS Timestamp gadget to the first column as demonstrated above.
Step 10: Send Events to the HTTP Receiver via Curl Command
...
Element | Type | Role |
---|
httpReceiver | Event Receiver | Receives DAS events in multiple formats and converts them all into the WSO2 Event format before forwarding them to the org.wso2.event.sensor.stream:1.0.0 event stream. |
org.wso2.event.sensor.stream:1.0.0: | Event Stream | Defines the attributes on which selection of events to be processed by the event flow is based. |
loggerPublisher | Event Publisher | Logs events from the org.wso2.event.sensor.stream:1.0.0 event stream in the DAS CLI.ExecutionPlan |
SensorStatistics-FilterSensorValues | Execution Plan | Applies a filter criteria to events in the org.wso2.event.sensor.stream:1.0.0 event stream and | forwards directs the filtered events to org.wso2.event.sensor.filtered.stream:1.0.0 event stream | .SensorStatistics-FilterSensorValues | Execution Plan | This is an execution plan created from a template. |
org.wso2.event.sensor.filtered.stream:1.0.0 | Event Stream | Imports attributes from the org.wso2.event.sensor.stream:1.0.0 event stream and receives events filtered from that event stream by the execution plan. |
uiPublisher | Event Publisher | Publishes events from the org.wso2.event.sensor.filtered.stream:1.0.0 event stream in the Analytics Dashboard. |
Panel |
---|
Deploying the sample C-AppYou can deploy artifacts (i.e. event streams, event receivers, Spark scripts, event publishers, and dashboards etc.) as composite Carbon Applications (C-Apps) in WSO2 DAS. This guide uses the SMART_HOME.car file as the toolbox which contains all the artifacts required for this guide in a single package. For more information on C-Apps, see Packaging Artifacts as a C-App Archive. Follow the steps below to deploy and use a sample C-App in WSO2 DAS. - Log in to the DAS management console using the following URL:
https://<DAS_HOST>:<DAS_PORT>/carbon/ - Click Main, and then click Add in the Carbon Applications menu.
- Click Choose File, and upload the
<DAS_HOME>/capps/Smart_Home.car file as shown below. - Click Main , then click Carbon Applications, and then click List view, to see the uploaded Carbon application as shown below.
Tip |
---|
You can use the Event Flow feature of WSO2 DAS to visualize how the components that you created above are connected with each other. Also, you can use it for verification purposes i.e. to validate the flow of the events within the DAS as shown below. Image Modified
|
Publishing events Once you develop the complete Event Flow, you can test the flow by publishing the events to the DAS. There are several methods of publishing to DAS. In this section, the events are published via a log file. Navigate to <DAS_HOME>/samples/smart-home/ directory in a new CLI tab, and execute the following command to run the data publisher: ant Info |
---|
This executes a Java client based on the <DAS_HOME>/samples/smart-home/src/main/java/org/wso2/carbon/das/smarthome/sample/SmartHomeAgent.java file. This Java client generates random events and sends them to the event stream that is deployed through the Smart_Home.car file. |
Viewing the outputFollow the steps below to view the presentation of the output in the Analytics Dashboard. Log in to the Management console, if you are not already logged in. Click Main , and then click Analytics Dashboard in the Dashboard menu. Log in to the Analytics Dashboard, using admin/admin credentials. Click the DASHBOARDS button in the top menu. The dashboard deployed by the C-App is displayed as shown below. Click the View button of the corresponding Dashboard. The following charts are displayed.
Tip |
---|
Follow the steps below to undeploy the C-App, which you already uploaded in this section before proceeding to the next sections. - Log in to the DAS Management Console using
admin/admin credentials, if you are not already logged in. - Click Main, then click Carbon Applications, and then click List view, to see the uploaded Carbon application.
- Click on the Delete option to delete the Carbon application as shown below.
- Refresh the Web browser screen, and check if the
SMART_HOME.car file has beed removed from the list of all available C-Apps.
|
|
...