-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WatchDirectory Activity not working #1654
Comments
cool thanks - seems like the builds are failing currently https://ci.appveyor.com/project/sfmskywalker/elsa/history |
@sfmskywalker - thanks for the fix - i see it fires now after i create and publish an workflow at runtime in the designer. but it does not start a new worfkow instance - should it? or i am missing something? Watch Directory is my start activity? |
It should be able to create new workflow instances when used as a starting activity. I will check to see why that's not happening. |
thx - i only see that it does query the database on the Bookmark table - where activitytype is WatchDirectory - but i dont see any bookmark record in the database |
Right, that makes sense. For starting activities, they are stored as triggers in memory, not in the database. Only for suspended workflows will these be stored as bookmarks in the database. |
ok - so is this an bug currently? |
hmm interessting - i am on latest preview from today :( will try once again after launch |
i ust debugged the TriggerFinder - i see that the "WatchDirectory" is in the trigger stores - but it seems that the store has another Hash then the scoped hash - dont know what is going on here? |
damn - just found the bug @sfmskywalker - i used "." as pattern - which does not work then - because the FileSystemWatcher does change this to "" - and so the bookmark is not found - because bookmark is stored as ".*" - while the pattern * is used query the store:
|
github seems to have problems with the patter - i used * . * in the workflow - but filewatcher does an * |
maybe as workaround - add an if (pattern == "* . *") patter = *; in the StartWorkflow method? |
i still hava a problem with this - when i change the pattern to * - i see the workflow instance is created - but the workflow is never executed - until i restart the server. the workflow instance is in Idle state - i use hangfire dispatcher - maybe related to this? |
ok - seems like some kind of race condition - i see ObjectDisposedExceptrions happening - and so further processing stops - in the StartWorkflow method - there is an async method - shoudnt there be an await?
from what i see code runs across this and disposes the current scope ? @sfmskywalker |
This need to be changed to _workflowLaunchpad.UseServiceAsync(async s => await s.CollectAndDispatchWorkflowsAsync(launchContext, new WorkflowInput(model))); then everything works fine :) |
created an PR for this - please take a look if this is the correct approach |
Hi,
as discussed on Discord - it seems that the WatchDirectory Activity only works when defining an workflow in code.
But i cannot get it working for an workflow designed at runtime via Designer - the workflow is never executed / started?
The text was updated successfully, but these errors were encountered: