A newer version of this documentation is available: View the Latest Version

StepCondition

  • Steps are created together with a pipeline.

  • Step conditions define whether a step can or is allowed to get executed or not.

  • Own conditions can be implemented with the \TechDivision\ProcessPipelines\Api\StepConditionInterface, which also can be used in a Pipeline.XML.

  • The isReady function defines when a step can or is allowed to be executed over the heartbeat.

  • The components contain a set of standardized step conditions.

Condition Description

AttemptsLimit

With the condition AttemptsLimit the number of step repetitions can be defined.

That ensures a step can be executed up to 5 times in the heartbeat cycle if errors occur during processing. If the error is still present after the 5th time, the pipeline is aborted, or the step gets no longer executed.

A great example for a five times execution can be found in the following component DI:

Virtualization of the AttempsLimit

vendor-techdivision-process-pipelines-etc-di.xml
<virtualType name="TechDivision\ProcessPipelines\Helper\Condition\Step\AttemptsLimit\Limit5" type="TechDivision\ProcessPipelines\Helper\Condition\Step\AttemptsLimit">
    <arguments>
        <argument name="data" xsi:type="array">
            <item name="limit" xsi:type="string">5</item>
        </argument>
    </arguments>
</virtualType>

TimeBetweenAttempts

If a step fails and makes further attempts via the TimeBetweenAttempts condition, it will always be executed with the next heartbeat.

With TimeBetweenAttempts, as an example, 5 minutes (5 heartbeats by default) can be skipped before the step is executed again.

A great example for the execution of a 5-minute wait can be found in the following component DI:

Virtualization of the TimeBetweenAttemps

vendor/techdivision/process-pipelines/etc/di.xml
<virtualType name="TechDivision\ProcessPipelines\Helper\Condition\Step\TimeBetweenAttempts\Minutes5"
             type="TechDivision\ProcessPipelines\Helper\Condition\Step\TimeBetweenAttempts">
    <arguments>
        <argument name="data" xsi:type="array">
            <item name="minutes" xsi:type="string">5</item>
        </argument>
    </arguments>
</virtualType>

WaitForStepIsNotRunning

The WaitForStepIsNotRunning condition can be used to define wait or execution cycles due to running steps.

WaitForStepIsNotRunning step names can be passed via the "step_names" argument list.

That has the effect that a step with a WaitForStepIsNotRunning operation can only be executed as long as no steps defined in the arguments are running in other pipelines.

PreviousStepsCompleted

With the PreviousStepsCompleted condition, a step is only executed if all previous steps with a lower sort order have a valid or successful end status.

Only the step status success and skipped are considered.

PreviousStepsFinished

With the PreviousStepsCompleted condition, a step is executed only if all previous steps with a lower sort order have a valid or successful end status.

Only the step status success and skipped are considered.