This page describes pipelets and their lifecycle.
Pipelets are reusable Java Components that can be orchestrated in a synchronous workflow or pipeline. They are used to process the data contained in records. The default SMILA workflow processor uses BPEL to represent pipelines.
A pipelet is a POJO that implements the interface org.eclipse.smila.processing.Pipelet. Its lifecycle and configuration are managed by the workflow engine. An instance of a pipelet is not shared by multiple pipelines (workflows), even multiple invocations of a pipelet in the same pipeline do not share the same instance. Each <invokePipelet> pipeline has its own instance. An instance may still be accessed by multiple threads, for example if the same pipeline is executed in parallel. The configuration of each pipelet instance is included in the <invokePipelet> call in the pipeline. Technical details on pipelet development can be found in How to write a Pipelet.
The following diagram shows the lifecycle of pipelets.
Pipelets live inside the workflow engine. When the engine starts, it reads the pipeline definitions (i.e. BPEL workflows) from the ConfigurationHelper. The pipelines are introspected for pipelet invocations (invokePipelet extension activities) and the pipelet configurations that are contained in the invokePipelet XML elements. For each such element it creates an instance of the specified pipelet class, parses the configuration from the BPEL document and injects it into the pipelet instance. The pipelet instance is stored in the workflow engine as long as the engine is not stopped (and as long as the bundle providing the pipelet is available, of course). So one single pipelet instance exists for each occurrence of a pipelet in a pipeline. The pipelet must be capable of parallel execution because each execution of a pipeline uses the same pipelet instances.
We have a convention that records can have a map element in attribute _parameters and that the elements of this map should be interpreted by pipelets as overrides for their configuration properties. The class org.eclipse.smila.processing.parameters.ParameterAccessor provides helper methods for checking if the record has such "runtime parameters" set and getting them from there, or from the pipelet configuration, if not overridden. However, the accessor can easily be told to look in another attribute, if necessary, or to even use the top-level attributes of the records for parameters. The latter is used by org.eclipse.smila.search.api.helper.QueryParameterAccessor, because in search processing the convention is that query parameters are at top-level of the request record.