Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

SMILA/Documentation/Pipelets

This page describes pipelets and their lifecycle.

Definition

Pipelets are reusable Java Components in a BPEL workflow and can be orchestrated like any regular BPEL Service. They are used to process the data contained in records.

A pipelet is a POJO that implements the interface org.eclipse.smila.processing.SimplePipelet. 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 BPEL pipeline. Technical details on pipelet development can be found in How to write a Pipelet.

Lifecycle

The following diagram shows the lifecycle of pipelets.

Lifecycle of Pipelets.png

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 invocation XML elements. For each invocation 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 for each single pipelet invocation occurring in the pipelines a different pipelet instance exists with a single configuration.

Runtime Parameters

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.

Back to the top