Repository navigation
Howto create a Trigger Activity #4891
Replies: 2 comments 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 |
|
For a custom The process that watches the file system should be a separate hosted service. When it observes a file event, have it send the same stimulus through Register the activity with the host (for example, Relevant current implementation:
This is based on the current codebase, so the exact namespaces may differ from the 3.2-era API in the original question. |
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
All reactions