anchor.diff:      end.
   
   
  --spec handle_lane_task_status_change(
  -    atm_workflow_execution:id(),
  -    fun((atm_workflow_execution:record()) -> atm_workflow_execution:record() | errors:error())
  -) ->
  +-spec handle_lane_task_status_change(atm_workflow_execution:id(), lane_run_diff()) ->
       ok | errors:error().
   handle_lane_task_status_change(AtmWorkflowExecutionId, AtmLaneExecutionDiff) ->
       Diff = fun(Record) ->
  
positive.code:     status_to_phase(Status).
  
  
  -spec handle_lane_preparing(
      pos_integer(),
      atm_workflow_execution:id(),
      fun((atm_workflow_execution:record()) -> atm_workflow_execution:record() | errors:error())
  ) ->
      {ok, atm_workflow_execution:doc()} | errors:error().
  handle_lane_preparing(AtmLaneIndex, AtmWorkflowExecutionId, AtmLaneExecutionDiff) ->
      Diff = fun
          (Record = #atm_workflow_execution{status = ?SCHEDULED_STATUS, curr_lane_index = CurrIndex})
              when CurrIndex =:= AtmLaneIndex
          ->
              case AtmLaneExecutionDiff(Record) of
                  {ok, NewRecord} ->
  
negative.code: -export([handle_ended/1]).
  
  
  % Function taking as argument entire atm_workflow_execution record, modifying lane run
  % and returning updated atm_workflow_execution record (or record)
  -type lane_run_diff() :: fun((atm_workflow_execution:record()) ->
      atm_workflow_execution:record() | errors:error()
  ).
  
  
  %%%===================================================================
  %%% API
  %%%===================================================================
  