You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »


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.


Get Started

Prerequisites

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

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)

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. 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.

Figure 3: Sample App Form


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.

Figure 4: Process of Sample App (Single Activity)


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.

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.

Figure 7: Process for Single Activity


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

Figure 8: Process List with a running process


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

Figure 9: Email received


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

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.

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.

Figure 12: Process List with no process


7. There will be an email saying assignment approved.

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

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.



  • No labels