Packaging Artifacts as CApp

Warning !

This just based on my project example bit more explainable with some sort come I faced when blindly following the prescribed instructions, some time it may not suitable in some cases.But this is somehow useful.


CApp defines the composite apps containing several artifacts related to analytics both real-time and batch analytics. It contains

  1. Event Receivers
  2. Event Streams
  3. Event Publisher
  4. Execution Plans
  5. Event Store
  6. Spark scripts
  7. Gadget
  8. Layout
  9. Dashboard
  10. Data Purging * – Use to purge the data from data store made by event store

We can build the CApp using the .pom file associate with ant build. At the target folder the relative CApp will be build in .car format. We can use the .car file to deploy as Carbon Application at management console level, and Deploy all artifacts included.

Sample build.xml, and pom.xml file are as follows

<?xml version="1.0" encoding="UTF-8"?>
<project name="create-sample-capps" default="zip" basedir=".">

    <property name="project-name" value="${}"/>
    <property name="target-dir" value="target"/>

    <property name="capp_sample_dir" value="sample"/>

    <target name="clean">
        <delete dir="${target-dir}"/>

    <target name="pre-configure">
        <mkdir dir="${target-dir}"/>
        <copy file="README.txt" todir="${target-dir}"/>

    <target name="zip" depends="clean,pre-configure">
        <zip destfile="${target-dir}/${sample}.car">
            <zipfileset dir="${sample}"/>


We can add over own property name and value based on our use cases, capp models. and in the zip we just point relevant parameter to be zipped into the location we want; for general we used to have it on target folder.


<?xml version="1.0" encoding="utf-8"?>
<project xmlns:xsi="" xmlns=""


    <name>WSO2 Data Analytics Server - Sample Composite Applications</name>

                                <ant antfile="build.xml" target="zip"/>

This the pom.xml file for all capps, you need to build this to get capps you want(the capps you preferred at the build.xml file)


To include jaggery-apis with capps we can implement jaggery controller at the level of gadget level rather than jaggery apps level. That will ease our task when we deploying capps.

Reference I looked in,


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s