Apache Karaf is a small OSGi bundle with a lightweight container and is capable of deploying various applications and components. To deploy Activiti as an OSGi, we have to carry out the following steps:
../activity-karaf-dist-1.0.0-SNAPSHOT/sources/activity-bpmn-archtype
folder; there will be only an src
folder and a pom.xml
file, as shown in the following screenshot:mvn install
command from the command prompt, as shown in the following screenshot:mvn install
command will start installing the activiti-bpmn-archetype
in the local repository. The installation process will take some time. Once the installation is completed, you should get a BUILD SUCCESS message as shown in the following screenshot:activiti-bpmn-archetype
, we can create a bpmn
project using activiti-bpmn-archtype
.sources
folder of your activiti-karaf-dist-1.0.0-SNAPSHOT
path and type the following command:mvn archetype:generate -B -DarchetypeGroupId=org.activiti.karaf.archetypes -DarchetypeArtifactId=activiti-bpmn-archetype -DarchetypeVersion=1.0.0-SNAPSHOT -DgroupId=com.book.activiti.OSGi -DartifactId=activiti-OSGi -Dversion=1.0.0-SNAPSHOT
sources
folder:activiti-OSGi
will be created in the sources
folder of activiti-karaf-dist-1.0.0-SNAPSHOT
. You can browse to ../activiti-karaf-dist-1.0.0-SNAPSHOT/sources
and you should have folders mentioned in the following screenshot: pom.xml
file of our activiti-OSGi
project. The pom.xml
file is located at the ../activiti-karaf-dist-1.0.0-SNAPSHOT/sources/activiti-OSGi
path.<parent></parent>
element of the pom.xml
file with the given code snippet:<parent> <groupId>org.activiti.karaf</groupId> <artifactId>activiti-karaf-parent</artifactId> <version>1.0.0-SNAPSHOT</version> <relativePath>../activiti-karaf-parent</relativePath> </parent>
groupId
and artifactId
, our project becomes an OSGi Activiti project and we can run it on the OSGi container.../activiti-karaf-dist-1.0.0-SNAPSHOT/sources/activiti-OSGi/src/main/process
path, you will find a bpmn
file named activiti-OSGi.bpmn20.xml
, which is created in the project by default.mvn clean package
command in our project folder path as mentioned in the following screenshot: ../activiti-karaf-dist-1.0.0-SNAPSHOT/sources/activiti-OSGi
, which contains the activiti-OSGi-1.0.0-SNAPSHOT.jar
file and various classes, as shown in the following screenshot:activiti-OSGi
project on Activiti Karaf. To start activiti-karaf
, we have to execute the ./karaf
command from the command prompt by browsing to the ../activiti-karaf-dist-1.0.0-SNAPSHOT/bin
path as viewed in the following screenshot:http://localhost:8181/activiti-explorer
. This URL will open the Activiti engine and you will get the login page, as shown in the following screenshot:kermit
and password kermit
. Then, browse to the Manage | Deployments | Upload new link and upload the activiti-OSGi.bpmn20.xml
file, as shown in the following screenshot:act:list
command on the command prompt; we should be able to view our activiti-OSGi
process in the list, as shown in the following screenshot: act:start [process definition id]
command, as shown in the following screenshot: