Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Workflow] Added an entered event #20787

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

Closed
wants to merge 1 commit into from
Closed

Conversation

Padam87
Copy link
Contributor

@Padam87 Padam87 commented Dec 6, 2016

Q A
Branch? 3.2
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #20774 (partially) ; #21433
License MIT
Doc PR -

@lyrixx
Copy link
Member

lyrixx commented Dec 6, 2016

Hello @Padam87

1/ there is already the enter event. What is the difference?
2/ What is the use case for this new event?

@Padam87
Copy link
Contributor Author

Padam87 commented Dec 6, 2016

Hi, I have expained in the issue. The enter event is called before the new markings are set, so you can't flush an entity in a listener because of this :)

@nicolas-grekas nicolas-grekas modified the milestone: 3.x Dec 7, 2016
@lyrixx
Copy link
Member

lyrixx commented Dec 13, 2016

Thanks @Padam87 for your time. But sadly I'm still 👎 about this event.

We already have many events. More over if you really want to to have your flush outside the controller, you can put it in the marking store. As well it makes more sense since the marking store, is all about the "store", and so the DB.

I need to close this PR as "won't fix" because of the -1 votes from the Symfony Core Team members.

The Workflow component is very 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!

@lyrixx lyrixx closed this Dec 13, 2016
@Padam87 Padam87 mentioned this pull request Feb 1, 2017
@lyrixx lyrixx reopened this Feb 9, 2017
@lyrixx
Copy link
Member

lyrixx commented Feb 9, 2017

@Padam87 Could you rebase the PR? Thanks.

}

foreach ($transition->getTos() as $place) {
$marking->mark($place);
Copy link
Member

Choose a reason for hiding this comment

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

The logic is wrong here, the marking is already set in the enter method

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, totally missed this, thx

@@ -238,6 +240,24 @@ private function enter($subject, Transition $transition, Marking $marking)
}
}

private function entered($subject, Transition $transition, Marking $marking)
{
if (null !== $this->dispatcher) {
Copy link
Member

Choose a reason for hiding this comment

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

if (null == $this->dispatcher) { return ; }

@lyrixx
Copy link
Member

lyrixx commented Feb 9, 2017

👍

Copy link
Member

@xabbuh xabbuh left a comment

Choose a reason for hiding this comment

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

👍

Status: Reviewed

@lyrixx
Copy link
Member

lyrixx commented Feb 13, 2017

Thank you @Padam87.

@lyrixx lyrixx closed this in 772d8e6 Feb 13, 2017
@fabpot
Copy link
Member

fabpot commented Feb 13, 2017

@lyrixx Can you add a note in the component CHANGELOG?

@lyrixx
Copy link
Member

lyrixx commented Feb 13, 2017

Yes, I will make a PR.

@nicolas-grekas nicolas-grekas modified the milestones: 3.3, 3.x Mar 24, 2017
@fabpot fabpot mentioned this pull request May 1, 2017
weaverryan added a commit to symfony/symfony-docs that referenced this pull request Jun 13, 2017
This PR was merged into the 3.3 branch.

Discussion
----------

Adding missing workflow.entered events

see symfony/symfony#20787

Commits
-------

1391473 Adding missing workflow.entered events
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.

6 participants