cancel
Showing results for 
Search instead for 
Did you mean: 

Getting beyond HelloWorld and demo.start

gregorypierce
Champ in-the-making
Champ in-the-making
I'm about to set up Activiti for more of a "production" usage, but there isn't anything that really speaks to how to set things up for this. All of the ant scripts assume that it needs to download tomcat and then it creates all sorts of demo things in the database schema. What I'm trying to do is take this application and deploy it into an existing tomcat container and tell activiti to set up its schema with no sample data.

Is there documentation on this?
4 REPLIES 4

jbarrez
Star Contributor
Star Contributor
Activiti is just a jar. The demo setup is what is says it is: a setup that shows what is possible.

What do you want: put the demo webapps in production (not really intended for that)? Or create your own webapp using Activiti as a jar. In the latter case, there is nothing spectacular: just add the Activiti jar to your webapp and you're ready to go.

gregorypierce
Champ in-the-making
Champ in-the-making
What I'm really looking to do is

1) Deploy the REST API web applications (probably modify them later since they are unsecured)
2) Deploy the database schema necessary for Activiti to function (unless it will do that on its own)
3) Deploy the Activiti wars necessary for the modeler, explorer, etc.

I definitely don't want to deploy any of the example stuff. I was hoping there would be an ant build.production or similar ant target that would drop into a dist directory a set of .war files.

In essence I'm looking for how you guys intended people to use this thing in a production environment. The only thing in the documentation is ant demo.start or explosion of the examples. Need something for production deployment.

yangyang_qian
Champ in-the-making
Champ in-the-making
I'm about to set up Activiti for more of a "production" usage, but there isn't anything that really speaks to how to set things up for this. All of the ant scripts assume that it needs to download tomcat and then it creates all sorts of demo things in the database schema. What I'm trying to do is take this application and deploy it into an existing tomcat container and tell activiti to set up its schema with no sample data.



2) Deploy the database schema necessary for Activiti to function (unless it will do that on its own)

Oh hey  Smiley Happy  we're also trying to get our home-built webapp into production as well … but not using REST or anything … we're kind of winging it & learning as we go along …

We started off by just added the Activiti jar to our webapp's WEB-INF/lib folder as if it were just another library. Then followed the User Guide's advice on how to initiate the engine with the ServletContextListener technique. As for the database, we couldn't figure out how to build the tables properly by hand, so we just adapted the ant script provided in the download / demo to point to our production database … specifically we used   ant db.create    and   ant db.drop    to create the clean tables.

gregorypierce
Champ in-the-making
Champ in-the-making
I've made it a little bit further than you guys so I will share my changes. By and large the existing config for ant is a non-starter unless you are installing everything as root, a situation you will not find in production. In fact you'll have issues with a lot of this just installing in ubuntu on EC2 which is where I'm pushing my install.

Based upon this here are some of the changes I made.

First, I needed to separate installation of tomcat from the installation of Activiti. From an operations perspective this is a requirement as the container needs to be managed outside the activiti directory:


# The db property should refer to the type of database that
# you want to use. Currently h2, MySQL(mysql),
# Postgres SQL(postgres) and Oracle 10g (oracle) is supported.
#
# SQL Server(mssql) is also supported, but is an EXPERIMENTAL feature.
# IBM DB2(db2) is also supported, but is an EXPERIMENTAL feature.
#
# When using oracle, follow the instructions described in the userguide, chapter
# Configuration > Changing the database > Using Oracle in the demo setup
db=mysql

# The tx property refers to the transaction environment
# you want to use.  Choose from {standalone}
tx=standalone

# Specify the version of Tomcat that you want to use.
# We only tested with the given Tomcat version but in
# theory any tomcat 6.0.x version should do fine.
tomcat.version=6.0.32

# If you have tomcat already downloaded, point the
# downloads.dir property to that directly.  If tomcat is
# not found in the downloads.dir, it will be automatically
# downloaded there.
# The downloads directory should be outside of /target/
# to avoid re-downloading after a clean
downloads.dir=../../downloads

install.dir=/Users/gpierce/

# Remove this property or set it to disabled if you're not using Activiti Cycle
feature.cycle=enabled

# Remove this property or set it to disabled if you're not using Activiti Modeler
feature.modeler=enabled

The biggest change here is the introduction of an install.dir property. This is where the application is installed (i.e. where the tomcat instance should be living).

After that I made some wholesale changes to the build.xml. Some things were just redundant and error prone (like having the tomcat.version all over the place). Other things needed to be vastly modified to support splitting out Activiti from the database and from the Tomcat container.


