Annotation Interface SignalMethod
Indicates that the method is a signal handler method. A signal method gets executed when a
workflow receives a signal.
A Signal can be received and the corresponding signal method can be triggered before execution
of the first workflow task. Workflow and Signal method implementations should be compliant with
this possibility.
Importantly, this happens when a reset of history to the first workflow task (with signal
preservation) is performed. This results in signals being appended to the start of the new
history.
Techniques to consider:
- Workflow object constructors and initialization blocks should be used to initialize the internal data structures if possible.
- In rare cases signal processing may require initialization to be performed by the workflow code first. An example is initialization that depends on the workflow input parameters. You may persist data from the signals received when initialization is incomplete into a workflow field. This data can be processed in the workflow method itself after the required initialization is performed.
This annotation applies only to workflow interface methods.
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionShort description of the signal type.Name of the signal type.Sets the actions taken if a workflow exits with a running instance of this handler.
-
Element Details
-
name
String nameName of the signal type. Default is method name.Be careful about names that contain special characters. These names can be used as metric tags. And systems like prometheus ignore metrics which have tags with unsupported characters.
Name cannot start with __temporal_ as it is reserved for internal use.
- Default:
""
-
description
-
unfinishedPolicy
HandlerUnfinishedPolicy unfinishedPolicySets the actions taken if a workflow exits with a running instance of this handler.- Default:
WARN_AND_ABANDON
-