Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents


Introduction

The Lazy Approval Tool Plugin is designed for effortless assignment approval using a URL. In this article, we will examine a sample application that sends a URL via email. The recipient of the email can then approve or reject the assignment by clicking on the URL provided in the email.

...

This plugin source code is available in JogetOSS repository at https://github.com/jogetoss/lazy-approval-tool

...

.


Plugin Information

Plugins Available in the Bundle:

  1. Lazy Approval Tool

This plugin bundle is compatible with Joget DX 8.


Expected Outcome

The user is able to approve or reject the assignment outside of Joget App. By utilising the email tool to send email with the URL, the user is able to click on the URL to perform assignment approval or rejection.

Image Added


Get Started

Prerequisites

1. Setup SMTP values in Joget App for the email tool to be working properly.

Image Added

Figure 1: SMTP Settings

Refer to Sign in with app passwords to generate the password for SMTP Gmail.

For more details, please refer to General Settings > SMTP Settings.  


2. API Domain/IP Whitelist

To ensure the successful operation of this plugin, it is essential to whitelist the domains or IP addresses of the host. Typically, this involves adding the IP address or domain name of your Joget application server to the whitelist. To access this section of Joget, go to Settings → General Settings and scroll down till you see API Domain/IP Whitelist section. (IMPORTANT NOTE: If this is not set, you will get a 400 Forbidden error when clicking on approve/reject)

Image Added

Figure 2: API Domain/IP Whitelist


Name

Description

API Domain Whitelist (Separated by ';')

Domain whitelist to allow API calls to Joget Workflow. Separated by semicolon.

Example

"localhost;www.joget.org;dev.joget.org”, or "*" to allow from everywhere.

In a production environment, do not use "*".

Doing so will allow anyone to call all JSON APIs from the Joget server.

API IP Whitelist (Separated by ';')

IP address whitelist to allow API calls to Joget. Separated by semicolon.

Example

"localhost; 192.168.101.10; www.joget.org;dev.joget.org ”, or "*" to allow from everywhere.

In a production environment, do not use "*".

Doing so will allow anyone to call all JSON APIs from the Joget server.

Steps

1. You can obtain the jar file by the latest release at https://github.com/jogetoss/lazy-approval-tool/releases.

2. Upload the plugin jar file in Joget by going to Settings → Manage Plugins.

3. You can choose to import the demo app or create the app from scratch.

Steps for importing demo app

1. Download the demo app from Download Demo App.

2. Go to Joget Home or All Apps and click on Import App to import the downloaded demo app.

Steps for creating app from scratch

1.

Inside The App

In this section, we will examine what the app does and how it does it. 

Form

The first part of the app is the form. This form gathers the user's name and email address. Inside the form, we also have hidden fields that keep track of the approval status. We'll get into how these hidden fields work when we talk about the processes. After that, we'll shoot out an email asking the user to either say yes or no to the assignment.

Image Modified

Figure

...

3: Sample App Form

Process


2. The second part of the sample app is the process. The process is where the Lazy Approval Tool is configured, to see how to configure the tool, check out Lazy Approval Tool Properties. The process starts off by prompting the user to submit the form, once the form has been submitted, the process will be triggered and an email will be sent to the user

...

Below shows the different process of single activity and multiple activity respectively.

Image Added

Figure 4: Process of Sample App (Single Activity)


Image Added

Figure 5: Process of Sample App (Multiple Activity)


3. Now you can create a UI to show the process and an Inbox list to show the process list.

Image Added

Figure 6: UI Builder 

Steps to run the plugin

1. To test on single activity, go to "Run Process Approval (Single Activity)" form and fill it. Make sure the approver has configured an email address in the "Users" section.

Image Added

Figure 7: Process for Single Activity


2. In "Process List", you will see that a process is running.

Image Added

Figure 8: Process List with a running process


3. Check your email, you will receive an email for the selected approver's email.

Image Added

Figure 9: Email received


4. Click on the email and click on "Approve" or "Reject".

Image Added

Figure 10: Email to Approve or Reject Assignment


5. You will be directed to a page saying assignment completed with all the details. After that, you can close the window.

Image Added

Figure 11: Redirected to message page


6. After that, go back to the app and see the "Process List". The assignment just now has been completed.

Image Added

Figure 12: Process List with no process


7. There will be an email saying assignment approved.

Image Added

Figure 13: Email with Assignment Approved

Notes

1. You can also click on the approval link and perform assignment in Incognito Mode, meaning that your Joget App does not have to be signed in to perform the task. Therefore, the assignee that the URL is sent to is important not to be shared out to unauthorised users.


Lazy Approval Tool Properties

Configure Lazy Approval Tool

Image Added

Figure 14: Lazy Approval Tool Configuration

Name

Description

Form *

The form of the process.

Process *

The process value to generate the lazy approval link.

Activity *

The activity value to generate the lazy approval link.

Assignee (Participant ID)

The assignee who is allowed to perform the lazy approval process.

Workflow Variable (Status)

The workflow variable that defines the approve or reject status.

Download Demo

...

Image Removed

Figure 2: Email Sent

After accepting or rejecting the assignment, a page will be redirected and the following message will be shown.

Image Removed

Figure 3: Redirected page with message

There will be another email sent to the user notifying them of their decision.

Image Removed

Figure 4: Email of the Notification

This is how the overall process looks like and how it works for single activity and multiple activity respectively.

Image Removed

Figure 5: Process of Sample App (Single Activity)

Image Removed

Figure 6: Process of Sample App (Multiple Activity)

This is what the configuration of the Lazy Approval Tool looks like in the process.

Image Removed

Figure 7: Lazy Approval Tool Configuration

If you would like to download the sample app and try out the tool for yourself, please note that you have to:

  • Configure the SMTP settings in the process in order to receive the emails. 
  • In the Joget System Settings > General Settings, set API Domain Whitelist to * (IMPORTANT NOTE: If this is not set, you will get a 400 Forbidden error when clicking on approve/reject).

...