To access Activiti as a REST service, we need to perform some configurations in our Tomcat server. Now, we will take a look at these configurations. Perform the following steps to implement the REST services:
activiti-rest.war
file in the apache-tomcat
web server. Copy the activiti-rest.war
file and paste it to the webapps
folder that can be found at apache-tomcat ../apache-tomcat-7.0.37/webapps
, as shown in the following screenshot:activiti-rest.war
file will be deployed automatically. If Tomcat is not running, start your Tomcat server; then, your activiti-rest.war
file will be deployed and you will be able to find the deployed folder (activiti-rest
) in apache-tomcat's webapps
folder (apache-tomcat ../apache-tomcat-7.0.3/webapps
), as shown in the following screenshot:activiti-rest
file, we need to connect the activiti-rest
file to the database that we had configured in Chapter 4, Management and Monitoring Using the Activiti Explorer. Browse to the classes
folder of activiti-rest
(../apache-tomcat-7.0.37/webapps/activiti-rest/WEB-INF/classes
) and edit the db.properties
file shown in the following screenshot:db.properties
file will be connected to the H2 database; we need to change it to mysql
(which we have configured in Chapter 4, Management and Monitoring, using the Activiti Explorer), as shown in the following code:db=mysql jdbc.driver=com.mysql.jdbc.Driver jdbc.url=jdbc:mysql://localhost:3306/activiti jdbc.username=root jdbc.password=root
kermit
in the Username and Password fields for authentication, as shown in the following screenshot:http://localhost:8080/activiti-rest/service/deployments
in the URL field in the RESTClient window and the Method field should be set to GET. On executing this, you should get the output in the Response Headers section, as shown in the following screenshot:We just went through how to configure activiti-rest
and access the Activiti Process Engine by performing REST calls using RESTClient.