The present concept is addressed to developers who want a high level overview of pipelet development.
Pipelets are conceptually a sub-element of pipelines . If you want to know more about pipelines, see the according chapter in the Application Programming Guide(available on the product DVD).Pipelines , and with these pipelets, are used in many contexts . There are further documents that illustrate the use of pipelets:
Pipelets are small, re-usable units or building blocks that perform the business logic in Intershop 7. Each pipelet models a discrete business function.
Based on business objects, pipelets can be programmed to solve a particular business function, such as determining the price of a product in a basket. Pipelets are integral components of pipelines.
For example, the CheckSessions
pipeline (see below) executes a stored procedure to clean up session states. It breaks down this process into the following processes, each being modeled by a pipelet:
Pipelets interact with the business object layer by using business objects to access information persistently stored in the database. They access managers of the business object layer to obtain business objects and to operate on them.
Pipelets also interact with pipelines/the pipeline processor. Pipelines contain pipelets (and other components), each pipelet representing a different processing step within the pipeline. Pipelines represent a model for complex business processes where each pipelet within the pipeline fulfills only one, discrete business function.
Pipelets exchange data with other pipelets via the pipeline dictionary. Pipelets use the pipeline dictionary to read and/or write dynamic data produced during pipeline execution. Pipelets may also use and modify data from the current session object, and read configuration data.
Each pipelet consists of a Java class file (pipelet class) and two or more XML files (pipelet descriptor files). Pipelet classes have the following general characteristics:
com.intershop.beehive.core.capi.pipeline.Pipelet
. The base class defines several methods used by the pipeline processor when executing a pipelet node.execute()
method. The execute()
method, called by the pipeline processor when executing a pipelet node, encodes all operations performed by the pipelet. The execute()
method receives the pipeline dictionary as parameter.execute()
method returns a status code back to the pipeline processor. The default return value is PIPELET_NEXT
, indicating that the pipelet execution was successful and that the next node in the default execution path of the pipeline should be targeted. The return value PIPELET_ERROR
can be used to indicate that the pipeline execution should continue via the pipelet's modeled error exit, so allowing the pipelet to influence the flow of the pipeline execution. This return value can be used if the pipeline defines an error exit, e.g., a special branch for error handling, for the respective pipelet.The basic structure of a pipelet class (with default return constant) is shown below:
public class MyPipelet extends Pipelet { public int execute(PipelineDictionary dict) throws PipeletExecutionException { // do something here ... // set return value return PIPELET_NEXT; } }
Each pipelet is associated with two or more XML-based descriptor files: a parameter file and a description file(one per locale).
The parameter file stores the pipelet parameters and properties including the pipelet name, class name and package path, transaction properties, configuration data, as well as information about data the pipelet reads from or writes to the pipeline dictionary and the current session object.
The description file stores localizable information, such as the general pipelet description and descriptions associated with particular pipelet properties. See the Intershop Studio User Guide(Intershop Studio's Online Help) for information on pipelet properties and parameters, and how to set them in Intershop Studio.