Skip to content

Stoppable process. #39

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

Merged

Conversation

kubaplas
Copy link
Contributor

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no

Added status and stoppable columns to processes table, also to all classes connected to Process model.
Status is displayed in the admin panel as an additional column. If the process is running and has stoppable flag set to true, button will show up in admin panel, which would change the status of the process to "stopping".
This way processes can detect if the user wants to stop given process and do so.

@dpfaffenbauer
Copy link
Owner

Good, the workflow is that PM only sets the status, the process it self needs to check if the status has been changed right?

@kubaplas
Copy link
Contributor Author

Exactly. I have PoC ready for Import Defitnions here: https://github.com/w-vision/DataDefinitions/pull/246nd=1

README.md Outdated
Additionally, you need to implement stop logic to your process. Track the process status and stop your process if it's set to `ProcessManagerBundle::STATUS_STOPPING`:

```php
$process = $this->processRepository->findOneBy(['id' => $processId]);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

find($processId)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

@dpfaffenbauer
Copy link
Owner

I think other than my comment, it seems fine

Changed findOneBy() into find() in stoppable process instructions.
@dpfaffenbauer dpfaffenbauer merged commit 140637b into dpfaffenbauer:master Mar 23, 2020
@dpfaffenbauer
Copy link
Owner

thanks a lot, again :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants