Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/Is it possible to launch a Daml Trigger with input params like time window?Forum ↗

Is it possible to launch a Daml Trigger with input params like time window?

App Development4 posts208 views3 likesLast activity Jun 2022
GY
gyorgybalazsiOP
Jun 2022

I have a Daml Trigger which only has an effect on the ledger within a time window.

Currently I’m hard-coding the time window into the ledger ruie.

It would be nice to be able to launch the trigger so that I can pass in the time window as an input param. Is that possible?

I couldn’t find an option to pass in params to triggers in a similar way as it’s possible with scripts.

CO
cocreature
Jun 2022

We considered adding something like this in the past but somewhat deliberately avoided it because I believe there is actually a better option here:

Instead of hardcoding it or having an input parameter, create a Daml template which has the configuration values your trigger depends on. Then create a contract visible to the trigger party. The trigger then reads that contract and acts based on the values. This has the advantage that you can dynamically change the config without having to restart your trigger.

GY
gyorgybalazsi
Jun 2022

Good idea, thank you!

LE
Leonid_Rozenberg
Jun 2022

It would still be nice if a trigger could then change when it will be next awoken, so that it can avoid polling.

← Back to Discussions