[HandlerTopics("sayHello", LockDuration = 10_000)]
[HandlerVariables("USERNAME")]
public class SayHelloHandler : ExternalTaskHandler
{
public override async Task<IExecutionResult> Process(ExternalTask externalTask)
{
var username = externalTask.Variables["USERNAME"].Value;
await Task.Delay(1000);
return new CompleteResult(new Dictionary<string, Variable>
{
["MESSAGE"] = Variable.String($"Hello, {username}!")
});
}
}
daxiadongxin/camunda-worker-dotnet
Ultimate solution to connect your ASP.NET Core application to Camunda external tasks
C#MIT