Document Tree
Document Properties
Kbid
M25405
Last Modified
04-Feb-2020
Added to KB
06-Dec-2013
Public Access
Everyone
Status
Online
Doc Type
Concepts
Product
  • ICM 7.10
  • ICM 11
  • ICM 12
Concept - Pipelets

Introduction

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).

References

Pipelines , and with these pipelets, are used in many contexts . There are further documents that illustrate the use of pipelets:

What are 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:

  • Performing an access control
  • Deleting expired session information

The CheckSessions pipeline

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.

Pipelet Class

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:

  • A pipelet class extends the abstract base class com.intershop.beehive.core.capi.pipeline.Pipelet. The base class defines several methods used by the pipeline processor when executing a pipelet node.
  • A pipelet class must implement the 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.
  • The 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.
  • If the pipelet execution fails, for instance if a required input parameter is not available, a PipeletExecutionException should be thrown. While returning PIPELET_ERROR indicates a soft error used to influence the pipeline execution (e.g., the user forgot to enter his password), throwing the exception implies a hard error indicating a defect in the template or pipeline design (e.g., the name of the authentication server is not available in the pipeline dictionary as required).

The basic structure of a pipelet class (with default return constant) is shown below:

Basic structure of a pipelet
public class MyPipelet extends Pipelet
{
  public int execute(PipelineDictionary dict) throws
   PipeletExecutionException
  {
   // do something here
   ...
   // set return value
   return PIPELET_NEXT;
  }
}

Pipelet Descriptor Files

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.

Disclaimer
The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.
The Intershop Knowledge Portal uses only technically necessary cookies. We do not track visitors or have visitors tracked by 3rd parties. Please find further information on privacy in the Intershop Privacy Policy and Legal Notice.
Home
Knowledge Base
Product Releases
Log on to continue
This Knowledge Base document is reserved for registered customers.
Log on with your Intershop Entra ID to continue.
Write an email to supportadmin@intershop.de if you experience login issues,
or if you want to register as customer.