raoul2000 / yii2-workflow

A simple workflow engine for Yii2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

workflow manager (for WorkflowDbSource)

cornernote opened this issue · comments

Thought you may want to have a play with this:
https://github.com/cornernote/yii2-workflow-manager

It's based on your WorkflowDbSource gist:
https://gist.github.com/raoul2000/c38165b7e6b5f12a6945#file-workflowdbsource-php

I turned it into a module. Would be great to see your feedback.

Looks like this:

image

commented

😲
wow !! This seems very impressive work and be sure I will try it.

Having a quick look at the code, it brings me back to your performance question some days ago. Maybe one improvement would be to not use Yii2 ActiveRecord in the workflowDbSource component or at least return arrays instead AR instances. According to the definitive Guide to Yii2 this could be an interesting optimization when dealing with a large amount of records...

I implemented cache (copied from WorkflowFileSource), so the number of ActiveRecord/DB hits should be minimal for loading workflow data. I am more concerned with instantiating all the workflow/status classes each time a model is loaded.

So far it's not been much overhead, however I need to try with larger jobs to get a better benchmark.

I submitted a PR to link to this from your readme, I hope that's ok.