anchor.diff:      atm_workflow_execution:doc() | no_return().
   handle_ended(AtmLaneIndex, AtmWorkflowExecutionId) ->
       Diff = fun(AtmWorkflowExecution = #atm_workflow_execution{curr_lane_index = CurrLaneIndex}) ->
  -        case CurrLaneIndex == AtmLaneIndex of
  +        case AtmLaneIndex > CurrLaneIndex of
               true ->
  -                end_currently_executed_lane_run(AtmWorkflowExecution);
  +                handle_prepared_in_advance_lane_run_ended(AtmLaneIndex, AtmWorkflowExecution);
               false ->
  -                update_runs_at_lane(
  -                    AtmLaneIndex,
  -                    fun mark_lane_run_prepared_in_advance_as_interrupted/1,
  -                    AtmWorkflowExecution
  -                )
  +                handle_currently_executed_lane_run_ended(AtmWorkflowExecution)
           end
       end,
  -
  -    ?extract_atm_workflow_execution_doc(atm_workflow_execution:update(AtmWorkflowExecutionId, Diff)).
  +    ?extract_doc(atm_workflow_execution:update(AtmWorkflowExecutionId, Diff)).
   
   
   %%%===================================================================
  
positive.code: ]).
  
  
  -define(extract_atm_workflow_execution_doc(__CALL),
      case __CALL of
          {ok, __DOC} -> __DOC;
          {error, _} = _ERROR -> throw(_ERROR)
  
negative.code: %%%-------------------------------------------------------------------
  %%% @doc
  %%% This module contains functions that handle atm lane execution run status
  %%% transitions according (with some exceptions described below) to following
  %%% state machine:
  %%%
  %%%               +-------------+   cancel or failure
  %%%               |  SCHEDULED  |------------------------
  