This documentation is for WSO2 Business Activity Monitor 2.0.0. View documentation for the latest release.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 16 Next »

A toolbox can contain the below main three artifacts.

  • Stream definitions
  • Analytics
  • Dashboard components and/or reports.

All three artifacts are not mandated, and they are optional. You can have all of three artifacts or either of them in one toolbox. And only those artifcats will be deployed.

You can install the custom toolbox by following the steps in Installing custom toolbox.

Structure of Toolbox

Toolbox artifacts should be placed in the as shown in the below structure

Analytic Artifacts

As shown in the structure the analytics scripts (Eg: Hive script) should be placed under analytics folder under toolbox. All the scripts which are placed under the analytics folder will be deployed. And if you ant to schedule the script then you have to include analyzers.properties file such as following.

The following are the properties which you have to include in the analyzers.properties file if you want to include 'my_script' and 'my_another_script' to the toolbox.

analyzers.scripts=script1, script2

 

analyzers.scripts.script1.filename=my_script

analyzers.scripts.script1.description=Description about my script

analyzers.scripts.script1.cron=1 * * * * ? *

 

analyzers.scripts.script2.filename=my_another_script

analyzers.scripts.script2.description=Description about my another script

analyzers.scripts.script2.cron=1 * * * * ? *

 

As shown above the linking the analyzer script to the toolbox occurs through 'analyzers.scripts.script1.filename' property, the script1 is the reference element to a script.

The cron property is optional, if you want to schedule the script then you should mention it in this property file. As shown in the above both scripts are scheduled with cron expression '1 * * * * ? *'. If you don't want to schedule the script to run, then simply you can avoid having the property for that particular script in the analyzers.properties file.

 

Stream Definition Artifacts

As shown in the structure of the toolbox, the stream definitions should be placed under streamDefn folder. The stream definitions are the definitions of your data stream which is published to BAM. You can have any number of stream definitions within one toolbox, but each of those are needed to defined under different files.

For example, if you are publishing your data with stream below stream definition,

{
                   'name':'org.wso2.bam.mystream',
                   'version':'1.0.0',
                   'nickName': 'My_Stream',
                   'description': 'This is the stream definition which I'm using to send data to bam',
                   'metaData':[
                           {'name':'clientType','type':'STRING'}
                   ],
                   'payloadData':[
                           {'name':'my_field_1','type':'STRING'},
                           {'name':'my_field_2','type':'INT'},
                           {'name':'my_field_3','type':'INT'},
                           {'name':'my_field_4','type':'STRING'}
                   ]
}

Then, this stream definition needed to be copied into a file, and placed under the streamDefn folder. (Here the file name is not important, it'll be ignored, only the content of the files are important).

 

Dashboard Artifacts

As shown in the toolbox structure the dashboard artfacts should be placed under the dashboard directory. Dashboard artifcats can be for Gadget Dashboard  or Jasper Dashboard or both artifacts.

You need to have the respective artifacts for the dashboard which you are going to visualise your data. The below section will describe how to include the those artifctas in the toolbox.

 

Gadget Dashboard Artifacts

Gadget Dashboard related artifacts are given below.

As shown in above the all gadget xmls which you are going to include in the dashboard should be placed under the gadgets folder. And also the if you have any css and js files, that also need to placed under the gadget directory. 

If you are using any jaggery files in your gaget xmls, then you have to place the jasggery files in the jaggery folder within dashboard folder. All these jaggery files will be deployed in the WSO2 BAM server.

Finally the dashboard tabs, and gadgets for the tabs should be mentioned in the dashboard.properties file. Accroding to what you have mentioned in the dashboard.propertied file, the gadgets and tabs will be organised in the gadget dashboard.

Assume you have a gadget xmls as My_Gadget_1.xml, My_Gadget_2.xml, My_Gadget_3.xml, My_Gadget_4.xml under the gadgets folder. And you are want to add My_Gadget_1.xml, My_Gadget_2.xml in first tab, and My_Gadget_3.xml, My_Gadget_4.xml to the second tab. Then the dashboard.properties should be as follows.

 

dashboard.tabs=tab1, tab2

dashboard.tabs.tab1.name=Tab-1 Title

dashboard.tabs.tab1.gadgets=My_Gadget_1.xml, My_Gadget_2.xml

dashboard.tabs.tab2.name=Tab-2 Title

dashboard.tabs.tab2.gadgets=My_Gadget_3.xml, My_Gadget_4.xml

 

Here similar to anayzers.properties file the tab1, tab2 are reference in the properties. And 'dashboard.tabs.tab1.name' denotes the title of tab denoted by the reference tab1. And tab1, will have the gadgets My_Gadget_1.xml, My_Gadget_2.xml in the indicated order.

Similarly for the tab2, the title is 'Tab-2 Title' and the gadgets will be My_Gadget_3.xml, My_Gadget_4.xml in the mentioned order.

 

Jasper Dashboard Artifacts

Jasper Dashboard related artifacts are given below.

As shown above all the jrxml files that you would like to include in the jasper dashboard should be placed under the jasper directory. and you have to link the jrxml file to the toolbox via the jasper.properties file.

And also if you want to access the database via jrxml file then you have to provide the datasuorce configuration xml file, which also should be placed under the dashboard directory and included in the jasper.properties file.

 

Assume you have My_Jasper.jrxml file in the jasper folder. And you are using the My_Datasource.xml configuration file which consists of the connection parameters, etc to the datasource as given below.

<configuration>
   <url>jdbc:h2:repository/database/samples/ot/WSO2CARBON_DB;AUTO_SERVER=TRUE</url>
   <username>wso2carbon</username>
   <password>wso2carbon</password>
   <driverClassName>org.h2.Driver</driverClassName>
   <maxActive>50</maxActive>
   <maxWait>60000</maxWait>
   <testOnBorrow>true</testOnBorrow>
   <validationQuery>SELECT 1</validationQuery>
   <validationInterval>30000</validationInterval>
</configuration>

for the above scenario, the jasper.properties should be as follows.

jasper.tabs=tab1

jasper.tabs.tab1.name=My Jasper Tab Title

jasper.tabs.tab1.jrxml=My_Jasper.jrxml

datasource=MyDataSource

datasource.configuration=My_Datasource.xml

According to the above configuration, there will be one tab and the title of that tab will be 'My Jasper Tab Title' and associated jasper file is 'My_Jasper.jrxml'. The datasource configuration is provided by 'datasource.configuration' property.

Packing Toolbox

After including all required artifacts as described above in a directory, finally you need to make it as .zip file and change the extension to .tbox.

The name of the .tbox is taken as the name of toolbox. Further more now you are ready to install your toolbox, and you can install the toolbox by following the steps in Installing custom toolbox.

 

  • No labels