raoul2000 / yii2-workflow

A simple workflow engine for Yii2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I have a few question if you would

KnightYoshi opened this issue · comments

Can the workflow manager page be integrated, relatively easily, into other pages instead of the default workflow page it comes with? Ideally it would be integrated with our admin panel.

In terms of each status. Let's say there's a draft, ready, published, deleted state (going off of the example provided). How does that affect the actual item? Using a blog as an example, obviously you would only want to display an article after it's been published. Would the workflow table have to be queried for the status or as it goes through the workflow a column on the actual table would be updated with it's status?

In terms of referencing a workflow item, if an editor leaves comments when sending an article back to the draft state, how easy is it to reference the workflow item?

Sorry if these questions are answered somewhere in the docs and I just missed it. It seems flexible enough and it's stated in the docs if needed it can be extended to add additional functionality. It seems to do the bulk of what we would like, so if we can use this as a base instead of recreating the wheel that would be preferable.

commented

Hki @Knight-Yoshi ,
let me try to reply to your questions :

Can the workflow manager page be integrated, relatively easily, into other pages instead of the default workflow page it comes with? Ideally it would be integrated with our admin panel.

The yii2-workflow extension come with no user interface, so I'm not sure to see what you mean by "workflow manager page". Maybe you'are refering to the yii2-workflow-manager and in this case plase note that I am not the author of this extension

[...] Would the workflow table have to be queried for the status or as it goes through the workflow a column on the actual table would be updated with it's status?

yii2-workflow doesn't provide any persistent storage for workflow except files. Again, I imagine that you are refering to yii2-workflow-manager that is indeed storing workflow into DB tables. Anyway, in the case you're describing, that workflow table should not be modified as it contains the definition of the workflow in terms of transitions and statuses. In the case of a blog post, there should be a dedicated status column in the post table that would, for each post, store its current status. You can then easely query the post table for all items where status = ready. Of course if you're using a workflow stored in the DB, the condition is not this one ...

In terms of referencing a workflow item, if an editor leaves comments when sending an article back to the draft state, how easy is it to reference the workflow item?

With yii2-workflow a status looks like this : "blogPost/draft". It's a string made of the workflow id (blogPost) and the status id in this workflow (draft). So, your Post table should have a column named status, of type String, having the value of the current status for a given post.
If you store your workflow in a DB just like in the yii2-workflow-manager extension then it may be different but again, as I am not the author, I can't really help you on that one.

As a conclusion, remember that yii2-workflow allows to store workflow definition in files (not in DB) which can be PHP class or arrays. As you understood, I wrote yii2-workflow so it can be extended easely and among various extension/modification that have been made, there is yii2-workflow-manager which bring the worklow into DB and a nice admin interface.

Hope it helps
😎

Thanks for answering my questions.
I'll admit that when I first read "A simple workflow engine for Yii2" I thought, "this is going to be too simple, it's just thrown together." I learned as I looked through the docs and saw the UML that it's actually really well put together. So, thanks for the great workflow extension, it's a solid base to build off of. :)