<?xml version="1.0" encoding="UTF-8"?>

<project name="activiti.setup" default="demo.start">
 
  <!– ### PROPERTIES #################################################################### –>

  <property file="${user.home}/.activiti/build.properties" />
  <property file="build.properties" />
  <property file="build.${db}.properties" />

  <property name="activiti.home" value=".." />
  <property name="activiti.version" value="5.4" />  
  <property name="tomcat.url" value="http://activiti.org/downloads/" />
 
  <property name="cycle.workspace" location="${activiti.home}/workspace/activiti-cycle-examples"/>
  <property name="activiti.modeler.base.url" value="http://localhost:8080/activiti-modeler/" />

  <!– ### OS PROPERTIES #################################################################### –>
 
  <condition property="is.windows">
    <os family="Windows"/>
  </condition>
 
  <condition property="is.not.windows">
    <not>
      <os family="Windows"/>
    </not>
  </condition>
 
  <condition property="cycle.is.enabled">
    <equals arg1="${feature.cycle}" arg2="enabled" />
  </condition>
 
  <condition property="modeler.is.enabled">
    <equals arg1="${feature.modeler}" arg2="enabled" />
  </condition>
 
  <!– ### CFG #################################################################### –>

  <target name="cfg.create"
          description="Creates a build/activiti-cfg/activiti.cfg.xml and build/activiti-cfg.jar as specified by the build.properties">
    <mkdir dir="${activiti.home}/setup/build/activiti-cfg" />
    <copy todir="${activiti.home}/setup/build/activiti-cfg" overwrite="true">
      <filterset filtersfile="build.${db}.properties" />
      <fileset dir="files/cfg.activiti/${tx}" />
    </copy>
    <zip destfile="${activiti.home}/setup/build/activiti-cfg.jar">
      <fileset dir="${activiti.home}/setup/build/activiti-cfg" />
    </zip>
   <echo message="copying configuration to ${activiti.home}/workspace/activiti-engine-examples/src/main/config" />
    <mkdir dir="${activiti.home}/workspace/activiti-engine-examples/src/main/config" />
    <unzip src="${activiti.home}/setup/build/activiti-cfg.jar" dest="${activiti.home}/workspace/activiti-engine-examples/src/main/config" />
    <replace file="${activiti.home}/workspace/activiti-engine-examples/src/main/config/activiti.cfg.xml">
      <replacetoken><![CDATA[<!– Database configurations –>]]></replacetoken>
      <replacevalue><![CDATA[<!–
    This configuration file is used by the deploy target
    in the build.xml in the root of the activiti-engine-examples
    project
   
    This configuration is generated by the setup script
    If you run the cfg.create target in the setup, keep
    in mind that this file might be overwritten.
    –>
   
    <!– Database configurations  –>]]></replacevalue>
    </replace>
  </target>


  <!– ### EXAMPLES #################################################################### –>

  <target name="inflate.examples"
          description="Inflates the ${activiti.home}/workspace example projects with the required dependency libs"
          depends="cfg.create">
  
    <mkdir dir="${activiti.home}/workspace/activiti-engine-examples/libs-runtime" />
    <copy todir="${activiti.home}/workspace/activiti-engine-examples/libs-runtime">
      <fileset dir="files/dependencies/libs" includesfile="${activiti.home}/setup/files/dependencies/libs.engine.runtime.txt" />
    </copy>
    <mkdir dir="${activiti.home}/workspace/activiti-engine-examples/libs-test" />
    <copy todir="${activiti.home}/workspace/activiti-engine-examples/libs-test">
      <fileset dir="files/dependencies/libs" includesfile="${activiti.home}/setup/files/dependencies/libs.engine.test.txt" />
    </copy>

    <mkdir dir="${activiti.home}/workspace/activiti-groovy-examples/libs-runtime" />
    <copy todir="${activiti.home}/workspace/activiti-groovy-examples/libs-runtime">
      <fileset dir="files/dependencies/libs" includesfile="${activiti.home}/setup/files/dependencies/libs.engine.runtime.txt" />
    </copy>
    <mkdir dir="${activiti.home}/workspace/activiti-groovy-examples/libs-test" />
    <copy todir="${activiti.home}/workspace/activiti-groovy-examples/libs-test">
      <fileset dir="files/dependencies/libs" includesfile="${activiti.home}/setup/files/dependencies/libs.engine.test.txt" />
      <fileset dir="files/dependencies/libs" includesfile="${activiti.home}/setup/files/dependencies/libs.engine.runtime.feature.groovy.txt" />
    </copy>

    <mkdir dir="${activiti.home}/workspace/activiti-jpa-examples/libs-runtime" />
    <copy todir="${activiti.home}/workspace/activiti-jpa-examples/libs-runtime">
      <fileset dir="files/dependencies/libs" includesfile="${activiti.home}/setup/files/dependencies/libs.engine.runtime.txt" />
    </copy>
    <mkdir dir="${activiti.home}/workspace/activiti-jpa-examples/libs-test" />
    <copy todir="${activiti.home}/workspace/activiti-jpa-examples/libs-test">
      <fileset dir="files/dependencies/libs" includesfile="${activiti.home}/setup/files/dependencies/libs.engine.test.txt" />
      <fileset dir="files/dependencies/libs" includesfile="${activiti.home}/setup/files/dependencies/libs.engine.runtime.feature.jpa.txt" />
    </copy>
    <move todir="${activiti.home}/workspace/activiti-jpa-examples/libs-runtime">
      <fileset dir="${activiti.home}/workspace/activiti-jpa-examples/libs-test">
        <include name="persistence-api-*.jar" />
      </fileset>
    </move>

    <mkdir dir="${activiti.home}/workspace/activiti-spring-examples/libs-runtime" />
    <copy todir="${activiti.home}/workspace/activiti-spring-examples/libs-runtime">
      <fileset dir="files/dependencies/libs" includesfile="${activiti.home}/setup/files/dependencies/libs.spring.runtime.txt" />
      <fileset dir="files/dependencies/libs" includesfile="${activiti.home}/setup/files/dependencies/libs.engine.runtime.txt" />
    </copy>
    <mkdir dir="${activiti.home}/workspace/activiti-spring-examples/libs-test" />
    <copy todir="${activiti.home}/workspace/activiti-spring-examples/libs-test">
      <fileset dir="files/dependencies/libs" includesfile="${activiti.home}/setup/files/dependencies/libs.engine.test.txt" />
      <fileset dir="files/dependencies/libs" includesfile="${activiti.home}/setup/files/dependencies/libs.engine.runtime.feature.jpa.txt" />
      <fileset dir="files/dependencies/libs" includesfile="${activiti.home}/setup/files/dependencies/libs.spring.test.txt" />
    </copy>
    <move todir="${activiti.home}/workspace/activiti-spring-examples/libs-runtime">
      <fileset dir="${activiti.home}/workspace/activiti-spring-examples/libs-test">
        <include name="persistence-api-*.jar" />
      </fileset>
    </move>

    <mkdir dir="${activiti.home}/workspace/activiti-cxf-examples/libs-runtime" />
    <copy todir="${activiti.home}/workspace/activiti-cxf-examples/libs-runtime">
      <fileset dir="files/dependencies/libs" includesfile="${activiti.home}/setup/files/dependencies/libs.engine.runtime.txt" />
      <fileset dir="files/dependencies/libs" includesfile="${activiti.home}/setup/files/dependencies/libs.engine.runtime.feature.cxf.txt" />
    </copy>
    <mkdir dir="${activiti.home}/workspace/activiti-cxf-examples/libs-test" />
    <copy todir="${activiti.home}/workspace/activiti-cxf-examples/libs-test">
      <fileset dir="files/dependencies/libs" includesfile="${activiti.home}/setup/files/dependencies/libs.engine.test.txt" />
    </copy>
  </target>
 
  <!– ### DEMO #################################################################### –>
 
  <target name="demo.start"
          description="Starts the demo setup and installs things if necessary"
          depends="demo.install,
                   h2.start,
                   tomcat.start,
                   explorer.browser.open" />

  <available property="demo.is.installed" file="${activiti.home}/apps"/>
 
  <target name="demo.install"
          description="Installs tomcat and h2 database, deploys webapps, creates the db schema and deploys example processes"
          unless="demo.is.installed">
    <echo message="installing demo" />
    <antcall target="build.webapps" />
    <antcall target="h2.install" />
    <antcall target="h2.start" />
    <antcall target="db.create" />
    <antcall target="db.demo.data" />
    <antcall target="h2.stop" />
    <antcall target="tomcat.install" />
    <antcall target="deploy.activiti.cfg.into.tomcat" />
    <antcall target="deploy.activiti.webapps.into.tomcat" />
  </target>

  <target name="demo.clean"
          description="Deletes the setup/apps directory including tomcat and h2 installations">
    <delete dir="${activiti.home}/apps" />
    <delete dir="${activiti.home}/setup/build" />
  </target>

  <target name="demo.stop"
          description="Stops tomcat and h2 database"
          depends="tomcat.stop, h2.stop"/>

  <!– ### DB #################################################################### –>
 
  <condition property="db.is.mysql">
    <equals arg1="${db}" arg2="mysql" casesensitive="false"/>
  </condition>
  <condition property="db.is.h2">
    <equals arg1="${db}" arg2="h2" casesensitive="false"/>
  </condition>
  <condition property="db.is.postgres">
    <equals arg1="${db}" arg2="postgres" casesensitive="false"/>
  </condition>
  <condition property="db.is.oracle">
    <equals arg1="${db}" arg2="oracle" casesensitive="false"/>
  </condition>
  <condition property="db.is.mssql">
    <equals arg1="${db}" arg2="mssql" casesensitive="false"/>
  </condition>
  <condition property="db.is.db2">
    <equals arg1="${db}" arg2="db2" casesensitive="false"/>
  </condition>

  <target name="db.create"
          description="Creates the Activiti tables in the DB"
         depends="internal.classpath.libs">
    <echo message="creating db" />
    <java classname="org.activiti.engine.impl.db.DbSchemaUpdate" classpathref="classpath.libs" />
  </target>

  <target name="db.drop"
          description="Drops the Activiti tables from the DB"
          depends="internal.classpath.libs">
    <java classname="org.activiti.engine.impl.db.DbSchemaDrop" classpathref="classpath.libs" />
  </target>

  <target name="db.demo.data"
          description="Populates the Activiti DB tables with demo users and process definitions"
          depends="cfg.create, internal.classpath.libs">

    <echo message="populating demo data" />
   
    <mkdir dir="build/demo" />
    <copy file="files/demo/${db}.data.sql" todir="build/demo" />
   
    <!– replace some properties currently needed/used for cycle config –>
    <replace file="build/demo/${db}.data.sql">
      <replacefilter token="@activiti.modeler.base.url@" value="${activiti.modeler.base.url}" />
      <replacefilter token="@cycle.base.file.path@" value="${cycle.workspace}" />
    </replace>
    <sql driver="${jdbc.driver}"
         password="${jdbc.password}"
         url="${jdbc.url}"
         userid="${jdbc.username}"
         classpathref="classpath.libs"
         src="build/demo/${db}.data.sql"/>

    <ant antfile="../workspace/activiti-engine-examples/build.xml" target="deploy" inheritall="false" />
  </target>

  <!– ### DB #################################################################### –>
 
  <condition property="h2.not.installed">
    <and>
      <equals arg1="${db.is.h2}" arg2="true" />
      <not><available file="${activiti.home}/apps/h2"/></not>
    </and>
  </condition>
 
  <condition property="db.install.supported">
    <equals arg1="${db}" arg2="h2" />
  </condition>

