Closed tacman closed 6 years ago
Or is that the purpose of the initial_place?
Yes, it's exactly the purpose of this config.
In my applications, some sets the column to the initial value like this:
// Init the workflow
$this->stateMachine->getMarking($order);
and some lets a [null]
in the column.
This is not a big deal ;)
I'm working on a bundle that would allow all the slick goodness from this repository to be easily integrated into an application. I've been changing all my applications, any table that had a "status" column to now use the Workflow component, and wanted a way to quickly use the tools here, and would like to make it a public bundle with the hopes that others will find some of the tools I use in my projects worthwhile.
It seems to me that the "marking" column shouldn't ever be null, because if it is, how can the Workflow component determine what transitions are valid? Or is that the purpose of the initial_place? That is, if the marking is null treat it as if it were set to the initial place?
In my bundle, I've created a trait that any entity can use to quickly integrate a State Machine. Should it be nullable?
https://github.com/survos/workflow-bundle/blob/master/src/Traits/MarkingTrait.php#L10-L14
The bundle is still pretty somewhat rough, hopefully in the next few days I'll have some documentation and demo and get some feedback.
Thanks!