anchor.diff:      end.
   
   
  --spec delete(od_space:id(), atm_workflow:state(), atm_workflow:id(), time:seconds()) ->
  +-spec delete(od_space:id(), state_list_id(), atm_workflow:id(), time:seconds()) ->
       ok.
  -delete(SpaceId, WorkflowState, WorkflowId, Timestamp) ->
  +delete(SpaceId, StateListId, WorkflowId, Timestamp) ->
       LinkName = index(WorkflowId, Timestamp),
   
  -    ok = datastore_model:delete_links(?CTX, ?FOREST(SpaceId), WorkflowState, LinkName).
  +    ok = datastore_model:delete_links(?CTX, ?FOREST(SpaceId), StateListId, LinkName).
   
   
   %%%===================================================================
  
positive.code: -export([list/3, add/4, delete/4]).
  
  
  -type index() :: binary().
  -type offset() :: integer().
  -type limit() :: pos_integer().
  
negative.code: %% @private
  -spec for_each_link(
      od_space:id(),
      state_list_id(),
      fun((index(), atm_workflow:id(), Acc0 :: term()) -> Acc :: term()),
      term(),
      datastore_model:fold_opts()
  ) ->
      {ok, Acc :: term()} | {error, term()}.
  for_each_link(SpaceId, StateListId, Callback, Acc0, Options) ->
      datastore_model:fold_links(?CTX, ?FOREST(SpaceId), StateListId, fun
          (#link{name = Index, target = WorkflowId}, Acc) -> {ok, Callback(Index, WorkflowId, Acc)}
      end, Acc0, Options).
  