Merge remote-tracking branch 'origin/v3' into v3
This commit is contained in:
commit
f11fb2fa47
|
|
@ -0,0 +1,15 @@
|
|||
import {FunctionalComponent, h} from '@stencil/core';
|
||||
import {ActivityIconSettings, getActivityIconCssClass} from "./models";
|
||||
|
||||
export const CorrelateIcon: FunctionalComponent<ActivityIconSettings> = (settings) => (
|
||||
<svg class={getActivityIconCssClass(settings)} width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"
|
||||
fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z"/>
|
||||
<circle cx="6" cy="6" r="2"/>
|
||||
<circle cx="18" cy="18" r="2"/>
|
||||
<path d="M11 6h5a2 2 0 0 1 2 2v8"/>
|
||||
<polyline points="14 9 11 6 14 3"/>
|
||||
<path d="M13 18h-5a2 2 0 0 1 -2 -2v-8"/>
|
||||
<polyline points="10 15 13 18 10 21"/>
|
||||
</svg>
|
||||
);
|
||||
|
|
@ -15,3 +15,4 @@ export * from "./read-line";
|
|||
export * from "./run-javascript";
|
||||
export * from "./timer";
|
||||
export * from "./write-line";
|
||||
export * from "./correlate";
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@ import {
|
|||
IfIcon,
|
||||
ReadLineIcon, WriteLineIcon,
|
||||
RunJavaScriptIcon,
|
||||
HttpEndpointIcon, HttpResponseIcon, HttpRequestIcon
|
||||
HttpEndpointIcon, HttpResponseIcon, HttpRequestIcon,
|
||||
CorrelateIcon
|
||||
} from "../components/icons/activities";
|
||||
|
||||
export type ActivityType = string;
|
||||
|
|
@ -39,6 +40,7 @@ export class ActivityIconRegistry {
|
|||
this.add('Elsa.FlowJoin', settings => <FlowJoinIcon size={settings?.size}/>);
|
||||
this.add('Elsa.FlowNode', settings => <FlowNodeIcon size={settings?.size}/>);
|
||||
this.add('Elsa.SendHttpRequest', settings => <HttpRequestIcon size={settings?.size}/>);
|
||||
this.add("Elsa.Correlate", settings => <CorrelateIcon size={settings?.size}/>)
|
||||
}
|
||||
|
||||
public add(activityType: ActivityType, icon: ActivityIconProducer) {
|
||||
|
|
|
|||
27
src/modules/Elsa.Workflows.Core/Activities/Correlate.cs
Normal file
27
src/modules/Elsa.Workflows.Core/Activities/Correlate.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
using System.ComponentModel;
|
||||
using System.Text.Json.Serialization;
|
||||
using Elsa.Workflows.Core.Attributes;
|
||||
using Elsa.Workflows.Core.Models;
|
||||
|
||||
namespace Elsa.Workflows.Core.Activities;
|
||||
|
||||
[Activity("Elsa", "Primitives", "Set the CorrelationId of the workflow to a given value.")]
|
||||
public class Correlate : Activity
|
||||
{
|
||||
[JsonConstructor]
|
||||
public Correlate()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The correlation ID to set.
|
||||
/// </summary>
|
||||
[Description("An expression that evaluates to the value to store as the correlation id")]
|
||||
public Input<string> CorrelationId { get; set; } = default!;
|
||||
|
||||
protected override async ValueTask ExecuteAsync(ActivityExecutionContext context)
|
||||
{
|
||||
var correlationId = context.Get(CorrelationId);
|
||||
context.WorkflowExecutionContext.CorrelationId = correlationId;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue