Package io.temporal.workflow
Annotation Type SignalMethod
-
@Retention(RUNTIME) @Target(METHOD) public @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 Elements Modifier and Type Optional Element Description java.lang.String
name
Name of the signal type.HandlerUnfinishedPolicy
unfinishedPolicy
Sets the actions taken if a workflow exits with a running instance of this handler.
-
-
-
-
unfinishedPolicy
HandlerUnfinishedPolicy unfinishedPolicy
Sets the actions taken if a workflow exits with a running instance of this handler.- Default:
- io.temporal.workflow.HandlerUnfinishedPolicy.WARN_AND_ABANDON
-
-