SMILA/Documentation/HowTo/Howto integrate a component in SMILA
This page summarizes the different types and complexity levels of integration of components in SMILA.
Due to its architecture SMILA allows for the easy integration of third-party components into its framework. Actually there are three different possible integration scenarios available:
- Integrating services in BPEL: the most frequently used integration scenario. It allows integration or exchange of functionality used to process records in the workflow engine.
- Integrating agents or crawlers: agents and crawlers unlock new data sources, providing additional input to SMILA
- Integrating alternative implementations for SMILA core components: offers experienced SMILA developers the potential to exchange existing implementations of SMILA core components with their own implementations.
Integration of Services in BPEL
There are several options on how to integrate new functionality in SMILA BPEL workflows (called Pipelines).
- Simple: as the standard BPEL functionality to invoke webservices. Not all data of SMILA Records are usable in this option.
- Default: the recommended way to integrate additional functionality in SMILA. Two interfaces allow for easy Java implementations of so called Pipelets and ProcessingServices.
- Advanced: an advanced alternative for integrating ProcessingServices that do not run in the same OSGi runtime as the BPEL workflow but in another OSGI runtime that may even run on a remote machine.
The simplest way of integrating additional functionality in SMILA is to call a webservice. This is a standard BPEL workflow engine functionality independent of SMILA. However, there are some limitations concerning the input and result data to/from webservices: In SMILA the workflow object (a DOM object) that enters the BPEL workflow contains by default only the Record IDs. Records and the data contained therin are NOT accessible from a BPEL workflow! The BPEL workflow can only access and use the values contained in the BPEL workflow object. It is possible to change this behaviour and add additional data to the workflow object by configuring filters in the configuration file org.eclipse.smila.blackboard/RecordFilters.xml. There you can select certain Attributes and Annotations that will be copied to the workflow object and so will be accessible by the BPEL workflow. Attachments are currently NOT supported, as binary data is not reasonable in DOM! Note that you also need to include all Attributes and Annotations in the RecordFilters.xml you want to write data to.
- A good example for this use case is the integration of [Language Weaver]. The Language Weaver Translation Server provides a webservice interface that allows a text to be translated into another language. This service could be easily used within SMILA.
Here are more detailed technical descriptions:
Default: local SMILA Pipelet or ProcessingService
The default technique to integrate functionality or software in SMILA is to write a Pipelet or ProcessingService that runs in the same OSGi runtime as the BPEL workflow engine. Pipelets are easier to implement than ProcessingServices, as they require only standard Java knowledge. For more information about Pipelets and ProcessingServices see Pipelets and ProcessingServices. Both Pipelets and ProcessingServices have full access to Records in SMILA via the BlackboardService. So it's easily possible to read, modify and store Records. In general Pipelets and ProcessingServices follow the same (sometimes optional) logical steps (of course this depends highly on the business logic to be executed). These steps are:
- read the configuration (optional)
- read input data from Blackboard (optional)
- execute the business logic
- write result data to Blackboard (optional)
In the part of your Pipelet/Processing service that implements the business logic you are totally free to use any desired technology. Some of the posibilities include
- use of POJOs (e.g. see the various XML Processing Pipelets)
- use any local available OSGi service, even other ProcessingServices (e.g. see the AperturePipelet that uses the ApertureMimeTypeIdentifier)
- use other technologies like JNI, RMI, Corba, etc. to integrate remote or non Java components (e.g. integration of Oracle Outside In Technology)
- Typical examples for Pipelets are the XML Processing Pipelets. These lightweight Pipelets are used for XML processing (e.g. XSL transformation). Each Pipeline uses it's own Pipelet instance.
- A good example for a ProcessingService is the LuceneIndexService. It provides functionality to index Records in Lucene indexes and can be used from multiple Pipelines in parallel.
Here are more detailed technical descriptions:
- How to write a Pipelet
- How to write a ProcessingService
- How to integrate the HelloWorld webservice as a Pipelet
Advanced: remote SMILA ProcessingService
Integration of Agents and Crawlers
Providing alternative implementations for SMILA Core-Components
SMILA's component based architecture even allows you to provide your own implementations of SMILA core components. More info comming soon ...
- a typical example is an alternative implementation of the DeltaIndexingManager that does not store it's state in memory but in the filesystem or in a database