ProcessMaker - GMail and Google Drive integration

Introduction

This document describes how to make use / demonstrate the G Suite integration. It is based on the gsuite workspace of the PoC server, which has been prepared for this. Username is admin. Password is Al3ph512. including the final point. This has been tested in ProcessMaker 3.1.1. 

GSuite domain preparation and configuration

In order to use this integration, you will need to create a Service Account in the Google Apps / G Suite domain that will be used. You can find directions on how to do that here. If you want to use the integration with the processmaker.com domain, you can use this key, which has been provided by Former user (Deleted) for testing purposes.

ProcessMaker Configuration

ProcessMaker server publishing

The ProcessMaker server must be accessed via an HTTPS (not plain HTTP) connection. This is required since some ProcessMaker pages will be embedded inside the GMail web interface, which is HTTPS. Therefore, the gsuite workspace must be accessed via this URL: https://poc.processmaker.com/sysgsuite/en/neoclassic/login/login

Setting up the GSuite integration keys

In order to configure the ProcessMaker - GSuite integration, log into ProcessMaker with an admin user and go to Admin → Settings → PM GMail:

Enter the Service Account email address and the Service Account JSON-encoded certificate. This should be provided by your domain administrator once the GSuite domain has been properly configured. Click on the Test Connection button:

The Successful connection message should be shown. If it isn't, there's most likely an error in the GSuite domain configuration or server account email and JSON certificate.

Setting up cron jobs

GSuite integration requires cron jobs to be run at a relatively high frequency in order to synchronize ProcessMaker case folders with folder in GMail. Therefore, the following script should be set up to run every few minutes or so:

Cron for GSuite integration
#!/bin/bash

php -f /opt/processmaker/workflow/engine/bin/cron.php  +wgsuite emails
php -f /opt/processmaker/workflow/engine/bin/cron.php  +wgsuite synchronize-gmail-labels
php -f /opt/processmaker/workflow/engine/bin/cron.php  +wgsuite synchronize-documents-drive

On the PoC server, the script has already been created under /opt/processmaker/gsuite_cron.sh . The easiest and most reliable way to set it to run is via Cron daemon. However, since the PoC server runs inside a container that lacks a Cron daemon, for demonstration purposes, the following command can be executed on the command line during demonstrations to have the script run every ten (10) seconds:

Cron for GSuite integration
[root@19d99f1f76d3 processmaker]# watch -n10 'bash /opt/processmaker/gsuite_cron.sh' 

GMail Integration

In order to demonstrate the GMail integration, the following must be set up:

  • The user that will be using ProcessMaker via GMail must have a corresponding ProcessMaker account. Hence, if GSuite user eduardo.ortega@processmaker.com is going to be using ProcessMaker, the ProcessMaker server MUST have A SINGLE user account with the exact same email address.
  • The Chrome web browser that is going to be used must have the ProcessMaker extension installed.
  • The Chrome web browser that is going to be used must be signed in with the corresponding GMail account. For directions on how to sign into Chrome, see this link.

Once these requisites are fulfilled, the integration can be set up and tested as explained below.

Configure the ProcessMaker Extension

Log into GMail (Inbox not covered). Once the GMail web page loads, a configuration dialog should be shown:

Enter the corresponding server hostname and workspace. As indicated above, the ProcessMaker server MUST be accessible via HTTPS. Click on Save Settings, and a message confirming a successful connection should be shown:

Click on the OK button. The GMail page will be reloaded, and it should show the red-circled items shown below:

The left hand side labels correspond to the ProcessMaker Draft, Inbox, Participated and Unassigned case folders on the Home tab. The content of this folders is kept updated by the Cron jobs described above.