Skip to content
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

Introduce Symfony\Component\Workflow\TransitionInterface ? #19621

Closed
RoSk0 opened this issue Aug 16, 2016 · 5 comments

Comments

Projects
None yet
4 participants
@RoSk0
Copy link

commented Aug 16, 2016

I have integrated Workflow component into Drupal 7 website and because of custom config storage it will be really useful for me to have an ability to use my own class as Transition class to have some custom properties and methods.
I think that it wouldn't be too complicated to introduce Symfony\Component\Workflow\TransitionInterface but I see one thing that I have no idea how to handle. In Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php:393 registerWorkflowConfiguration() method is directly referencing Workflow\Transition::class to add transition to workflow definition. Should it be made configurable somehow? Does it make sense to introduce this interface at all ?

@ro0NL

This comment has been minimized.

Copy link
Contributor

commented Aug 16, 2016

Cant you couple custom logic by transition name, and hook in using events? Ie. why do you need a custom class? From the workflow pov it's just a simple VO.

@lyrixx

This comment has been minimized.

Copy link
Member

commented Aug 16, 2016

Hello @RoSk0

I usually don't like to add interface on simple POPO / value object.

Then If you store your "workflow schema" outside the config.yml (or something similar in drupal), you have to create everything by hand. It's really easy. So IMHO, there is no need for the TransitionInterface

@RoSk0

This comment has been minimized.

Copy link
Author

commented Sep 5, 2016

Thanks for replies @lyrixx and @ro0NL .
What about such essential properties like 'label' that should be shown to the user? Where how those should be stored? Having label as part of immutable value object looks perfectly legit to me.

@lyrixx

This comment has been minimized.

Copy link
Member

commented Sep 19, 2016

@RoSk0 you can simply extend the Transition class ?! or Store more information anywhere in a map.

@lyrixx

This comment has been minimized.

Copy link
Member

commented Oct 7, 2016

I'm closing this issue as there is not activity anymore. More over I gave some solutions.
Feel free to reopen the issue if it was not clear enough.

@lyrixx lyrixx closed this Oct 7, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.