raoul2000 / yii2-workflow

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

Implement constraint for transitions #4

Closed papa-stiflera closed 9 years ago

papa-stiflera commented 9 years ago

Implement constraint for transitions as in version for Yii1.

raoul2000 commented 9 years ago

Status constraint are not available anymore as PHP code declared in the workflow definition. They should now be implemented as event handler attached to a beforeEnterStatus event. If the constraint is not satisfied, it must invalidate the event so to block the transition.

I will write a chapter on this in the Guide soon....

raoul2000 commented 9 years ago

check this chapter for details on how to implement status constraints...