How to execute a choice of a template from one dar to another dar

I have a scenario to create an atomic process, where we have 2 separate .dars at different nodes. For this I have a template Vehicle with a choice CreateVehicle which will be creating a new vehicle, and once this asset is created I wanted to trigger a choice CreateInvoice from Invoice template which is at other node, since I have separate .dar for Vehicle Manufacturer and Invoice Creator, and once the invoice is created need to update it back on the vehicle template.

  • How can I execute CreateInvoice choice of Invoice template from Vehicle template (CreateVehicle choice) Can I achieve this via daml trigger?
  • On which .dar I need to write DAML trigger Vehicle or Invoice?
  • If I try to achieve this via ledge API/ HTTP JSON API, how can we be handling a case when one steps get fails, e.g. vehicle is created and invoice is created but failed to update invoice id on the vehicle template?

Hi @NagatoPeinI1 :wave:

Can you paste the templates/choices you’re mentioning? Would help in understanding the flow better