7

Is there any workflow imlementation in RoR?

Several years i developed and supported a IBM Lotus Notes enterprise apps with IBM WorkFlow. This software provides possibility to draw business process scheme (e.g. someone creates document and send it to another employee, another employee makes some changees and send this doc to another employee or return to initiator etc)

Now im hardly learning Ruby and RoR. And my boss asks - can we implement this functional with RoR? It would be great if there is a software to draw business processes scheme and a gem that could be use this scheme.

Many thanks! And sorry for my english)

Stepan Yudin
  • 470
  • 3
  • 19

2 Answers2

8

Check rails_workflow. (http://github.com/madzhuga/rails_workflow). It has no graphical editor for business schemes but it allows you to configure processes and this may be close to what you need.
rails_workflow

Max
  • 341
  • 2
  • 6
  • Thank you Max, its exactly what i was looking for. Does this gem implement something like state-machine? I gonna look for dependencies...) – Stepan Yudin Feb 19 '15 at 07:37
  • Stepan, it is not using state-machine or something of that kind. Idea was to build normal process flow - when operation is done, process building new operations or completes. But you can also use something like 'workflow' gem in your application if you need state-machine. – Max Feb 19 '15 at 08:02
  • State machine allows you to build app logic using object state changes which is bad practice actually. If you have simple logic with few models - then it may work. If you will have many models and one model's state change causing other model state change and so on... Then few another models changing it's state causing another series of state machine callbacks... And if somebody will ask you why some exact record was changed the way it was changed - you will only be able to guess, not knowing exactly why. – Max Feb 19 '15 at 08:10
  • rails_workflow allows you not just configure but to track processes so you know exactly which process affected your record and how (which operations was performed etc). – Max Feb 19 '15 at 08:11
  • another trap with state machine - let's say you have some objects (different models and states, state transitions) - for example some order your app processing. This objects stay not modified for few months or even years. Then one day somebody decided to complete that order. Let's stay that your workflow callback methods was changed dozens of times since order was last changed. And now your order will be processes by new code. Sometimes it's ok but what if you want to have ability to process existing objects with old workflow and new ones - with new workflow? – Max Feb 19 '15 at 08:17
  • btw nothing stops you from using state machine WITH rails workflow together. If object state changed - use state machine to execute or complete some process operation and then process continue to move it's way. – Max Feb 19 '15 at 08:18
  • This implementation was great but i finally gone to OroCRM that contains wonderful workflow engine and many other great features – Stepan Yudin Sep 22 '15 at 14:57
1

Not sure if this is exactly what you're looking for, but we're using something called state machine in one of our rails 4 apps. The original repo is unmaintained, but there's a fork here that we're using. There are some great examples in the readme.

oolong
  • 665
  • 6
  • 20
  • So, i still have not found complex solution for my task. But you pointed me on determined state machines. Now i clearly understand what i have to discover next few days) Thank you! – Stepan Yudin Jan 10 '15 at 17:00