Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Workflow] Added a context toWorkflow::apply()#29146
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
lyrixx commentedNov 8, 2018
I thought it will be easy, but the Property Access does not support passing 2 arguments to a setter (super logic after all). I don't know how to achieve this. Some randome ideas
Have you other ideas ? What do you prefer ? Actually I prefer the 2/ |
stof commentedNov 8, 2018
@lyrixx I think you are forgetting the fact that PropertyAccess takes a property path as input, not just a property name. Using PropertyAccess to read but a simpler implementation supporting only property names to write will not work. |
lyrixx commentedNov 8, 2018
Ah you are right. So we should go to 3/ What do you think ? |
lyrixx commentedNov 8, 2018
Just one question, as we do not mention we are using the Property Path component, is it a BC break a change the implementation ? |
nicolas-grekas commentedNov 8, 2018
Not if nothing changes on the outside surface.What would be the user visible side effect? |
lyrixx commentedNov 8, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@nicolas-grekas It could change someting to the end user if they use this kind of configuration: framework:workflows:my_workflow:marking_store:type:multiple_statearguments: -'property1.property2'
So, if no one is using this feature (we can not be sure, I know, but really I doubt someone is using it), there are no difference for the end user |
lyrixx commentedNov 8, 2018
I case of you think it's a BC break, what do you think if the last commit? |
noniagriconomie commentedNov 9, 2018
@lyrixx thank you on coding this 👍 just a question: what is the aim behind also, how can we deal with sort of "validation" of the context? |
lyrixx commentedNov 12, 2018
The aim of
We will not validate the context. It's not the role of the workflow component to do that. |
noniagriconomie commentedNov 12, 2018
fair enough :) 👍 |
lyrixx commentedNov 13, 2018
Here we go. I think this PR is ready. Here is the diff the developer will have to do to use this new feature: |
15d04c1 toade6666Compare
noniagriconomie left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
thank you for the feature
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Workflow/MarkingStore/MethodMarkingStore.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
noniagriconomie left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
hope this feature will be merged and documented soon :)
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Workflow/MarkingStore/MethodMarkingStore.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
8f727cc to58a3f8eCompare
nicolas-grekas left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM thanks. Here are some comments (+rebase needed)
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
lyrixx commentedDec 4, 2018
Note: I lost the integration with the framework bundle. I will fix it asap |
cdd911d tob2cbe22Comparelyrixx commentedDec 4, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Hi! I finished this PR But (in another PR) I would like to:
What do you think ? |
lyrixx commentedMar 6, 2019
@noniagriconomie here we go. I rebased the PR and merged it. You can now test it and give me feedback. Thanks |
…ixx)This PR was merged into the 4.3-dev branch.Discussion----------[Workflow] Added a context to `Workflow::apply()`| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#27925 (maybe#28253 and#28266)| License | MIT| Doc PR |Commits-------7d5b7a3 [Workflow] Added a context to `Workflow::apply()`
lyrixx commentedMar 6, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
an usage example base onhttps://github.com/lyrixx/SFLive-Paris2016-Workflow /** * @Route("/apply-transition/{id}", methods={"POST"}, name="article_apply_transition") */publicfunctionapplyTransitionAction(Request$request,Article$article) {try {$this->get('workflow.article') ->apply($article,$request->request->get('transition'), ['time' =>time()]);$this->get('doctrine')->getManager()->flush(); }catch (ExceptionInterface$e) {$this->get('session')->getFlashBag()->add('danger',$e->getMessage()); }return$this->redirect($this->generateUrl('article_show', ['id' =>$article->getId()]) ); } and the publicfunctionsetMarking($marking,array$context = []) {$this->marking =$marking;dump($context); } |
lyrixx commentedMar 6, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Here we go:How to use it and thedemo |
noniagriconomie commentedMar 6, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@lyrixx many thanks :) Will of course test it and use it asap Edit : Also, can you have a second look at Thank you |
nicolas-grekas commentedMar 11, 2019
Caught :) |
Uh oh!
There was an error while loading.Please reload this page.
…rameworkExtension (lyrixx)This PR was merged into the 4.3-dev branch.Discussion----------[Workflow] Move code from ValidateWorkflowsPass to the FrameworkExtension| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets || License | MIT| Doc PR |---Just some cleaning. Seesymfony/symfony#29146 (comment)Commits-------a608797165 [Workflow] Move code from ValidateWorkflowsPass to the FrameworkExtension
…rameworkExtension (lyrixx)This PR was merged into the 4.3-dev branch.Discussion----------[Workflow] Move code from ValidateWorkflowsPass to the FrameworkExtension| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets || License | MIT| Doc PR |---Just some cleaning. Seesymfony/symfony#29146 (comment)Commits-------a608797165 [Workflow] Move code from ValidateWorkflowsPass to the FrameworkExtension
…rameworkExtension (lyrixx)This PR was merged into the 4.3-dev branch.Discussion----------[Workflow] Move code from ValidateWorkflowsPass to the FrameworkExtension| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets || License | MIT| Doc PR |---Just some cleaning. See#29146 (comment)Commits-------a608797 [Workflow] Move code from ValidateWorkflowsPass to the FrameworkExtension
vudaltsov commentedMar 22, 2019
@lyrixx , why not making |
lyrixx commentedMar 22, 2019
@vudaltsov Good idea 👍 I will do that :) |
vudaltsov commentedMar 22, 2019
@lyrixx , I can do a PR for you, if you wish, have some time now! |
lyrixx commentedMar 22, 2019
oh yes. Please do :) |
This PR was merged into the 4.3-dev branch.Discussion----------Make MethodMarkingStore final| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | n/a| License | MIT| Doc PR | n/aMade `MethodMarkingStore` final as proposed insymfony/symfony#29146 (comment).Commits-------bbf582bce5 Make MethodMarkingStore final
This PR was merged into the 4.3-dev branch.Discussion----------Make MethodMarkingStore final| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | n/a| License | MIT| Doc PR | n/aMade `MethodMarkingStore` final as proposed in#29146 (comment).Commits-------bbf582b Make MethodMarkingStore final
lyrixx commentedApr 7, 2019
@noniagriconomie The demo has been fixed. Thanks for hint. |
Uh oh!
There was an error while loading.Please reload this page.