Ash FrameworkAF
Ash Framework3y ago
4 replies
tommasop#2001

Ash Flow branch condition

I'm trying to do something like this:
check if record exists
branch on record not existing
create record with linked belongs_to record

the branch conditions is the following:

    read :get_invoice_data, MmsBiztalk.InvoiceData, :current do
      get? true
      not_found_error? false

      input(%{
        help_desk_id: path(arg(:attributes), [:help_desk_id])
      })
    end

    branch :invoice_data_found, expr(^result(:get_invoice_data)) do
    end


The strange thing is that the branch executes even if the record is found. I understand that condition must be a boolean value.
Is there a way to achieve it with a read action or I need to use a custom :get_invoice_data step?
Was this page helpful?