Workflow and forms in Wave

I have created an application to simulate how it is possible to make workflow applications in Google Wave. A description and reason why workflows are interesting can be found on this page. Also look at the robot wave samples to test out the solution. In this blog I’ll describe how workflows and forms can be created inside waves. The code can be found at hire.

Forms

Forms are a quite basic part of all types of application, where the application requires some structured data to handle its processing. This could be Google search page with text field to enter the query and a submit button. It is also possible to create forms in Wave applications. A form in a wave can be created with the following commands.

Blip blip = wavelet.appendBlip();
TextView textView = blip.getDocument();
textView.appendMarkup("<p><b>Welcome to the First Wave Bank</b></p>");
FormView form = textView.getFormView();
form.append(new FormElement(ElementType.LABEL, "labelname","Your name"));
form.append(new FormElement(ElementType.INPUT, NAME_FIELD));

form.append(new FormElement(ElementType.LABEL, "labelamount",
        "Borrow amount in $"));
form.append(new FormElement(ElementType.INPUT, AMOUNT_FIELD));
form.append(new FormElement(ElementType.BUTTON, "submit", "Apply"));

First the blip we want on insert the form in is created. On the blip is it then possible to append XHTML styled text like showed.

The FormView element is created from the TextView. It is possible to add form elements to the FormView. Elements is added to the form with new FormElement(ElementType.INPUT, NAME_FIELD). The ElementType covers the different values which can be used. Second parameter is the name of the field. After that the value which could be showed is placed. This could be the text on the submit button or the text of a label.

When the user has completed the form he presses the submit button. It is then possible to validate and use the content from the forms.

FormElement name = form.getFormElement(NAME_FIELD);
FormElement amount = form.getFormElement(AMOUNT_FIELD);
FormElement reject = form.getFormElement(REJECT_BUTTON);
String errorMessage = "";
// check the content of a text field
if (name.getValue() == null
    || name.getValue().trim().length() == 0) {
         errorMessage += "Please enter name:\n";
}
// check if the approve button is pressed
approve.getValue().equalsIgnoreCase("clicked"));

First the FormElement is retrieved using getFormElement with the field name. It will be a good idea of to use the constants variables, to make sure you time the name of the field correct.

The value of a text element can be found by using the getValue(). For buttons you can find the button by find the button with the value “clicked”.

The current limitation with forms is that you cannot create dropdown lists. An alternative could be to use Radio buttons.

For this application the robots sends responds as plain text commands back to the user. I don’t know if some other way for communication should be created. The response could be made in a blip and then this communication blip is overwritten every time the user interacts with the robot. I don’t like the usability aspect of any of the two solutions, because it is not clear to the user what have changed.

Workflows

TheWaveBank robot guides the participant’s trough a process of completing the loan application. First when the robot is added it inserts a form using the commands showed in the first java code example.

To get the response, when the users press a button, the robot needs to subscribe to FORM_BUTTON_CLICKED.

If there is multiply forms in a wave it can be difficult to find the correct for to do the processing for. The best way would be to store information about which forms where placed which blips. Alternative is to use the approach used hire, where I check for a given form element to see which form I’m processing.

It is possible to see the user how has submitted a form with the getModifiedBy() on the blip. This can be compared to how are allowed to change the form. The elements of the forms then have to be set back to the original values. It would be better if it was possible to block access to blips for certain users.

    

Bookmark and Share

Workflow applications in Google Wave

One interesting aspect of Google Wave is the way that users can make semi structured workflows. In the workflows everyone can interact with each other in a simple flow manner. The workflow can be created just by adding other people to the conversation, and ask them questions or guide the process. This type of workflow can

But for some workflow instances you want to have the user to follow certain guidelines. You want another person for approve or sign the document, so what there is an agreement for the document. Something like this can also be performed by using voting Gadget. With the help of robots is it possible to make the workflow more structured. I have created a sample workflow application. The application emulates a bank loan submission form.

The process is as following:

  • The customer creates a Wave and writes a reason for getting the loan.
  • Then he adds the Bank robot. He thereby gets a form to fill in some fields, in a structured manner.
  • He submits the form. The robot sends the form to a bank employee. In this case the users “test” user for approval. The customer can’t approve the form, because of access limitations.
  • When the bank employee approves the application, the form data can be sent to the backend system.

This workflow is showed in the following video.

This is a proff of concept solution and demonstrates that it is possible to build workflows in Wave.

Using wave for frontend for a workflow engine, will allow the users to interact more with each other. It will give the participants a much better idea of the whole conversation and change the content in the mean time. I believe that this semi structured way for handling workflows is the easiest way to handle many of the tasks in today’s organizations. You don’t have to follow the rules completely, but can work the most natural way.

One problem with Wave workflows is that you don’t know which workflows you need to take action on. You just have a list of all the Waves, which has changed since you where on the page last time. This could maybe be solved using tags, which each user could search for.

For some workflows you need very strict or concrete results, like invoice approval. When you need to approve an invoice you need to assign the right cost elements to the different lines, get approval from manager and pay the vendor. This might be an area where the information given is too much structured data, so it is better to handle this in the ERP system.

Bookmark and Share