-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Feature: Allow extensions on the workflow definitions #21358
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
Comments
Hello @meDavid Before starting on the PR, could you show us how you would configure it / use it. The example don't have to be working, I just want to understand the use case, and how it could work. Thanks. |
Hello @meDavid Without feedback from you, I will have to close this issue. |
Hello @lyrixx
I might also be able to work around it implementing Place.__toString() |
@meDavid those additional properties don't make sense for the Workflow component itself. // $definition comes from the component
Assertion::true($definition instanceof FooDefinition);
// ... The interfaces of the component guarantees to return only However, it doesn't mean that you can't solve your problem. You have transition name, you have explicit mapping $myPrecious = $this->additionalPropertiesSource->getPropertiesByTransition($transition);
echo $myPrecious->getActor(); // system |
I agree with @unkind here. But anyway, In the PHP part, how would you use theses extra properties (not from the configuration POV, but from the usage POV) |
@unkind @lyrixx |
How it will affect the component behavior? |
@meDavid It looks like the end of your previous message is missing. |
@lyrixx After the registration of all the listeners (part op the configuration) we allow to visualize the defintion as with the GraphViz dumper but then one that displays the label and decorates the graphviz illustrating if it is a scheduled/automated/guarded transition. In a job cleanup listener that is fired when leaving a place, the custom definition is used to decide which scheduled transitions need cleaning. |
Thanks. I will think a bit about it to see how we could manage it. Right now, we have at least three options:
|
Hello @meDavid (Sorry for being late on this one) I'm still not convinced about this use case so I'm not sure we need it in the Component. So I'm in favor of rejecting this feature request as "won't fix". The Workflow component is quite recent, so we are very cautious about adding new features to it. In any case, if more users complain about this very same thing, we'll reconsider your proposal for Symfony 3.3. Thanks! |
I would like to extends the workflow definitions with extra properties such as schedule information. Currently the implementation of the workflow Definition is marked as final in https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Workflow/Definition.php#L22 and the workflow implementation is tightly coupled to this implementation.
My proposal is to:
or
If a pullrequest is welcome, I would be glad to provide one.
The text was updated successfully, but these errors were encountered: