Spikeflow - Online Form Builder Spikeflow - Online Form Builder

Tech notes

Tryout Spikeflow

Spikeflow Tech Note #001

Integration through Handlers

When you have built a user friendly and good looking flow to capture information from the end user, you need to do something with the captured data. Normally you would like to deliver it to a backend system like a relational database, an XML file in a file system or to some kind of workflow environment like Lotus Domino.

In Spikeflow this is done through the use of Handlers, code that is executed when the end user presses the forward button and all validation constraints are fulfilled. Spikeflow make the simple things simple and the complicated solutions possible. If you choose one of the built in Integration Handlers it's just a matter of adding the handler to the page where you want the action to happen and configure it to suite your environment.

Spikeflow - Integration Handlers

Standard Handlers

The standard Handlers available “out of the box” in Spikeflow is
  • Email Handler
  • Lotus Domino Handler

These are described in the Spikeflow User manual. All three can be used together with the XML Export Component. This will generate a simple W3C Schema based XML file, containing all the data the enduser entered and the signature if it has been digitally signed, that you can save, store or send with one of the Handlers.

Writing your own Handler

If you have special requirements you can write your own Handler. You can use the Groovy Scripting Language, a scripting language that looks pretty much like Java, but is more dynamic and supports a simplified syntax and support for closures. This can be accomplished without needing to compile anything. You add the Groovy Handler to the page and write your Groovy code in Spikeflow Creator. When you have uploaded the flow to the Spikeflow Runtime, the Handler is automatically active.

We have used the Groovy Handler successfully with SOAP Web Services. A WSDL file is used to compile a Web Service client with Axis or XFire. The resulting jar is added to the Runtime. The this client is used in the Groovy Handler like in this example:

To access a relational database is also easy in Groovy. Look at the Groovy documentation at groovy.codehaus.org to get an idea what's possible. There are also several good books written about Groovy.

If you don't want to use Groovy you can use Java. Basically you implement one method. In the Handler class you will have access to all supplied data from the user (you have access to the FlowState object that keeps track of the user). The Handler can be used to integrate with anything that has a Java API (CRM, CMS, ERP comes to mind).

nSpike has not yet published a public API for adding plugins. For now, to integrate your handler into the Runtime and Creator, you need to contact nSpike. We plan to have a public API available – lookout for an upcoming Tech Note.

 

Copyright © 2008 nSpike AB. All rights reserved.