This component was designed to instantiate new pipelines, which are not part of the own code or not defined in an XML file at all (e.g. you need a flexible count of steps).

How it works?

This module integrates into the heartbeat execution. Every time the heartbeat is executed, a data fetcher chain (TechDivision\PacemakerPipelineInitializer\Model\InitializationDataFetcherChain), which is an instance of TechDivision\PacemakerPipelineInitializer\Api\InitializationDataFetcherInterface collects the data from all registered data fetcher. And initiates pipelines depending on the given data.

Interfaces

InitializationDataFetcherInterface

interface InitializationDataFetcherInterface
{
    /**
     * @return InitializationDataInterface[]
     */
    public function execute(): array;
}

InitializationDataFetcherInterface

interface InitializationDataInterface
{
    /**
     * @return array
     */
    public function getPipelineConfiguration(): array;

    /**
     * @param array $pipelineConfiguration
     * @return void
     */
    public function setPipelineConfiguration(array $pipelineConfiguration): void;

    /**
     * @return array
     */
    public function getArguments(): array;

    /**
     * @param array $arguments
     * @return void
     */
    public function setArguments(array $arguments): void;
}

When to use this component?

You should use this component if you need to create pipelines dynamically. If the steps of your pipeline are fix, you should use the XML configuration.

With this module, you can create a pipeline by defining a PHP array or by loading an existing pipeline configuration from XML as an array and passing it to the data fetcher chain.

You’ll find an example for an implementation of this approach in techdivision/pacemaker-import-base package ⇒ TechDivision\PacemakerImportBase\Model\ImportFilesDataFetcher