raoul2000 / yii2-workflow

A simple workflow engine for Yii2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

keep status updated problem (not an issue, just desperate for your help)

lindomarcv opened this issue · comments

Hi, before all thanks for this extension. You did great job.
I am having some problem with the status current id.
Every time i save the model and start the workflow, things goes ok, but when i try the sendToStatus to make a second transition, it doesn't recognize the last initial status and asks for it again.
What i am missing from your guide, here?
Best regards

commented

Hi @lindomarcv,
Thanks for your nice words
Just to be sure, did you notice that sendToStatus doesn't save the model, but does perform the transitions ? Did you check this example from the documentation ?

Ok if you did, then I would need a way to reproduce the behavior you are describing. Is it something like :

$m = new Post();
$m->status = "post/A";
$m->save();

$m->sendToStatus("post/B"); // ERROR here !!

assuming a transition exist between post/A and post/b of course

Is it what you are experiencing ?
ciao
😎

Hi, my problem i think was on the initStatus() i was not calling after Find Model. So every time i was trying a transition i was getting a null from the getWorkflowStatus().
Thank U very much for your reply.
Best regards

commented

Glad to hear you could solve the issue 👍