Tutorial 2: Sample Remote Project from Archetype - redhat-consulting/jbpm-ee GitHub Wiki
The jbpm-ee project comes with preconfigured sample projects, that can be deployed to the configured application server. This tutorial will guide you through deploying datasources, the database specific jbpm-ee-services.war, and the remote client sample into JBoss EAP 6.
###Prerequisites###
- mysql and JBoss EAP 6 configuration from Tutorial 1
- jbpm-ee
- maven - All jBPM-EE projects utilize Apache Maven for compilation and dependency management. Red Hat recommends using Maven for all client application development to simplify dependency management.
###Build and Deploy Applications### The jbpm-ee framework uses maven for build and dependency management. To build and deploy the framework and the remote application you need to unzip jbpm-ee, then from your terminal
$ cd jbpm-ee-1.X.X
$ mvn clean install -DskipTests=true
This will build all the necessary artifacts and archetypes and the end of the process shows the outcome of the build similar to
[INFO] JBPM EE Parent POM ................................ SUCCESS [0.180s]
[INFO] jbpm-ee-client .................................... SUCCESS [0.006s]
[INFO] jbpm-ee-client-common ............................. SUCCESS [2.774s]
[INFO] jbpm-ee-client-local .............................. SUCCESS [0.344s]
[INFO] jBPM Client Remote Common ......................... SUCCESS [0.945s]
[INFO] jbpm-ee-client-remote ............................. SUCCESS [0.605s]
[INFO] jBPM Web Service Client ........................... SUCCESS [0.705s]
[INFO] jbpm-ee-samples ................................... SUCCESS [0.004s]
[INFO] jbpm-ee-kjar-sample ............................... SUCCESS [0.517s]
[INFO] jbpm-ee-services .................................. SUCCESS [4.432s]
[INFO] jBPM EE Embedded Mode ............................. SUCCESS [0.004s]
[INFO] custom-application-local .......................... SUCCESS [0.909s]
[INFO] custom-application-local-ear ...................... SUCCESS [4.616s]
[INFO] jbpm-ee-remote-sample ............................. SUCCESS [0.005s]
[INFO] Example Custom Application for Remote Integration . SUCCESS [1.050s]
[INFO] jbpm-ee-archetypes ................................ SUCCESS [0.006s]
[INFO] jbpm-ee-remote-archetype .......................... SUCCESS [0.465s]
[INFO] jbpm-ee-embedded-archetype ........................ SUCCESS [0.051s]
[INFO] jbpm-ee-kjar-archetype ............................ SUCCESS [0.042s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
For the remote project we need to deploy 3 data sources XML files and 1 artifact:
- jbpm-ee-1.X.X/jbpm-ee-services/resources/jbpm-ee-ds.xml
- jbpm-ee-1.X.X/jbpm-ee-services/resources/jbpm-ee-jms.xml
- jbpm-ee-1.X.X/jbpm-ee-services/resources/jbpm-ee-timer-ds.xml
- jbpm-ee-1.X.X/jbpm-ee-services/target/jbpm-ee-services.war
Please copy the files to the standalone/deployments directory to register the datasources and deploy the framework.
###Create a Project with Standalone Maven Archetype###
The following section guides you through creating a custom project that provides the default structure and dependencies for creating a new application that conforms to the collocated and remote standalone modes. We accomplish this project templating by using Maven Archetypes. Read Maven Archetype
-
If you are running "collocated" or "remote", you will install the jBPM-EE services to your JBoss EAP instance as a WAR file.
- jBPM-EE Services are already setup for Oracle, MySQL, DB2, Postgres, and MS SQL Server. Just set the right database in JBoss EAP's system properties.
- Create a project based on a the maven archetype jbpm-ee-remote-archetype, by typing
mvn archetype:generate \ -DgroupId=com.mycompany.app \ -DartifactId=remoteApp \ -DarchetypeArtifactId=jbpm-ee-remote-archetype \ -DarchetypeGroupId=org.jbpm.jbpm-ee \
or in JBoss Developer Studio/Eclipse, select File -> New -> Project... -> Maven Project and follow the screen shots
This will create a directory structure similar to
remoteApp/ |____pom.xml |____remoteApp | |____pom.xml | |____resources | | |____jbpm-ee-ds.xml | | |____jbpm-ee-jms.xml | | |____jbpm-ee-timer-ds.xml | |____src | | |____main | | | |____java | | | | |____com | | | | | |____mycompany | | | | | | |____app | | | | | | | |____BaseEJBTest.java | | | | | | | |____BaseTest.java | | | | | | | |____EJBRemoteTest.java | | | | | | | |____exception | | | | | | | | |____TestRuntimeException.java | | | | | | | |____RestTest.java | | | | | | | |____SoapTest.java
* Issue a **mvn clean install** on the application, this will create a war file called **remoteApp.war** in remoteApp/target
* Deploy this application to JBoss AS 7/EAP 6