BPEL Engine
Provides the orchestration and execution of BPEL processes.
Though there are still debates around BPEL specifications, and the technology is not yet very mature, I think it offers a great tool in designing the business processes.
To sustain complex, big business process orchestration, in big organizations, we need the power of grid computing and here GigaSpaces reveals it's power.
Framework
All BPEL processes, activities and orchestration are build on top of the framework.
The Framework provides a mechanism for interrupting execution and persisting execution state.
It can be used not only by the BPEL engine, but also provides the infrastructure for any application that deal with the following key issues:
-persistentce of execution state - provided by GigaSpaces
-resume execution - provided by the framework
-concurency - provided by the framework
This is similar to the Apache Jacob framework.
The framework is not at it's final design, it is a starting point for developing a scalable,robust solution based on JavaSpaces technology.
Building and deploying
The latest production source code can be downloaded from the svn tags (http://www.openspaces.org/svn/gbe/tags/framework).
Prerequisites
Set the GigaSpaces installation dir in the build.xml file.
<condition property="gshome.dir" value="your_GigaSpaces_installation_dir">
<not>
<isset property="gshome.dir"/>
</not>
</condition>
The lib folder from the working directory should contain the following libraries:
-asm-2.2.3.jar
-asm-commons-2.2.3.jar
-cglib-2.2_beta1.jar
These libraries can be downloaded from internet or from here
How to build
Type ant dist. A folder named framework should appear in the dist folder of the working directory.
How to deploy
The folder can be deployed either using ant or through the GigaSpaces Management Center.
To deploy from ant, type ant deploy-framework.
To deploy using the GigaSpaces Management Center, copy the framework project previously build, into the deploy folder located in the GigaSpaces home.
The deployment contains two examples build with the help of the framework:Sequencer and EvenNumber generator.
These two framework implementations are deployed along with the framework itself, and the output is presented in the figure below.
The logical architecture of the Sequencer implementation is presented below.
The source code of Sequencer is presented below:
package org.openspaces.bpel.examples;
import org.openspaces.bpel.framework.RunnableObject;
/**
*
* @author Mihai Lucian
* sequence numers generator implemented on top of the framework
* given an upper limit, prints all natural numbers to the upper
*
*/
public class SequencerImpl extends RunnableObject implements StartUp {
private int start=0;
private int end=0;
public static final String TYPE="Sequencer";
public SequencerImpl(){
}
public void ingest(Object request) {
this.start=((SequenceRequestObject)request).getStart();
this.end=((SequenceRequestObject)request).getEnd();
};
public void run() {
SequenceChannel channel=newChannel(SequenceChannel.class);
instance(new Sequencer(start,end,channel));
instance(new Printer(channel));
}
public class Sequencer extends RunnableObject{
private int start=0;
private int end=0;
private SequenceChannel sequenceChannel=null;
public Sequencer(){
}
public Sequencer(int start_,int end_,SequenceChannel sequenceChannel_){
this.start=start_;
this.end=end_;
this.sequenceChannel=sequenceChannel_;
}
public void run() {
sequenceChannel.next(start, (SynchChannel)listener(new SynchChannelListener(newChannel(SynchChannel.class)){
@Override
public void ret() {
if (start<end) instance(new Sequencer(start+1,end,sequenceChannel));
}
}));
}
}
public class Printer extends RunnableObject{
public SequenceChannel sequenceChannel=null;
public Printer(){
}
public Printer(SequenceChannel sequenceChannel_){
this.sequenceChannel=sequenceChannel_;
}
public void run() {
listener(true,new SequenceChannelListener(sequenceChannel){;
@Override
public void next(int n, SynchChannel synchChannel) {
System.out.println("STEP:"+n);
synchChannel.ret();
}
});
}
}
}