Hi,
I am curious to know if DAML has provision to define, emit and listen to custom events?
In other words is it possible to emit custom events inside a choice?
Thanks
Hi,
I am curious to know if DAML has provision to define, emit and listen to custom events?
In other words is it possible to emit custom events inside a choice?
Thanks
There is no special inbuilt for custom events as every choice exercise is an event. So if you want to emit an event, you can just create a choice without an effect:
controller (signatory this) can
nonconsuming MyEvent : ()
with
message : Text
do
return ()
If you exercise that, all you’ll get is an extra node on the transaction tree that you can react to.
Thanks @bernhard for the quick response. I will try this approach.