Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: resized image sizes from 624 to 1000

Image Added

Cloud Foundry is an open source platform as a service (PaaS) for developers to deploy and scale applications without manually configuring and managing servers. The promise of “write once, run anywhere” means developers can build their apps on a programming language or framework of their choice, and be able to deploy it to any underlying cloud environment.

...

The Cloud Foundry platform is available from either the Cloud Foundry Foundation as open source software, or as a commercial product or service from multiple providers. Pivotal Cloud Foundry (PCF) is a commercial offering from Pivotal.Image Removed

As an open source low code platform to visually build enterprise web apps for coders and non-coders, Joget Workflow is a good complement for Cloud Foundry.

...

Follow the instructions provided at the end of to connect to PCF Dev, by logging in using the admin user and choosing the pcfdev-org organization: 

Code Block
cf login -a https://api.local.pcfdev.io --skip-ssl-validation

...

Create a service instance with the 1gb plan with the name jogetdb:

Code Block
cf create-service p-mysql 1gb jogetdb

...

Create a service instance using the PCF Local Volume Service with the name jogetdata:

Code Block
cf create-service local-volume free-local-disk jogetdata

...

Push the WAR to the Cloud Foundry space with a memory allocation of 1G and application name joget:

Code Block
cf push joget -p joget_installation_directory/apache-tomcat-8.5.23/webapps/jw.war -m 1G --no-start

...

Now that the Joget Workflow platform has been deployed in Cloud Foundry, the final step is to setup the database schema, based on https://docs.cloudfoundry.org/devguide/services/migrate-db.html#single-migration.

...

Info

If you are using Joget Workflow prior to version 6.0.3, you need to modify the default Joget Workflow SQL setup script due to a limitation in MySQL for PCF where explicit locking is not supported i.e. LOCK TABLES.

SSH into the application:

Code Block
cf ssh joget

And download the modified script:

...

Code Block
curl https://raw.githubusercontent.com/jogetworkflow/jw-community/6.0.3/wflow-consoleweb/src/main/resources/setup/sql/jwdb-mysql.sql > ~/app/WEB-INF/classes/setup/sql/jwdb-mysql.sql

...

 
exit

...

At this point, we can obtain the MySQL database service credentials by viewing the environment variables:

Code Block
cf env joget

In particular, note down the p-mysql service hostname, port, name, username and password.

Code Block
System-Provided:

...


{

...


"VCAP_SERVICES": {

...


 "local-volume": [

...


  {

...


   "credentials": {},

...


   "label": "local-volume",

...


   "name": "jogetdata",

...


   "plan": "free-local-disk",

...


   "provider": null,

...


   "syslog_drain_url": null,

...


   "tags": [

...


    "local"

...


   ],

...


   "volume_mounts": [

...


    {

...


     "container_dir": "/home/vcap/wflow",

...


     "device_type": "shared",

...


     "mode": "rw"

...


    }

...


   ]

...


  }

...


 ],

...


 "p-mysql": [

...


  {

...


   "credentials": {

...


    "hostname": "mysql-broker.local.pcfdev.io",

...


    "jdbcUrl": "jdbc:mysql://mysql-broker.local.pcfdev.io:3306/cf_d13b2f40_c124_4c4b_a900_2269e10a7052?user=XMpalSAOEYcClZl2\u0026password=uSRs0B1D6NPNuLOe",

...


    "name": "cf_d13b2f40_c124_4c4b_a900_2269e10a7052",

...


    "password": "uSRs0B1D6NPNuLOe",

...


    "port": 3306,

...


    "uri": "mysql://XMpalSAOEYcClZl2:uSRs0B1D6NPNuLOe@mysql-broker.local.pcfdev.io:3306/cf_d13b2f40_c124_4c4b_a900_2269e10a7052?reconnect=true",

...


    "username": "XMpalSAOEYcClZl2"

...


   },

...


   "label": "p-mysql",

...


   "name": "jogetdb",

...


   "plan": "1gb",

...


   "provider": null,

...


   "syslog_drain_url": null,

...


   "tags": [

...


    "mysql"

...


   ],

...


   "volume_mounts": []

...


  }

...


 ]

...


}

...


}

...


{

...


"VCAP_APPLICATION": {

...


 "application_id": "a450291a-0440-4727-ba78-c65f12d99961",

...


 "application_name": "joget",

...


 "application_uris": [

...


  "joget.local.pcfdev.io"

...


 ],

...


 "application_version": "aedb8053-7288-4272-bcf7-85eab3dbd360",

...


 "cf_api": "http://api.local.pcfdev.io",

...


 "limits": {

...


  "disk": 512,

...


  "fds": 16384,

...


  "mem": 1024

...


 },

...


 "name": "joget",

...


 "space_id": "4376eb82-3935-49c1-b543-8df589392831",

...


 "space_name": "pcfdev-space",

...


 "uris": [

...


  "joget.local.pcfdev.io"

...


 ],

...


 "users": null,

...


 "version": "aedb8053-7288-4272-bcf7-85eab3dbd360"

...


}

...


}

...



User-Provided:

...


JBP_CONFIG_SPRING_AUTO_RECONFIGURATION: [enabled: false]

...


JBP_CONFIG_TOMCAT: {tomcat: {context_path: "/jw"}}


Access Joget Workflow at
http://joget.local.pcfdev.io/jw/ and you will be presented with the database setup page.

Proceed to setup the database according to the instructions at https://dev.joget.org/community/display/KBv6/Setting+Up+Database.

Image Modified

Once setup is complete, you will be brought to the Joget Workflow App Center.

Image Modified

Build a Complete App in 30 minutes, No Code!

With the Joget Workflow platform up and running, it is now possible to build a full-fledged app running on Cloud Foundry with dashboards, calendar, approval workflow and data management within 30 minutes. And, it can be done without coding and you essentially drag-and-drop, point-and-click and configure your way through instead. It’s also possible to use your touch device to build it.

Image Removed

Watch the 30 minute video below, which demonstrates an authentic, real-time example of building the app from scratch.

https://www.youtube.com/watch?v=edqxt9zx_IE 

To get started with Joget Workflow:


Appendix A: Application Manifest File

Optionally, an application manifest file can be used to specify environment variables and bind services.

manifest.yml:

Code Block
---

...


applications:

...


- name: joget

...


 memory: 1G

...


 buildpack: https://github.com/cloudfoundry/java-buildpack.git

...


 path: /path_to/jw.war

...


 services:

...


   - jogetdb

...


   - jogetdata

...


 env:

...


   JBP_CONFIG_SPRING_AUTO_RECONFIGURATION: '[enabled: false]'

...


   JBP_CONFIG_TOMCAT: '{tomcat: {context_path: "/jw"}}'

However, there is a limitation that the current version of Cloud Foundry does not support  specifying parameters when binding parameters, so binding of the local volume service to the Joget data directory has to be done manually:

Code Block
cf bind-service joget jogetdata -c '{"mount":"/home/vcap/wflow"}'
cf restage joget


Appendix B: Useful Cloud Foundry Commands

View application logs:

Code Block
cf logs joget


Restage the application after modifying service bindings or environment variables:

Code Block
cf restage joget


Stop PCF Dev VM:

Code Block
cf dev stop


Delete the PCF Dev VM:

Code Block
cf dev destroy


Uninstall the PCF Dev Plugin:

Code Block
cf uninstall-plugin pcfdev


View PCF Dev App Manager:

...