This page describes how to create artifacts for the Analytics Project. It contains the following sections:
Anaytics plugin currently working only for the CEP (Complex Event Processor) artifacts which are eventstream, eventpublisher, eventreceiver and executionplan. In the future, we plan to extend the functionality of Analytics Plugin for DAS (Data Analytics Server) artifacts.
Creating an Analytics Project
You can create an Analytics Project to save all the Analytics atifacts such as execution-plan,stream,publisher,receiver.
To create an Analytics Project
- Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Analytics Project in the Analytics category.
- If you want to create this Analytics project by Artifacts in Deployment Server, select New Analytics Project By Artifacts in Deployment Server (<CARBON_HOME>/repositary/deployment/server/). Otherwise, leave Create New Analytics Project selected. Click Next.
- Do the following:
Type a unique name for the project.
Optionally specify the working set, if any, that you want to include in this project.
Optionally specify the location where you want to save the project (or leave the default location specified).
If you selected the option to New Analytics Project By Artifacts in Deployment Server in the previous step, click Browse and navigate to the <CARBON_HOME>/repositary/deployment/server/ folder containing the artifact file folders.
- A Maven POM file will be generated automatically for this project. If you want to include parent POM information in the file from another project in this workspace, click Next, click the Specify Parent from Workspace check box, and then select the parent project.
- Click Finish.
- If you specified Deployment Server folder containing the artifact file folders, specify whether you want to open those files now.
The new project has now been created in the workspace. If you browse inside the project, you will see a project structure as below, with folders created for different resources such as execution-plan, publisher, receiver, and stream.
Creating an Execution-plan
WSO2 CEP uses Execution Plans to store event processing logic. An Execution Plan is bound to an instance of the Siddhi complex event processing runtime, which is responsible for the actual processing of the events. The event processor allows users to configure multiple Execution Plans where by providing multiple isolated event processing environments per Execution Plan. A typical Execution Plan consists of a set of queries and related input and output Event Streams.Definitions of the event streams are stored in the file system as deployable artifacts in the <CARBON
_HOME>/repository/deployment/server/executionplans/
directory as .siddhiql files. More
Creating a new Execution-plan
Follow these steps to create a new execution-plan. Alternatively, you can import an existing execution-plan.
- Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Execution-plan in the Analytics category.
- Select Create New Execution-plan and click Next.
- Type a unique name for the Execution-plan.
- Do one of the following:
- To save the execution-plan in an existing Analytics project in your workspace, click Browse and select that project.
- To save the execution-plan in a new Analytics project, click Create new Project and create the new project.
- Click Finish. The execution-plan is created in the execution-plan folder under the Analytics project you specified, and the execution-plan is open in the editor.
Importing an Execution-plan
Follow these steps to import an existing execution-plan from a .siddhiql file into an Analytics project. Alternatively, you can create a new execution-plan.
- Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Execution-plan in the Analytics category.
- Select Import Execution-plan and click Next.
- Type a unique name for the Execution-plan.
- Specify the execution-plan file by typing its full path name or clicking Browse and navigating to the file.
- In the Save Execution-plan In field, specify an existing Analytics project in your workspace where you want to save the execution-plan, or click Create new Project to create a new Analytics project and save the execution-plan there.
- Click Finish. The execution-plan is created in the execution-plan folder under the Analytics project you specified, and the execution-plan is open in the editor.
Creating a Stream
Events are the lifeline of WSO2 CEP/DAS. They not only process data as events, but also interact with external systems using events. Event is a unit of data, and an event stream is a sequence of events of a particular type. The type of events can be defined as an event stream definition.Definitions of the event streams are stored in the file system as deployable artifacts in the <CARBON
_HOME>/repository/deployment/server/eventstreams/
directory as .json files. More
Creating a new Stream
Follow these steps to create a new stream. Alternatively, you can import an existing stream.
- Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Stream in the Analytics category.
- Select Create New Stream and click Next.
- Type a unique name for the Stream.
- Do one of the following:
- To save the stream in an existing Analytics project in your workspace, click Browse and select that project.
- To save the stream in a new Analytics project, click Create new Project and create the new project.
- Click Finish . The stream is created in the stream folder under the Analytics project you specified, and the stream is open in the editor.
Importing a Stream
Follow these steps to import an existing stream from a .json file into an Analytics project. Alternatively, you can create a new stream.
- Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Stream in the Analytics category.
- Select Import Stream and click Next.
- Type a unique name for the Stream.
- Specify the stream file by typing its full path name or clicking Browse and navigating to the file.
- In the Save Stream In field, specify an existing Analytics project in your workspace where you want to save the stream, or click Create new Project to create a new Analytics project and save the stream there.
- Click Finish. The stream is created in the stream folder under the Analytics project you specified, and the stream is open in the editor.
Creating a Publisher
Event publishers publish events via various transport protocols.Event publisher configurations are stored in the file system as deployable artifacts in the <CARBON
_HOME>/repository/deployment/server/eventpublishers/
directory as .xml files. More
Creating a new Publisher
Follow these steps to create a new publisher. Alternatively, you can import an existing publisher.
- Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Publisher in the Analytics category.
- Select Create New Publisher and click Next.
- Type a unique name for the Publisher.
- Do one of the following:
- To save the publisher in an existing Analytics project in your workspace, click Browse and select that project.
- To save the publisher in a new Analytics project, click Create new Project and create the new project.
- Click Finish. The publisher is created in the publisher folder under the Analytics project you specified, and the publisher is open in the editor.
Importing a Publisher
Follow these steps to import an existing publisher from an XML file into an Analytics project. Alternatively, you can create a new publisher.
- Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Publisher in the Analytics category.
- Select Import Publisher and click Next.
- Type a unique name for the Publisher.
- Specify the publisher file by typing its full path name or clicking Browse and navigating to the file.
- In the Save Publisher In field, specify an existing Analytics project in your workspace where you want to save the publisher, or click Create new Project to create a new Analytics project and save the publisher there.
- Click Finish. The publisher is created in the publisher folder under the Analytics project you specified, and the publisher is open in the editor.
Creating a Receiver
Events are received by WSO2 CEP/DAS server using event receivers, which manage the event retrieval process. Event receiver configurations are stored in the file system as deployable artifacts in the <CARBON
_HOME>/repository/deployment/server/eventreceivers/
directory as .xml files. More
Creating a new Receiver
Follow these steps to create a new receiver. Alternatively, you can import an existing receiver.
- Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Receiver in the Analytics category.
- Select Create New Receiver and click Next.
- Type a unique name for the Receiver.
- Do one of the following:
- To save the receiver in an existing Analytics project in your workspace, click Browse and select that project.
- To save the receiver in a new Analytics project, click Create new Project and create the new project.
- Click Finish. The receiver is created in the receiver folder under the Analytics project you specified, and the receiver is open in the editor.
Importing a Receiver
Follow these steps to import an existing receiver from an XML file into an Analytics project. Alternatively, you can create a new receiver.
- Open the Developer Studio Dashboard (click Developer Studio > Open Dashboard) and click Receiver in the Analytics category.
- Select Import Receiver and click Next.
- Type a unique name for the Receiver.
- Specify the receiver file by typing its full path name or clicking Browse and navigating to the file.
- In the Save Receiver In field, specify an existing Analytics project in your workspace where you want to save the receiver, or click Create new Project to create a new Analytics project and save the receiver there.
- Click Finish. The receiver is created in the receiver folder under the Analytics project you specified, and the receiver is open in the editor.
Deploying the Analytics Project
Once you create the Analytics Project with atifacts such as execution-plan,stream,publisher and receiver, you can create a Composite Application Project to group them and create a Composite Application Archive. Before creating the CAR file, make sure to change the server role of the created bundle to ComplexEventProcessor. To deploy it to WSO2 Complex Event Processor (CEP), you need to change it to the correct server role.
For more information, see Packaging Artifacts Into Deployable Archives.