lexik / LexikWorkflowBundle

Simple workflow bundle for Symfony2
MIT License
126 stars 29 forks source link

Progress History Log in this workflow bundle #27

Closed ghost closed 8 years ago

ghost commented 8 years ago

Is it possible that this bundle can keep track of the progress of a work flow?

What I mean; is it possible to save each action in a database table? Like John Doe created the first draft on yyyy/mm/dd. When someone approve it, another row gets added; Admin Jack approved draft on yyyy/mm/dd...

I am going to implement this work flow bundle, and I need to log all user actions as well, so I wonder if it can be accomplished with this or should I look for another bundle or develop that myself?

Thank you

alafon commented 8 years ago

This is already the case. There is an entity here : https://github.com/lexik/LexikWorkflowBundle/blob/master/Entity/ModelState.php

It save each state with custom information in the data property. These data are retrieved from the getWorkflowData() method of model object. You need to implement this model as described here : https://github.com/lexik/LexikWorkflowBundle#model-object

Last but not least, if you need more (custom actions depending on the step you reached for instance), you can implement Event Subscribers as described here (for the xxxx.xxxx.reached event) : https://github.com/lexik/LexikWorkflowBundle#step-actions

ghost commented 8 years ago

Thank you very much alafon! I see now.

alafon commented 8 years ago

You're welcome @Mentos93