DAML Trigger access result of exercised choice
Using DAML Triggers, I want to exercise a choice and then access the return of the exercised choice. (I then want to make the further trigger execution dependent on the returned result.)
So something like:
result <- dedupExercise cid choice
Is this possible? Looking at the documentation, I don’t see a way to do this at the moment.
Triggers submit commands asynchronously so you cannot get access to the result of a choice exercise.
I recommend thinking of triggers as state-based automation: If your trigger should depend on something, that information should be reflected in the ACS and not only as part of the exercise result.
Thanks! Makes sense, just wanted to make sure.
For my use case, I have now adapted my DAML model such that the result is created as a template (thus appears in the ACS) and added a second trigger that checks for the existence of the result (and then executes more logic based on the result template).