ConditionalStep (autotransform.step.conditional)

Conditions

Conditions are used by ConditionalStep to determine whether to take an Action. Provides a generic way for creating Steps that take action conditionally.

ConditionalStep

The implementation for the ConditionalStep.

class autotransform.step.conditional.ConditionalStep(*, action: ActionType, condition: Condition, continue_if_passed: bool = False)

Bases: Step

A step which takes action based on whether a particular condition is passed. Allows for creating customized steps based on different Change attributes readily through JSON.

action

The action to perform if the condition passes.

Type

ActionType

condition

The condition to check.

Type

Condition

continue_if_passed

Whether to continue on to the next step after performing the action if the condition passes. Defaults to False.

Type

bool, optional

name

The name of the component.

Type

ClassVar[StepName]

action: ActionType
condition: Condition
continue_if_passed: bool
classmethod from_data(data: Dict[str, Any]) ConditionalStep

Produces an instance of the component from decoded data.

Parameters

data (Mapping[str, Any]) – The JSON decoded data.

Returns

An instance of the component.

Return type

ConditionalStep

get_action(change: Change) Action

Checks the Change against the provided Condition and returns the appropriate action based on whether or not the Condition is passed.

Parameters

change (Change) – The Change the Step is running against.

Returns

The Action the Step wants to take.

Return type

Action

name: ClassVar[StepName] = 'conditional'