<target name="h2.install"
          description="Installs the H2 db in the ${activiti.home}/apps/h2 directory"
         depends="internal.db.install.h2, internal.db.install.h2.unnecessary, internal.db.install.unsupported" />

<target name="internal.db.install.h2"
          if="h2.not.installed">
  <echo message="Installing H2 adtabase in ${activiti.home}/apps/h2" />
    <mkdir dir="${activiti.home}/apps/h2" />
    <copy todir="${activiti.home}/apps/h2">
      <fileset dir="${activiti.home}/setup/files/dependencies/libs">
        <include name="h2*.jar"/>
      </fileset>
      <fileset dir="files/h2" />
    </copy>
    <chmod perm="a+x">
      <fileset dir="${activiti.home}/apps/h2">
        <include name="*.sh"/>
      </fileset>
    </chmod>
  </target>

  <target name="internal.db.install.h2.unnecessary"
         unless="h2.not.installed">
   <echo message="H2 is already installed" />
  </target>

  <target name="internal.db.install.unsupported"
          unless="db.install.supported">
    <echo message="Automatic installation of ${db} DB not supported.  It is assumed to be installed and running" />
  </target>

  <target name="h2.start"
          description="Starts the H2 server"
          depends="internal.taskdef.launch"
          if="db.is.h2">
    <launch dir="${activiti.home}/apps/h2"
            script="h2.start"
            msg="TCP server running on"/>
  </target>
 
  <target name="h2.stop"
          description="Stops the H2 server"
          depends="internal.taskdef.launch"
          if="db.is.h2">
    <launch dir="${activiti.home}/apps/h2"
            script="h2.stop"/>
  </target>

  <target name="h2.console.start"
          description="Launches the H2 web console and opens a browser on the page"
          depends="internal.taskdef.launch"
          if="db.is.h2">
    <echo message="H2 Web Console" />
    <echo message="==============" />
    <echo message="JDBC URL: jdbc:h2:tcp://localhost/activiti" />
    <echo message="Press CTRL+C to shutdown the console." />
    <echo message="" />
    <launch dir="${activiti.home}/apps/h2"
            script="h2.console.start" /> <!– Not using a launch complete msg, since there is no way
                                              of stopping the h2 console later on,
                                              so we don't want to let the ant task return–>
  </target>


  <!– ### TOMCAT #################################################################### –>

  <property name="tomcat.filename" value="apache-tomcat-${tomcat.version}.zip" />
  <property name="tomcat.download.url" value="${tomcat.url}${tomcat.filename}" />  
  <property name="tomcat.home" value="${install.dir}/apache-tomcat-${tomcat.version}" />
  <property name="tomcat.java.opts" value="-server -Xms128m -Xmx512m -XX:NewSize=64m -XX:MaxNewSize=64m -XXSmiley TongueermSize=256m -XX:MaxPermSize=512m -Dfile.encoding=UTF-8" />
  <property name="tomcat.distro" value="${downloads.dir}/${tomcat.filename}" />
  <available property="is.tomcat.installed" file="${install.dir}/bin" />
  <available property="is.tomcat.available" file="${tomcat.distro}" />
  <available file="${user.home}/.activiti/tomcat-users.xml" property="tomcat.users.available" />

  <target name="tomcat.install"
          description="Installs apache tomcat in ${install.dir}"
          unless="is.tomcat.installed">
    <antcall target="internal.tomcat.download" />
    <antcall target="internal.tomcat.unzip" />
    <antcall target="internal.tomcat.copy.users" />
    <antcall target="internal.tomcat.enable.debug" />
    <antcall target="internal.tomcat.apply.javaopts.other" />
    <antcall target="internal.tomcat.apply.javaopts.windows" />
    <copy file="${activiti.home}/setup/files/tomcat/logging.properties" todir="{tomcat.home}/conf" overwrite="true" />
  </target>
 
 

  <target name="internal.tomcat.download" unless="is.tomcat.available">
    <mkdir dir="${downloads.dir}" />
    <get src="${tomcat.download.url}" dest="${tomcat.distro}" />
  </target>

  <target name="internal.tomcat.unzip">
    <mkdir dir="${activiti.home}/apps" />
    <unzip src="${tomcat.distro}" dest="${install.dir}"/>
  </target>

  <target name="internal.download.tomcat" unless="is.tomcat.available">
    <mkdir dir="${downloads.dir}" />
    <get src="${tomcat.download.url}" dest="${tomcat.distro}" />
  </target>

  <target name="internal.tomcat.copy.users" if="tomcat.users.available">
    <copy file="${user.home}/.activiti/tomcat-users.xml"
          todir="${tomcat.home}/conf"
          overwrite="true"/>
  </target>

  <target name="internal.tomcat.enable.debug" if="tomcat.enable.debug">
    <echo>Enabling tomcat remote debugging … </echo>
    <replace file="${tomcat.home}/bin/startup.sh">
      <replacetoken><![CDATA[exec "$PRGDIR"/"$EXECUTABLE" start "$@"]]></replacetoken>
      <replacevalue><![CDATA[exec "$PRGDIR"/"$EXECUTABLE" jpda start "$@"]]></replacevalue>
    </replace>
    <replace file="${tomcat.home}/bin/startup.bat">
      <replacetoken><![CDATA[call "%EXECUTABLE%" start %CMD_LINE_ARGS%]]></replacetoken>
      <replacevalue><![CDATA[call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%]]></replacevalue>
    </replace>
  </target>
 
  <target name="internal.tomcat.apply.javaopts.other" if="is.not.windows">
    <replace file="${tomcat.home}/bin/catalina.sh">
      <replacetoken><![CDATA[#!/bin/sh]]></replacetoken>
      <replacevalue><![CDATA[#!/bin/sh

JAVA_OPTS=$JAVA_OPTS" @tomcat.java.opts@"
]]></replacevalue>
    </replace>
    <replace file="${tomcat.home}/conf/server.xml">
      <replacetoken><![CDATA[port="8080"]]></replacetoken>
      <replacevalue><![CDATA[port="8080" URIEncoding="UTF-8"]]></replacevalue>
    </replace>
    <replace file="${tomcat.home}/bin/catalina.sh" token="@tomcat.java.opts@" value="${tomcat.java.opts}" />
    <chmod perm="a+x" os="Linux, Mac OS X">
      <fileset dir="${tomcat.home}/bin">
        <include name="*.sh" />
      </fileset>
    </chmod>
  </target>

  <target name="internal.tomcat.apply.javaopts.windows" if="is.windows">
    <replace file="${tomcat.home}/bin/catalina.bat">
      <replacetoken><![CDATA[rem —– Execute The Requested Command —————————————]]></replacetoken>
      <replacevalue><![CDATA[rem —– Execute The Requested Command —————————————

set JAVA_OPTS=%JAVA_OPTS% @tomcat.java.opts@
]]></replacevalue>
    </replace>
    <replace file="${tomcat.home}/conf/server.xml">
      <replacetoken><![CDATA[port="8080"]]></replacetoken>
      <replacevalue><![CDATA[port="8080" URIEncoding="UTF-8"]]></replacevalue>
    </replace>   
    <replace file="${tomcat.home}/bin/catalina.bat" token="@tomcat.java.opts@" value="${tomcat.java.opts}"/>
  </target>

  <target name="tomcat.start"
          description="Starts the tomcat server"
          depends="internal.taskdef.launch">
    <launch dir="${tomcat.home}/bin"
            script="startup"
            msg="Using CLASSPATH:" />
  </target>

  <target name="tomcat.stop"
          description="Stops the tomcat server"
          depends="internal.taskdef.launch">
    <launch dir="${tomcat.home}/bin"
            script="shutdown"
            msg="Using CLASSPATH:"/>
  </target>

 
  <!– ### DEPLOY TO TOMCAT #################################################################### –>
 
  <target name="deploy.activiti.cfg.into.tomcat"
          depends="cfg.create, internal.define.jdbc.driver.libs">
    <copy todir="${tomcat.home}/webapps/activiti-rest/WEB-INF/lib">
      <fileset dir="build">
        <include name="activiti-cfg.jar"/>
      </fileset>
      <fileset refid="jdbc.driver.libs" />
    </copy>
  </target>

  <target name="deploy.activiti.webapps.into.tomcat"
          depends="build.webapps,
                   internal.deploy.activiti.rest.into.tomcat,
                   internal.deploy.activiti.explorer.into.tomcat,
                   internal.deploy.activiti.probe.into.tomcat,
                   internal.deploy.activiti.cycle.into.tomcat,
                   internal.deploy.activiti.kickstart.into.tomcat,
                  internal.deploy.activiti.administrator.into.tomcat,
                   internal.deploy.activiti.modeler.into.tomcat" />

  <target name="build.webapps"
          description="Copies the webapps to ${activiti.home}/setup/build/webapps and inflates them with the proper libraries in their WEB-INF/lib"
          depends="internal.define.jdbc.driver.libs">
    <mkdir dir="${activiti.home}/setup/build/webapps" />
    <copy todir="${activiti.home}/setup/build/webapps">
      <fileset dir="${activiti.home}/setup/files/webapps" />
    </copy>
    <copy todir="${activiti.home}/setup/build/webapps/activiti-explorer.war/WEB-INF/lib">
      <fileset dir="${activiti.home}/setup/files/dependencies/libs"
               includesfile="${activiti.home}/setup/files/dependencies/libs.webapp.ui.txt" />
    </copy>
    <copy todir="${activiti.home}/setup/build/webapps/activiti-probe.war/WEB-INF/lib">
      <fileset dir="${activiti.home}/setup/files/dependencies/libs"
               includesfile="${activiti.home}/setup/files/dependencies/libs.webapp.ui.txt" />
    </copy>
    <copy todir="${activiti.home}/setup/build/webapps/activiti-cycle.war/WEB-INF/lib">
      <fileset dir="${activiti.home}/setup/files/dependencies/libs"
               includesfile="${activiti.home}/setup/files/dependencies/libs.webapp.ui.txt" />
    </copy>
   <copy todir="${activiti.home}/setup/build/webapps/activiti-kickstart.war/WEB-INF/lib">
     <fileset dir="${activiti.home}/setup/files/dependencies/libs"
              includesfile="${activiti.home}/setup/files/dependencies/libs.webapp.kickstart.txt" />
   </copy>
   <copy todir="${activiti.home}/setup/build/webapps/activiti-administrator.war/WEB-INF/lib">
     <fileset dir="${activiti.home}/setup/files/dependencies/libs" includesfile="${activiti.home}/setup/files/dependencies/libs.webapp.administrator.txt" />
    </copy>
    <copy todir="${activiti.home}/setup/build/webapps/activiti-rest.war/WEB-INF/lib">
      <fileset dir="${activiti.home}/setup/files/dependencies/libs"
               includesfile="${activiti.home}/setup/files/dependencies/libs.webapp.rest.txt" />
      <fileset dir="${activiti.home}/setup/files/dependencies/libs"
               includesfile="${activiti.home}/setup/files/dependencies/libs.engine.runtime.feature.groovy.txt" />
      <fileset dir="${activiti.home}/setup/files/dependencies/libs"
               includesfile="${activiti.home}/setup/files/dependencies/libs.engine.runtime.feature.cxf.txt" />
      <fileset refid="jdbc.driver.libs" />
    </copy>
  </target>
 
  <target name="internal.deploy.activiti.init.into.tomcat">
    <mkdir dir="${tomcat.home}/webapps/activiti-init" />
    <copy todir="${tomcat.home}/webapps/activiti-init">
      <fileset dir="${activiti.home}/setup/build/webapps/activiti-init.war"/>
    </copy>
  </target>
 
  <target name="internal.deploy.activiti.rest.into.tomcat">
    <mkdir dir="${tomcat.home}/webapps/activiti-rest" />
    <copy todir="${tomcat.home}/webapps/activiti-rest">
      <fileset dir="${activiti.home}/setup/build/webapps/activiti-rest.war"/>
    </copy>
  </target>
 
  <target name="internal.deploy.activiti.explorer.into.tomcat">
    <mkdir dir="${tomcat.home}/webapps/activiti-explorer" />
    <copy todir="${tomcat.home}/webapps/activiti-explorer">
      <fileset dir="${activiti.home}/setup/build/webapps/activiti-explorer.war" />
    </copy>
  </target>

  <target name="internal.deploy.activiti.probe.into.tomcat">
    <mkdir dir="${tomcat.home}/webapps/activiti-probe" />
    <copy todir="${tomcat.home}/webapps/activiti-probe">
      <fileset dir="${activiti.home}/setup/build/webapps/activiti-probe.war" />
    </copy>
  </target>

  <target name="internal.deploy.activiti.modeler.into.tomcat"
          if="modeler.is.enabled">
    <antcall target="internal.download.activiti.modeler" /> <!– Can't use depends for this, due to http://ant.apache.org/faq.html#stop-dependency –>
   
    <mkdir dir="${activiti.modeler.repository.home}"/>
    <copy file="${downloads.dir}/activiti-modeler-${activiti.version}.war"
          tofile="${tomcat.home}/webapps/activiti-modeler.war"/>
  </target>
 
  <target name="internal.deploy.activiti.cycle.into.tomcat"
          depends="build.webapps"
          if="cycle.is.enabled">  
    <mkdir dir="${tomcat.home}/webapps/activiti-cycle" />
    <copy todir="${tomcat.home}/webapps/activiti-cycle">
      <fileset dir="${activiti.home}/setup/build/webapps/activiti-cycle.war" />
    </copy>
  </target>

<target name="internal.deploy.activiti.kickstart.into.tomcat">
    <mkdir dir="${tomcat.home}/webapps/activiti-kickstart" />
  <copy todir="${tomcat.home}/webapps/activiti-kickstart">
    <fileset dir="${activiti.home}/setup/build/webapps/activiti-kickstart.war" />
   </copy>
</target>

<target name="internal.deploy.activiti.administrator.into.tomcat">
   <mkdir dir="${tomcat.home}/webapps/activiti-administrator" />
   <copy todir="${tomcat.home}/webapps/activiti-administrator">
     <fileset dir="${activiti.home}/setup/build/webapps/activiti-administrator.war" />
   </copy>
</target>


 
  <!– ### LAUNCH TASKDEF AND CLASSPATH #################################################################### –>

  <target name="internal.taskdef.launch"
          depends="internal.classpath.libs">
    <taskdef name="launch" classname="org.activiti.engine.impl.ant.LaunchTask" classpathref="classpath.libs" />
  </target>
 
  <target name="internal.classpath.libs" depends="cfg.create">
    <path id="classpath.libs">
      <fileset dir="${activiti.home}/setup/files/dependencies/libs">
        <include name="*.jar" />
      </fileset>
      <fileset dir="${activiti.home}/setup/build">
        <include name="activiti-cfg.jar" />
      </fileset>
    </path>
  </target>
 
  <target name="internal.define.jdbc.driver.libs">
    <!– Depending on the db, driver jar is added to fileset jdbc.driver.libs –>
    <fileset id="jdbc.driver.libs" dir="${activiti.home}/setup/files/dependencies/libs">
      <include name="h2-*.jar" if="db.is.h2"/>
      <include name="mysql-*.jar" if="db.is.mysql"/>
      <include name="postgresql-*.jar" if="db.is.postgres"/>
      <include name="ojdbc5*.jar" if="db.is.oracle"/>
      <include name="jtds-*.jar" if="db.is.mssql"/>
   <include name="db2jcc*.jar" if="db.is.db2"/>
    </fileset>
  </target>

 
  <!– ### MODELER #################################################################### –>
 
  <!–
  to work with Activiti Modeler or Activiti Cycle on trunk, set property activiti.modeler.download.url
  in your ${user.home}/.activiti/build.properties
  –> 
  <property name="activiti.modeler.download.url" value="http://activiti.org/downloads/activiti-modeler-${activiti.version}.war" />
  <available property="is.activiti.modeler.available" file="${downloads.dir}/activiti-modeler-${activiti.version}.war" />
  <property name="activiti.modeler.repository.home" value="${activiti.home}/workspace/activiti-modeler-examples" />

  <condition property="modeler.is.enabled">
    <equals arg1="${feature.modeler}" arg2="enabled"/>
  </condition>
 
  <target name="internal.download.activiti.modeler" unless="is.activiti.modeler.available">
    <echo message="You're downloading the Activiti Modeler, distributed under MIT license.  For more info, see the user guide" />
    <echo message="This could take a while. Set the 'feature.modeler' property to 'disabled' in the build.properties or in your user.home/.activiti/build.properties to skip this step" />
    <mkdir dir="${downloads.dir}"/>
    <get src="${activiti.modeler.download.url}" dest="${downloads.dir}/activiti-modeler-${activiti.version}.war"/>
  </target>
 
  <!– ### OPEN BROWSER #################################################################### –>
 
  <property name="macos.browser" value="/usr/bin/open" />
  <property name="windows.browser" value="C:/Program Files/Mozilla Firefox/firefox.exe" />
  <property name="linux.browser" value="firefox" />

  <target name="explorer.browser.open">
    <!– Sleep for 5 second to be sure tomcat coyote http-connector is ready to accept connections –>
    <sleep seconds="5"/>
    <open-html-page url="http://localhost:8080/activiti-explorer" />
    <open-html-page url="http://localhost:8080/activiti-probe" />
    <open-html-page url="http://localhost:8080/activiti-modeler" />
    <open-html-page url="http://localhost:8080/activiti-cycle" />
   <open-html-page url="http://localhost:8080/activiti-kickstart" />
  </target>

<macrodef name="open-html-page">
  <attribute name="url" />
  <sequential>
     <exec executable="${macos.browser}" os="Mac OS X" failifexecutionfails="false" failonerror="false">
       <arg value="@{url}" />
     </exec>
     <exec executable="cmd" os="Windows Vista, Windows XP,Windows 2000,Windows 98" failifexecutionfails="false" failonerror="false">
       <arg value="/C start &quot;${windows.browser}&quot; &quot;@{url}&quot;" />
     </exec>
       <exec executable="${linux.browser}" os="Linux" failifexecutionfails="false" failonerror="false">
       <arg value="@{url}" />
     </exec>
  </sequential>
</macrodef>

<!– ##### READY PRODUCTION ######################################################### –>
<target name="install"
   description="Installs the product into whatever configuration specified in the db.properties">
  <echo message="Installing activiti"/>
  <antcall target="build.webapps" />
  <antcall target="db.create" />
  <antcall target="tomcat.install" />
  <antcall target="deploy.activiti.cfg.into.tomcat" />
  <antcall target="deploy.activiti.webapps.into.tomcat" />
</target>

<!– ##### READY PRODUCTION ######################################################### –>
   <target name="prod.start"
          description="Installs tomcat and h2 database, deploys webapps, creates the db schema and deploys example processes"
          unless="demo.is.installed">
    <echo message="installing demo" />
    <antcall target="build.webapps" />
    <antcall target="h2.install" />
    <antcall target="h2.start" />
    <antcall target="db.create" />
    <antcall target="db.demo.data" />
    <antcall target="h2.stop" />
    <antcall target="tomcat.install" />
    <antcall target="deploy.activiti.cfg.into.tomcat" />
    <antcall target="deploy.activiti.webapps.into.tomcat" />
  </target>

</project>


With these changes you can now do an ant install and it will:

1) Install tomcat into your install dir
2) Put Activiti in its own place in the activiti directory
3) Deploy all of the .war files to the tomcat directory specified in the install dir
4) Push all the relevant libs and configs to the tomcat container

After this successfully runs (tested several times with tomcat and mysql on EC2 boxes), you can then simply kick off the server via:

ant tomcat.start

*POOF* Now you have an Activiti install; capable of sustaining whatever business process we see fit to deposit in it.

next stop… fixing the security problem.