Use the instructions in the following sections to monitor a business process with WSO2 Data Analytics Server (DAS).
Business process data can be monitored with WSO2 DAS. In order to specify which configuration and data is to be monitored, BPS uses a configuration file called AnalyticsProfile. This file is included within the BPEL package.
Configure the DAS publishing extension
Add the following extensionActivity
to the bps.xml
file, which is located in the <BPS_HOME>/repository/conf/
directory.
<tns:ExtensionBundles> <tns:runtimes> <tns:runtime class="org.wso2.carbon.bpel.analytics.publisher.AnalyticsPublisherExtensionBundle"/> </tns:runtimes> </tns:ExtensionBundles>
Create the BPEL process to publish data to DAS
To create the BPEL process, do the following.
Configure the deployment descriptor
In order to specify the server configuration details, and monitoring data (Payload, Correlation and Meta), BPS uses an XML configuration file. This configuration file must specify the BPEL process in the deploy.xml
file (deployment descriptor file for a BPEL package). The analytics server profile is specified as follows:
<analyticsServerProfiles> <profile name="AnalyticsServerProfile" location="file:AnalyticsServerProfile.xml"/> </analyticsServerProfiles>
The analyticsServerProfiles
element must come under the process element in deployment descriptor (deploy.xml). The following is an example of a deployment descriptor configuration.
<deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03" xmlns:SalesData="http://www.samples.wso2.org/bps/SalesData/" xmlns:samples.bps.wso2.org="http://samples.bps.wso2.org"> <process name="samples.bps.wso2.org:KPISampleProcess"> <active>true</active> <retired>false</retired> <process-events generate="all"/> <provide partnerLink="client"> <service name="samples.bps.wso2.org:KPISampleProcess" port="KPISampleProcessPort"/> </provide> <analyticsServerProfiles> <profile name="AnalyticsServerProfile" location="file:AnalyticsServerProfile.xml"/> </analyticsServerProfiles> </process> </deploy>
The ‘file:
‘ value in location
is used to specify a file path. Similarly, the analytics server profile can be kept in the WSO2 registry as well. If the Analytics server profile file is stored in configuration registry, it can be referred to as conf:<resource path>
. Similarly, if the Analytics server profile is stored in the Governance Registry, it can be referred to as gov:<resource path>
.
Create the Analytics server profile
Analytics server profile is an XML file with the following structure.
<ServerProfile name=””> <Connection/> <Credential/> <Streams> <Stream/> ... ... <Stream/> </Streams> </ServerProfile>
The Connection
element is used to describe the analytics server information. The Credential
element describes the authentication info to authenticate to the analytics server. Under the Streams
element, many analytics streams can be defined. The following is the structure for an analytics stream definition.
<Stream name="org.wso2.bam.phone.retail.store.kpi" version="1.0.0" nickName="Phone_Retail_Shop" description="Phone Sales"> <Data> <Key name="brand" type="payload"> <From variable="brand"/> </Key> <Key name="quantity" type="payload"> <From variable="quantity"/> </Key> <Key name="user" type="payload"> <From variable="user"/> </Key> <Key name="total" type="payload"> <From variable="total"/> </Key> </Data> </Stream>
A DAS Stream
definition must have the properties: ‘name
’, ‘version
’, ‘nickName
’ and ‘description
’. Under the Stream
element, each of the data items published to the analytics server is specified using the Data
element.
<Data“> <key name=”” type=”payload | meta | correlation”> <From variable=”quantity”/> </key> <Data>