def METHOD_NAME(self, env: Environment) -> None:
    if self._is_condition():
        output = env.stack[-1]
        env.event_history.add_event(
            hist_type_event=HistoryEventType.TaskSubmitted,
            event_detail=EventDetails(
                taskSubmittedEventDetails=TaskSubmittedEventDetails(
                    resource=self._get_sfn_resource(),
                    resourceType=self._get_sfn_resource_type(),
                    output=to_json_str(output),
                    outputDetails=HistoryEventExecutionDataDetails(truncated=False),
                )
            ),
        )
        match self.resource.condition:
            case ResourceCondition.WaitForTaskToken:
                self._wait_for_task_token(env=env)
            case ResourceCondition.Sync:
                self._sync(env=env)
            case ResourceCondition.Sync2:
                self._sync2(env=env)
            case unsupported:
                raise NotImplementedError(f"Unsupported callback type '{unsupported}'.")
    super().METHOD_NAME(env=env)