| | | 1 | | using Elsa.Expressions.Models; |
| | | 2 | | using Elsa.Extensions; |
| | | 3 | | using Elsa.Workflows.Models; |
| | | 4 | | |
| | | 5 | | namespace Elsa.Workflows; |
| | | 6 | | |
| | 305 | 7 | | public class TriggerIndexingContext(WorkflowIndexingContext workflowIndexingContext, ExpressionExecutionContext expressi |
| | | 8 | | { |
| | 305 | 9 | | public WorkflowIndexingContext WorkflowIndexingContext { get; } = workflowIndexingContext; |
| | 610 | 10 | | public ExpressionExecutionContext ExpressionExecutionContext { get; } = expressionExecutionContext; |
| | 305 | 11 | | public ITrigger Trigger { get; } = trigger; |
| | 305 | 12 | | public CancellationToken CancellationToken { get; } = cancellationToken; |
| | | 13 | | |
| | | 14 | | /// <summary> |
| | | 15 | | /// The default stimulus name applied to the payloads returned by the trigger being indexed. Defaults to the activit |
| | | 16 | | /// </summary> |
| | | 17 | | /// <remarks> |
| | | 18 | | /// This is a single value shared by every payload of the trigger: when it is assigned more than once, the last writ |
| | | 19 | | /// A trigger that needs to register payloads under more than one stimulus name should return <see cref="NamedTrigge |
| | | 20 | | /// which carry a name per payload and take precedence over this property. |
| | | 21 | | /// </remarks> |
| | 914 | 22 | | public string TriggerName { get; set; } = trigger.Type; |
| | | 23 | | |
| | | 24 | | /// <summary> |
| | | 25 | | /// Set by the trigger being indexed to declare that, as configured, it deliberately registers no triggers at all. |
| | | 26 | | /// </summary> |
| | | 27 | | /// <remarks> |
| | | 28 | | /// <para> |
| | | 29 | | /// A trigger that returns no payloads is otherwise stored as a single placeholder row with a <c>null</c> payload, w |
| | | 30 | | /// reports as a trigger without a payload. For almost every trigger that is the right outcome: no payloads means it |
| | | 31 | | /// A trigger whose decision to register anything depends on its own content, and that has nothing to register as co |
| | | 32 | | /// and the indexer then stores no row for it. |
| | | 33 | | /// </para> |
| | | 34 | | /// <para> |
| | | 35 | | /// It only takes effect when the trigger returns no payloads and completes without throwing. Payloads the trigger d |
| | | 36 | | /// and a trigger that throws still gets the placeholder row, so a failure is never mistaken for a deliberate decisi |
| | | 37 | | /// </para> |
| | | 38 | | /// </remarks> |
| | 0 | 39 | | public bool RegistersNoTriggers { get; set; } |
| | | 40 | | |
| | 0 | 41 | | public T? Get<T>(Input<T>? input) => ExpressionExecutionContext.Get(input); |
| | | 42 | | } |