Howto create a Trigger Activity #4891
Replies: 1 comment 3 replies
-
|
To create a custom trigger activity like
Here's a simplified example of what the public class FileWatcher : Activity, ITrigger
{
// Define properties for directory path, filter, etc.
protected override void Execute(ActivityExecutionContext context)
{
// Create a bookmark to suspend the workflow
context.CreateBookmark();
// Set up file watching logic and handle events
// ...
}
public ValueTask<IEnumerable<object>> GetTriggerPayloadsAsync(TriggerIndexingContext context)
{
// Return payloads if necessary for the trigger
return new ValueTask<IEnumerable<object>>(Enumerable.Empty<object>());
}
}And to register the activity: services.AddE |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
What is needed to create a trigger activity like the HttpEndpoint or Schedule Activity. As i understand you have to derive it from the ITrigger interface. But other than that... So what are the specifics? Like i want to start a workflow with to be developed FileWatcher activity? How do i build this activity and add it to the system..
Thanks
Beta Was this translation helpful? Give feedback.
All reactions