If I set an argument default in a Flow I have it `nil` in a custom step
defmodule MmsBiztalk.Flows.Rollback do use Ash.Flow flow do api MmsBiztalk argument :resource, :string do allow_nil? false end argument :step, :integer do default 1 end argument :resource_id, :integer returns :get_last_data_in_resources end steps do custom :get_last_data_in_resources, MmsBiztalk.Flows.Steps.LastDataInResources do input %{resource: arg(:resource), resource_id: arg(:resource_id)} end transaction :back_in_time, MmsBiztalk.DataIn do map :cycle_resources_changes, result(:get_last_data_in_resources) do custom :rollback_resource, MmsBiztalk.Flows.Steps.RollbackResource do input %{ resource: arg(:resource), change: element(:cycle_resources_changes), step: arg(:step) } end end end endend
defmodule MmsBiztalk.Flows.Rollback do use Ash.Flow flow do api MmsBiztalk argument :resource, :string do allow_nil? false end argument :step, :integer do default 1 end argument :resource_id, :integer returns :get_last_data_in_resources end steps do custom :get_last_data_in_resources, MmsBiztalk.Flows.Steps.LastDataInResources do input %{resource: arg(:resource), resource_id: arg(:resource_id)} end transaction :back_in_time, MmsBiztalk.DataIn do map :cycle_resources_changes, result(:get_last_data_in_resources) do custom :rollback_resource, MmsBiztalk.Flows.Steps.RollbackResource do input %{ resource: arg(:resource), change: element(:cycle_resources_changes), step: arg(:step) } end end end endend
The Elixir backend framework for unparalleled productivity. Declarative tools that let you stop wasting time. Use with Phoenix LiveView or build APIs in minutes for your front-end of choice.