Pages

Wednesday, November 17, 2010

Submit Your Requests in Our Webform, and We'll Process Them All

If a company has a system in which work comes in from external sources, the internal process for handling that work inevitably goes through a continuous cycle of improvement. In other words, processes that are initiated externally are what aids an organization's ability to adopt to external environments. (external as in: outside the company, outside the division, outside the team, the person sitting next to you...)

This is a workflow that automatically handles inquiries (jobs) that are inputted in a Google Docs spreadsheet form. There is a split for when the member needs accounting's advice.


But wait, in most real-world cases not all inquiries (jobs) come from a single webform. An inquiry management system should take phone calls, emails and direct visits into consideration.




Setting system in Questetra BPM Suite SaaS Edition

1. [INTERNAL SYSTEM] Prepare an externally-initiated workflow
First, create a process model that has a Message Start Event. We'll use the above workflow in this sample.

2. [INTERNAL SYSTEM (Test)] Test the prepared workflow (optional)
After activating the workflow prepared in step 1, check the URL address found in the [Version Detail] screen.

Example)
https://s.questetra.net/XXXXXXXX/System/Event/MessageStart/start?processModelInfoId=ZZ&nodeNumber=WW&key=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
In our sample workflow, there are four necessary input fields: data[0] (Timestamp), data[2] (Name), data[3] (Email) and data[4] (Inquiry). So the system should automatically start a new process when it receives an access like:
https://s.questetra.net/XXXXXXXX/System/Event/MessageStart/start?processModelInfoId=ZZ&nodeNumber=WW&key=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY&data[0].input=2010-11-01&data[0].time=12:45&data[1].input=Barack+Obama&data[2].input=barack@example.com&data[3].input=Can+we...Yes+we+can
As a test, copy & paste this long address into your browser (you should get a blank page), and make sure a new task is created in your task list.




3. [EXTERNAL SYSTEM] Prepare a form in Google Docs
Log into Google Docs and create a new file from [Create new > Form]. (You can change the theme if you want.)

Give the form a title (e.g., INQUIRY) and create three questions (Question Titles: "Your name," "Your email address," and "Your inquiry." Set the Question Type of "Your inquiry" as "Paragraph text").

You should get a spreadsheet with "Timestamp" in column A, "Your name" in column B, "Your email address" in column C and "Your inquiry" in column D.

4. [EXTERNAL SYSTEM] Prepare a script that sends inputted info
Open the spreadsheet, and create a new script from [Tools > Scripts >Script editor]
Replace...
function myFunction() {
}
...with...
function startWorkflow(e) {
var longurl = "https://s.questetra.net/XXXXXXXX/System/Event/MessageStart/start";
var payload = "processModelInfoId=ZZ&nodeNumber=WW&key=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY";
payload += '&data[0].input=' + encodeURIComponent(Utilities.formatDate(new Date(), "JST","yyyy-MM-dd"));
payload += '&data[0].time=' + encodeURIComponent(Utilities.formatDate(new Date(), "JST", "HH:mm"));
payload += '&data[1].input=' + encodeURIComponent(e.values[1]);
payload += '&data[2].input=' + encodeURIComponent(e.values[2]);
payload += '&data[3].input=' + encodeURIComponent(e.values[3]);
var params = {
method: 'post',
payload: payload
};
UrlFetchApp.fetch(longurl, params);
}
...and save. Make sure you replace "XXXXXXXX",  "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY", "ZZ" and "WW" with your own info. If you are not in Japan, you will probably want to also change "JST" to your own timezone.

5. [EXTERNAL SYSTEM] Set the script to work whenever someone submits info from the form
In the Script editor, select [Trigger > Current script's triggers]. Add a new trigger and set it to: Run [startWorkflow], Events [From spreadsheet] [On form submit].
Voila!