source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/stepfunctions/solution_fragment.py [24:82]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def __init__(
        self,  # NOSONAR (python:S107) - allow large number of method parameters
        scope: Construct,
        id: str,
        function: CfnFunction,
        payload: Optional[TaskInput] = None,
        input_path: Optional[str] = "$",
        result_path: Optional[str] = "$",
        output_path: Optional[str] = "$",
        result_selector: Optional[Dict] = None,
        failure_state: Optional[State] = None,
        backoff_rate: Optional[int] = 1.05,
        interval: Optional[Duration] = Duration.seconds(5),
        max_attempts: Optional[int] = 5,
    ):
        super().__init__(scope, id)

        self.failure_state = failure_state

        self.task = LambdaInvoke(
            self,
            id,
            lambda_function=function,
            retry_on_service_exceptions=True,
            input_path=input_path,
            result_path=result_path,
            output_path=output_path,
            payload=payload,
            payload_response_only=True,
            result_selector=result_selector,
        )
        self.task.add_retry(
            backoff_rate=backoff_rate,
            interval=interval,
            max_attempts=max_attempts,
            errors=["ResourcePending"],
        )
        if self.failure_state:
            self.task.add_catch(
                failure_state,
                errors=["ResourceFailed", "ResourceInvalid"],
                result_path="$.statesError",
            )
            self.task.add_catch(
                failure_state, errors=["States.ALL"], result_path="$.statesError"
            )

    @property
    def start_state(self) -> State:
        return self.task

    @property
    def end_states(self) -> List[INextable]:
        """
        Get the end states of this chain
        :return: The chainable end states of this chain (i.e. not the failure state)
        """
        states = [self.task]
        return states
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



source/infrastructure/personalize/step_functions/personalization_fragment.py [24:82]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def __init__(
        self,  # NOSONAR (python:S107) - allow large number of method parameters
        scope: Construct,
        id: str,
        function: CfnFunction,
        payload: Optional[TaskInput] = None,
        input_path: Optional[str] = "$",
        result_path: Optional[str] = "$",
        output_path: Optional[str] = "$",
        result_selector: Optional[Dict] = None,
        failure_state: Optional[State] = None,
        backoff_rate: Optional[int] = 1.05,
        interval: Optional[Duration] = Duration.seconds(5),
        max_attempts: Optional[int] = 5,
    ):
        super().__init__(scope, id)

        self.failure_state = failure_state

        self.task = LambdaInvoke(
            self,
            id,
            lambda_function=function,
            retry_on_service_exceptions=True,
            input_path=input_path,
            result_path=result_path,
            output_path=output_path,
            payload=payload,
            payload_response_only=True,
            result_selector=result_selector,
        )
        self.task.add_retry(
            backoff_rate=backoff_rate,
            interval=interval,
            max_attempts=max_attempts,
            errors=["ResourcePending"],
        )
        if self.failure_state:
            self.task.add_catch(
                failure_state,
                errors=["ResourceFailed", "ResourceInvalid"],
                result_path="$.statesError",
            )
            self.task.add_catch(
                failure_state, errors=["States.ALL"], result_path="$.statesError"
            )

    @property
    def start_state(self) -> State:
        return self.task

    @property
    def end_states(self) -> List[INextable]:
        """
        Get the end states of this chain
        :return: The chainable end states of this chain (i.e. not the failure state)
        """
        states = [self.task]
        return states
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



