[HandlerTopics("sayHello", LockDuration = 10_000)]
[HandlerVariables("USERNAME")]
public class SayHelloHandler : IExternalTaskHandler
{
public async Task<IExecutionResult> HandleAsync(ExternalTask externalTask, CancellationToken cancellationToken)
{
if (!externalTask.TryGetVariable<StringVariable>("USERNAME", out var usernameVariable))
{
return new BpmnErrorResult("NO_USER", "Username not provided");
}
var username = usernameVariable.Value;
await Task.Delay(1000, cancellationToken);
return new CompleteResult
{
Variables = new Dictionary<string, VariableBase>
{
["MESSAGE"] = new StringVariable($"Hello, {username}!"),
["USER_INFO"] = JsonVariable.Create(new UserInfo(username, new List<string>
{
"Admin"
}))
}
};
}
}
-
Notifications
You must be signed in to change notification settings - Fork 30
Ultimate solution to connect your ASP.NET Core application to Camunda external tasks
License
TechnoBerry/camunda-worker-dotnet
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Ultimate solution to connect your ASP.NET Core application to Camunda external tasks
Topics
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published