How to configure a pipeline
Following pages could also be interesting for you: |
To define a new pipeline, you need to add a pipeline.xml
file into the etc
directory of your module.
Here is some sample content for a pipeline.xml
file:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:TechDivision/ProcessPipelines/etc/pipeline.xsd">
<pipeline name="my_custom_pipeline" description="Some description" use-working-directory="true">
<conditions>
<pipeline_condition type="MyCompany\MyModule\Helper\Condition\Pipeline\CheckSomeThing" description="Some description"/>
</conditions>
<step name="my_first_step" executorType="MyCompany\MyModule\Model\Executor\DoSomeThing" sortOrder="10" description="" >
<conditions>
<step_condition type="TechDivision\ProcessPipelines\Helper\Condition\Step\AttemptsLimit\Limit5" description="Try step up to 5 times"/>
</conditions>
</step>
<step name="my_second_step" executorType="MyCompany\MyModule\Model\Executor\DoSomeMoreStuff" sortOrder="20" description="" >
<arguments>
<argument key="some_key" value="some_value" />
</arguments>
<conditions>
<step_condition type="TechDivision\ProcessPipelines\Helper\Condition\Step\PreviousStepsCompleted" description="Run after the first step"/>
<step_condition type="MyCompany\MyModule\Helper\Condition\Step\CheckSomeThing" description="Check something..."/>
</conditions>
</step>
<step name="my_third_step" executorType="MyCompany\MyModule\Model\Executor\DoClearingStuff" sortOrder="30" description="" runAlwaysStep="true">
<conditions>
<step_condition type="TechDivision\ProcessPipelines\Helper\Condition\Step\AttemptsLimit\Limit1" description="Try step up to 1 times"/>
<step_condition type="TechDivision\ProcessPipelines\Helper\Condition\Step\PreviousStepsFinished" description="Run always when one step started"/>
</conditions>
</step>
</pipeline>
</config>
Description for XML nodes and attributes
Node | Description |
---|---|
pipeline |
Definition of a new pipeline configuration. You can overwrite or extend existing pipelines by using the same name. |
-- name |
Required, |
-- description |
Optional, |
-- use-working-directory |
Optional, |
pipeline/conditions |
Optional; One or multiple conditions which should be |
pipeline/conditions/pipeline_condition |
Configuration of a pipeline condition |
-- type |
Required, |
-- description |
Optional, |
pipeline/step |
Each pipeline has at least one step. The step describes which executor should be run once the step
conditions are |
-- name |
Required, |
-- executorType |
Required, |
-- sortOrder |
Required, |
-- description |
Optional, |
-- runAlwaysStep |
Optional, |
pipeline/step/arguments |
Optional; Holds one or many executor arguments |
pipeline/step/arguments/argument |
Step executor argument |
-- key/value |
Required, |
pipeline/step/conditions |
One or multiple conditions that should be |
pipeline/step/conditions/step_condition |
Configuration of a step condition |
-- type |
Required, |
-- description |
Optional, |
There are already several default conditions and executors available therefore. |