You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Workflow code must be deterministic. See the "Workflow Logic Constraints" section below.
443
443
*`Workflow.ExecuteActivityAsync` is strongly typed and accepts a lambda expression. This activity call can be a sync or
444
-
async function, return a value or not, and invoked statically or on an instance (which would require accepting the
444
+
async function, return a value or not, and be invoked statically or on an instance (which would require accepting the
445
445
instance as the only lambda parameter).
446
446
447
447
Attributes that can be applied:
448
448
449
449
*`[Workflow]` attribute must be present on the workflow type.
450
450
* The attribute can have a string argument for the workflow type name. Otherwise the name is defaulted to the
451
451
unqualified type name (with the `I` prefix removed if on an interface and has a capital letter following).
452
-
*`Dynamic = true` can be set for the workflow which makes the workflow a dynamic workflow meaning it will be called
452
+
*`Dynamic = true` can be set for the workflow, which makes the workflow a dynamic workflow -- meaning it will be called
453
453
when no other workflows match. The run call must accept a single parameter of `Temporalio.Converters.IRawValue[]`
454
454
for the arguments. Only one dynamic workflow may be registered on a worker.
455
455
*`[WorkflowRun]` attribute must be present on one and only one public method.
456
456
* The workflow run method must return a `Task` or `Task<>`.
457
-
* The workflow run method _should_ accept a single parameter and return a single type. Records are encouraged because
457
+
* The workflow run method _should_ accept a single parameter and return a single type, for example, a Record. Single types/Records are encouraged because
458
458
optional fields can be added without affecting backwards compatibility of the workflow definition.
459
459
* The parameters of this method and its return type are considered the parameters and return type of the workflow
460
460
itself.
@@ -463,6 +463,8 @@ Attributes that can be applied:
463
463
just invokes the base class method.
464
464
*`[WorkflowSignal]` attribute may be present on any public method that handles signals.
465
465
* Signal methods must return a `Task`.
466
+
* Similar to `[WorkflowRun]`, The signal method _should_ accept a single parameter of a single type, for example, a Record. Single types/Records are encouraged because
467
+
optional fields can be added without affecting backwards compatibility of the workflow definition.
466
468
* The attribute can have a string argument for the signal name. Otherwise the name is defaulted to the unqualified
467
469
method name with `Async` trimmed off the end if it is present.
468
470
* This attribute is not inherited and therefore must be explicitly set on any override.
@@ -495,7 +497,7 @@ Workflows can inherit from interfaces and base classes. Callers can use these in
495
497
without the implementation present. This can be valuable in separating logic, but there are some details that should be
496
498
noted.
497
499
498
-
`[Workflow]` and `[WorkflowRun]` attributes are never inherited and must be defined on item that is actually registered
500
+
`[Workflow]` and `[WorkflowRun]` attributes are never inherited and must be defined on items that are actually registered
499
501
with the worker. This means even if an interface or base class has these, they must also be present on the final
500
502
implementing class. So if a base class has a full `[WorkflowRun]` implementation, the subclass must override that
501
503
method, set `[WorkflowRun]` on the override, and then it can delegate to the base class. This explicit non-inheritance
@@ -727,7 +729,7 @@ with .NET tasks inside of workflows:
727
729
728
730
In order to help catch wrong scheduler use, by default the Temporal .NET SDK adds an event source listener for
729
731
info-level task events. While this technically receives events from all uses of tasks in the process, we make sure to
730
-
ignore anything that is not running in a workflow in a high performant way (basically one thread local check). For code
732
+
ignore anything that is not running in a workflow in a highly performant way (basically one thread local check). For code
731
733
that does run in a workflow and accidentally starts a task in another scheduler, an `InvalidWorkflowOperationException`
732
734
will be thrown which "pauses" the workflow (fails the workflow task which continually retries until the code is fixed.).
733
735
This is unfortunately a runtime-only check, but can help catch mistakes early. If this needs to be turned off for any
@@ -740,7 +742,7 @@ timers.
740
742
##### Workflow .editorconfig
741
743
742
744
Since workflow code follows some different logic rules than regular C# code, there are some common analyzer rules out
743
-
there that developers may want to disable. To ensure these are only disabled for workflows, current recommendation is to
745
+
there that developers may want to disable. To ensure these are only disabled for workflows, the current recommendation is to
744
746
use the `.workflow.cs` extension for files containing workflows.
745
747
746
748
Here are the rules to disable:
@@ -819,7 +821,7 @@ but only for one test at a time because time skipping is locked/unlocked at the
819
821
820
822
##### Automatic Time Skipping
821
823
822
-
Anytimeaworkflowresultiswaitingon, thetime-skippingserverautomaticallyadvancestothenexteventitcan. To
824
+
Anytimeaworkflowresultiswaitedon, thetime-skippingserverautomaticallyadvancestothenexteventitcan. To
823
825
manuallyadvancetimebeforewaitingontheresultoftheworkflow, the `WorkflowEnvironment.DelayAsync` methodcanbe
0 commit comments