raoul2000 / yii2-workflow

A simple workflow engine for Yii2
BSD 3-Clause "New" or "Revised" License
171 stars 48 forks source link

missing EVENT_*_CHANGE_STATUS when autoInsert is true on ActiveRecord insert #37

Closed makroxyz closed 8 years ago

makroxyz commented 8 years ago

using autoInsert => true in SimpleWorkflowBehavior when ActiveRecord is inserted events EVENT_*_CHANGE_STATUS are not fired. As described in Generic Events section of the manual I'm expecting the following events: getStartStatus() == null && getEndStatus() != null : the model is entering into the workflow getStartStatus() =! null && getEndStatus() != null : the model is changing status getStartStatus() == null && getEndStatus() == null : the model is leaving into the workflow

It only works when autoInsert is false and I manually sendToStatus() my AR to Initial status ID in beforeSave() function.

raoul2000 commented 8 years ago

hi @makroxyz, this is normal as the autoInsert feature is not released (not documented neither) and partially implemented.... I'm still not sure it is useful and should be implemented.