Skip to content
CCPEDIAby Unity Nodes
App Development

DAML Trigger access result of exercised choice

3 posts596 views5 likesLast activity Jan 2021

  1. Arne_GebertOP 1

    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.

  2. cocreature 3

    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.

  3. Arne_Gebert 1

    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).