anchor.diff:  %%%===================================================================
   
   
  --spec list(od_space:id(), atm_workflow:state(), listing_opts()) ->
  +-spec list(od_space:id(), state_list_id(), listing_opts()) ->
       [{atm_workflow:id(), index()}].
  -list(SpaceId, ListDocId, ListingOpts) ->
  -    {ok, Workflows} = for_each_link(SpaceId, ListDocId, fun(Index, WorkflowId, Acc) ->
  +list(SpaceId, StateListId, ListingOpts) ->
  +    {ok, Workflows} = for_each_link(SpaceId, StateListId, fun(Index, WorkflowId, Acc) ->
           [{WorkflowId, Index} | Acc]
       end, [], sanitize_listing_opts(ListingOpts)),
   
       lists:reverse(Workflows).
   
   
  --spec add(od_space:id(), atm_workflow:state(), atm_workflow:id(), time:seconds()) ->
  +-spec add(od_space:id(), state_list_id(), atm_workflow:id(), time:seconds()) ->
       ok.
  -add(SpaceId, WorkflowState, WorkflowId, Timestamp) ->
  +add(SpaceId, StateListId, WorkflowId, Timestamp) ->
       Index = index(WorkflowId, Timestamp),
   
  -    case datastore_model:add_links(?CTX, ?FOREST(SpaceId), WorkflowState, {Index, WorkflowId}) of
  +    case datastore_model:add_links(?CTX, ?FOREST(SpaceId), StateListId, {Index, WorkflowId}) of
           {ok, _} ->
               ok;
           {error, already_exists} ->
  
positive.code: %% @private
  -spec for_each_link(
      od_space:id(),
      atm_workflow:state(),
      fun((index(), atm_workflow:id(), Acc0 :: term()) -> Acc :: term()),
      term(),
      datastore_model:fold_opts()
  ) ->
      {ok, Acc :: term()} | {error, term()}.
  for_each_link(SpaceId, WorkflowState, Callback, Acc0, Options) ->
      datastore_model:fold_links(?CTX, ?FOREST(SpaceId), WorkflowState, fun
          (#link{name = Index, target = WorkflowId}, Acc) -> {ok, Callback(Index, WorkflowId, Acc)}
      end, Acc0, Options).
  
negative.code:     limit => limit()
  }.
  
  -export_type([state_list_id/0, index/0, offset/0, limit/0, listing_opts/0]).
  
  
  -define(CTX, (atm_workflow:get_ctx())).
  