Hi, Questetra users! I’ m HATANAKA, Questetra CTO.

We have created a Workflow App for web application form in which verifying on entered email address.

How to Utilize Receive Task (Form) – Email Address Verification through Webform Application

And then next, we set up an expiration on the web form.

How to Utilize Receive Task (Form) – Set a Deadline for Application Form

Today, we are going to let applicants enter their phone number, in addition to that. Also, we will implement verification on the phone number.

The Workflow diagram so far is as follows.

  1. An applicant enters an email address at the Start Event (Form).
  2. Send an email to the address entered at #1 to inform the URL of #3 below.
  3. Have the applicant entering the rest of the information to the Receive Task (Form).
  4. The Human Task is something as an appendix.

The lower half that is split by the AND gateway is a processing for expiration on the web form.

We are going to revise to the following.

  1. An applicant enters an email address and a phone number at the Start Event (Form).
  2. Send an email to the address entered at #1 to inform the URL of #4 below.
  3. Make a phone call to the number entered at #1 to inform verification code to be entered at #4 below.
  4. Have the applicant entering the verification code and the rest of the information to the Receive Task (Form).
  5. The Human Task is something as an appendix.

We will incorporate the mechanism described in the previous article “Automatically Making a Phone Call in the Middle of Workflow”.

Automatically Making a Phone Call in the Middle of Workflow

First, arrange the Data Items. Those starred items are Data Items to be added newly.

Data Item Type Required Permission at Start Event (Form) Permission at Receive Task (Form) Permission at Human Task
Title No No display No display Only display
Email address String single line Yes Editable Only display Only display
★Phone number String single line Yes Editable Only display Only display
Name String single line Yes No display Editable Only display
★Verification code Numeric Yes No display Editable Only display
Form key String single line No No display No display Only display
Initial value: #{#randomString(20)}
Deadline Datetime No No display No display Only display
Initial value: processInstanceStartDatetime.addDays(7)
API Key String single line No No display No display Only display
Initial value: #{#randomString(5)}
★callback url String single line No No display No display Only display
★Verification code (Retention at server) Numeric No No display No display Only display

Referring to the mechanism in “Automatically Making a Phone Call in the Middle of Workflow”, I added

  • [Phone number]: Phone number of the applicant. It will be the destination of the phone call for verification.
  • [API Key]: Used in the Receive Task (Webhook). It will be a part of the callback URL.
  • [callback url]: The URL for callback when Twilio succeeds connecting a call.

In addition to these, I added

  • [Verification code]
  • [Verification code (Retention at server)]

The latter is a number which is dynamically generated by Questetra and informed to the applicant. The former is the number which is entered by the applicant at Receive task (Form). By matching both numbers, we confirm the existence of the applicant’s phone number.

The Workflow diagram is as follows.

“Phone call outgoing” surrounded by red rectangle is the part I have added. That part is a copy of the Workflow App I created in the previous blog post.


For “Generate verify code” that is at the top of the red-rectangle surrounded part, an Add-on of random number generation is used.

Random Number Generator

Please refer to the following for importing Add-ons.

M415: Adding an Auto-Step to be Used for Business Process Definition

The settings are as follows. It generates a random number of between 0 and 99, and save it in “Verification code (Retention at server)”.

Token will move to Error Boundary Event when processing fails (Uncheck)
Set Max Number (100 returns 0 – 99) 100
Select NUMERIC DATA for Random Number “Verification code (Retention at server)”

I omit explanations of the settings in “callback url calculation” and the Throwing Message Intermediate Event (HTTP).
At the “callback url calculation”, it calculates the URL of the Receive Task (Webhook) below.
Set the Throwing Message Intermediate Event (HTTP) as to call out “Twilio Voice API Call”.
Please make these settings referring to the previous blog post.

Next, the settings of Receive Task (Webhook). It returns “Contents of talk” responding Twilio’s callback.
It must be configured so that tell the verification code.

String type data item with the API key “API Key”
Method of receiving HTTP request POST
Content-Type of HTTP request application/x-www-form-urlencoded
String type data item that will save the request body
Content-Type of HTTP response text/xml;charset=UTF-8
Body of HTTP response
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Say voice="alice" language="en-US">Thank you for applying.</Say>
    <Say voice="alice" language="en-US">The verfication code is</Say>
    <Say voice="alice" language="en-US">#{data['8']}</Say>
    <Say voice="alice" language="en-US">です。</Say>
    <Say voice="alice" language="en-US">Your verfication code is</Say>
    <Say voice="alice" language="en-US">#{data['8']}</Say>
</Response>

#{data['8']} is for retrieving “Verification code (Retention at server)”.
Concerning the body of TwiML specified with Response, they principally recommend that to play a recording for a fixed part (using <Play> tag), and use the speech engine (using <Say> tag) only for a part which dynamically varies.

Some may say that if I specialize the phone number to mobile phone, SMS is enough rather than a phone call. Maybe it would be stylish if the applicant can choose either SMS or phone? Regarding that improvement, I will try someday.

That’s it, for today.

2 thoughts on “Phone Number Verification through Web Form Application”

  1. Pingback: Add Regular Expression on Application Webform – Questetra Support

  2. Pingback: Sending a Text Message in the Middle of Workflow Using SMS – Questetra Support

Comments are closed.