}
{code}
{column}
{section}
h4. Adding a service unit
In the Roboconf graph, just define the Roboconf component associated to your service unit and extending the component {{PetalsSU}}.
In the Roboconf instances, just add a new instance of the new Roboconf component as a child of your instances inherited from {{PetalsBC}} and {{PetalsSE}}. The Roboconf instance name is used as the JBI identifier of the service unit.
{section}
{column}
{gliffy:name=ServiceUnitModel|size=L|version=2}
{column}
{column}
{code}
SU-SOAP-VacationServiceConsumer {
extends: PetalsSU;
}
{code}
{column}
{section}
{section}
{column}
{gliffy:name=ServiceUnitInstantiation|size=L|version=2}
{column}
{column}
{code}
instance of PetalsContainer-VM {
...
instance of PetalsContainer {
...
instance of PetalsBCSoap {
...
instance of SU-SOAP-VacationServiceConsumer {
name: su-SOAP-vacationService-consume;
}
}
}
}
{code}
{column}
{section}
h2. The Roboconf application "External resource"
This applicative resource is a web application running on Tomcat8 cluster, composed of:
* a load balancer redirecting incoming HTTP SOAP request on an available Tomcat8 server where the web application is deployed,
* several servers running Tomcat.
{gliffy:name=TomcatCluster|size=M|version=2}
So the model of this Roboconf application is:
{section}
{column}
*Component definitions*
{code}
Tomcat8_VM {
installer: target;
children: Tomcat8;
}
Tomcat8 {
installer: script;
exports: ip, port = 8080;
children: Tomcat8_Application_WAR;
}
Tomcat8_Application_WAR {
installer: script;
exports: applicationFile = my-tomcat8-app-file.war;
}
HAProxy_VM {
installer: target;
children: HAProxy;
}
HAProxy {
installer: script;
imports: Tomcat8.port (optional), Tomcat8.ip (optional);
exports: ip, httpPort = 80, statsPort = 8080;
}
{code}
{column}
{column}
*Default instantiation*
{code}
# A VM with HAProxy_VM load balancer
instance of HAProxy_VM {
name: HAProxy VM;
instance of HAProxy {
name: Haproxy;
httpPort: 80;
statsPort: 8080;
}
}
# A VM with Tomcat
instance of Tomcat8_VM {
name: Tomcat VM1;
instance of Tomcat8 {
name: Tomcat;
instance of Tomcat8_Application_WAR {
name: samplesActivitiSOAPservices;
applicationFile: samples-SOAP-services.war;
}
}
}
# Another VM with Tomcat
instance of Tomcat8_VM {
name: Tomcat VM2;
instance of Tomcat8 {
name: Tomcat;
instance of Tomcat8_Application_WAR {
name: samplesActivitiSOAPservices;
applicationFile: samples-SOAP-services.war;
}
}
}
{code}
{column}
{section}
h2. The Roboconf application "Portal"
The portal is a web application running on a simple instance of Tomcat8, providing the forms required by the process "Vacation".
{gliffy:name=Portal|size=M|version=2}
So the model of this Roboconf application is:
{section}
{column}
*Component definitions*
{code}
Tomcat8_VM {
installer: target;
children: Tomcat8;
}
Tomcat8 {
installer: script;
exports: ip, port = 8080;
children: Tomcat8_Application_Uncompress;
}
Tomcat8_Application_Uncompress {
installer: script;
exports: applicationDir = my-tomcat8-app-file, applicationFile = my-tomcat8-app-file.zip;
}
Portal_Application {
extends: Tomcat8_Application_Uncompress;
# Add imports link to the Petals BC SOAP used as entry point into the PVC part
}
{code}
{column}
{column}
*Default instantiation*
{code}
# A VM with Tomcat
instance of Tomcat8_VM {
name: Tomcat8 VM for Portal;
instance of Tomcat8 {
name: Tomcat8 for Portal;
instance of Portal_Application {
name: portal;
applicationFile: sample-vacation-webapp.war;
applicationDir: sample-vacation-webapp;
}
}
}
{code}
{column}
{section}
h2. The Roboconf application "Sample PVC"
Our PVC will:
* run our process "Vacation",
* expose service providers to the portal to interact with the process:
** create a new process instance (ie: create a new vacation request),
** validate or reject a vacation request,
** update a vacation request.
* expose external service providers used for archiving and used by the process.
So the following Petals artifacts will be deployed into the PVC:
* the SE Activity,
* as the SE Activity requires a database, we will deploy a PosgreSQL database,
* to connect to the database, the SE Activity requires a JDBC driver provided as a shared library,
* the service unit providing the process "Vacation",
* the BC SOAP that is needed to:
** run the service units required to interact with the external archiving web-services
** expose service providers associated to the process "Vacation"
To be highly available, all Petals components are duplicated at least twice. The PostgreSQL database should be also highly available, but to simplify the comprehension we will use only one instance of the database.
So at the definition of an empty PVC, we add the following Roboconf models:
{section}
{column}
*Component definitions*
{code}
import petals-pvc/main.graph;
PostgreSQL-VM {
installer: target;
children: PostgreSQLServer;
}
PostgreSQLServer {
installer: script;
children: ActivitiPgSQLDatabase;
}
ActivitiPgSQLDatabase {
installer: script;
exports: ip, databaseName = database-name, databaseUser = database-user, databasePwd = database-pwd;
}
PetalsSLPostgreSQL {
extends: PetalsSL;
# As SL are not supported by Roboconf because:
# - a SL export no configuration parameter
# - Roboconf is not able to manage local dependency
# We create a dummy exported variable and work with only one instance of Petals SE Activiti over all Petals containers
exports: present = true;
}
PetalsBCSoap {
extends: PetalsBC;
exports: httpPort = 8084;
}
PetalsSEActiviti {
extends: PetalsSE;
# See comment on PetalsSLPostgreSQL
imports: PetalsSLPostgreSQL.present, ActivitiPgSQLDatabase.*;
}
SU-Activiti-VacationRequest {
extends: PetalsSU;
}
SU-SOAP-VacationServiceConsumer {
extends: PetalsSU;
}
SU-SOAP-NotificationServiceProvider {
extends: PetalsSU;
}
SU-SOAP-ArchivingServiceProvider {
extends: PetalsSU;
}
SU-SOAP-ActivitiIntegrationConsumer {
extends: PetalsSU;
}
{code}
{column}
{column}
*Default instantiation*
{code}
##########################
# Registry part
##########################
instance of PetalsRegistry-VM {
name: registry-bootstrap-vm;
instance of PetalsRegistryBootstrap {
name: registry-bootstrap-node;
}
}
instance of PetalsRegistry-VM {
name: registry-vm-1;
instance of PetalsRegistry {
name: registry-node-1;
}
}
##########################
# Container part
##########################
instance of PetalsContainer-VM {
name: container-bootstrap-vm;
instance of PetalsContainerBootstrap {
name: container-bootstrap-node;
domainName: roboconf-demo;
subdomainName: roboconf-demo-1;
instance of PetalsSLPostgreSQL {
name: petals-sl-postgresql-9.4-1201-jdbc4;
}
instance of PetalsBCSoap {
name: petals-bc-soap;
instance of SU-SOAP-VacationServiceConsumer {
name: su-SOAP-vacationService-consume;
}
instance of SU-SOAP-NotificationServiceProvider {
name: su-SOAP-notifyVacationService-provide;
}
instance of SU-SOAP-ArchivingServiceProvider {
name: su-SOAP-archiveService-provide;
}
instance of SU-SOAP-ActivitiIntegrationConsumer {
name: su-SOAP-activitiIntegrationService-consume;
}
}
instance of PetalsSEActiviti {
name: petals-se-activiti;
instance of SU-Activiti-VacationRequest {
name: su-activiti-vacationService-provide;
}
}
}
}
instance of PetalsContainer-VM {
name: container-vm-1;
instance of PetalsContainer {
name: container-node-1;
instance of PetalsSLPostgreSQL {
name: petals-sl-postgresql-9.4-1201-jdbc4;
}
instance of PetalsBCSoap {
name: petals-bc-soap;
instance of SU-SOAP-VacationServiceConsumer {
name: su-SOAP-vacationService-consume;
}
instance of SU-SOAP-NotificationServiceProvider {
name: su-SOAP-notifyVacationService-provide;
}
instance of SU-SOAP-ArchivingServiceProvider {
name: su-SOAP-archiveService-provide;
}
instance of SU-SOAP-ActivitiIntegrationConsumer {
name: su-SOAP-activitiIntegrationService-consume;
}
}
instance of PetalsSEActiviti {
name: petals-se-activiti;
instance of SU-Activiti-VacationRequest {
name: su-activiti-vacationService-provide;
}
}
}
}
##########################
# Other resources
##########################
instance of PostgreSQL-VM {
name: postgresql-vm;
instance of PostgreSQLServer {
name: postgresql-server;
instance of ActivitiPgSQLDatabase {
name: activiti-database;
databaseName: activiti;
# The database user name must be defined in lower case and '-' is forbidden
databaseUser: petalsseactiviti;
databasePwd: PetalsSeActiviti;
}
}
}
{code}
{column}
{section}
h1. Deploying your PVC instance
Once your Roboconf PVC application is ready, it is deployed as any Roboconf application through the Roboconf administration console:
# Create a *New Application Template*
!new-app-template.png|thumbnail!
# *Select* your Roboconf PVC application archive and *upload* it
!upload-template.png|thumbnail!
# Next, *create a new application*
!new-app.png|thumbnail!
# The application is created
!app.png|thumbnail!
# Go to the instance management page
!instance-management.png|thumbnail!
# And *deploy and start all*
!all-is-started.png|thumbnail!