raoul2000 / yii2-workflow

A simple workflow engine for Yii2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

missing EVENT_*_CHANGE_STATUS when autoInsert is true on ActiveRecord insert

makroxyz opened this issue · comments

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.

commented

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.