Introduction

Twister is designed to be used in two ways: in a standalone server mode, invoked as a Web Service through XML over HTTP and in an embedded mode, executed in the same VM as your application and called directly through your method invocation.

Only the embedded mode is supported by the current version of twister but we'll be working on the web service mode very shortly and will release it as soon as possible. We will keep a great attention in making the process of migrating from one mode to another very simple.

Embedding Twister in your application

To embed twister in your application, you will need to complete the following steps:

  • setup the classpath of your applicationto including twister jar and twister dependencies libraries.
  • start the services needed by twister to run: a relational database and a XML database. We're using hibernate as the persistence layer to access the database, so by changing hibernate configuration files you can make twister work on most relational databases. Default configuration uses HSQL.
  • Create the BPEL description of your process that basically defines correlations, variables and activities.
  • Customize the way you want to get your services invoked by Twister.
  • Deploy your processes using the process deployer interface.
  • Make your application to create appropriate messages given a basic message structure and the BPEL description and send those messages to twister.

Classpath and dependencies

To setup your classpath for Twister you will need several li braries. To run, twister needs a persistence layer with a relational database and an XML database, many XML libraries and other utility libraries. To define the classpath used by twister in your ant scripts, copy and paste the content of the file ant-cp.txt located in the bin directory of twister's distribution.

When this is done, just add this classpath definition to your application classpath and everything should be alright. If you are using maven (which is a great idea), use the dependencies in the project.xml located in the bin directory of twister's distribution.