Ash.Actions.BulkManualActionHelpers (ash v3.19.3)

Copy Markdown View Source

Helper functions used for handling manual actions when used in bulk operations.

Summary

Functions

build_bulk_result(processed_results, any_success?, notifications, opts)

@spec build_bulk_result(
  processed_results :: [Ash.Resource.record() | {:error, term()}],
  any_success? :: boolean(),
  notifications :: [Ash.Notifier.Notification.t()],
  opts :: Keyword.t()
) :: Ash.BulkResult.t()

Builds a BulkResult from processed results.

Takes a list of records and {:error, error} tuples (output from process_results), along with success tracking and notifications, and builds the final BulkResult.

process_bulk_results(results, manual_action_module, bulk_action_type, store_notification, ref, opts, batch, changesets_by_ref, changesets_by_index)

Processes the results of a manual action's bulk function.

Returns tagged tuples {:ok, result, changeset} or {:error, error, changeset} that can be processed by process_results to run after_transaction hooks.

process_non_bulk_result(result, changeset, bulk_action_type, store_notification \\ nil, ref \\ nil, opts \\ [])

Used when a manual action does not export a bulk version of the action.

Returns a tagged tuple {:ok, result, changeset} or {:error, error, changeset} that can be processed by process_results to run after_transaction hooks.