Rules Vs. Conditional actions

Posts: 85
Joined: 09/08/2007
Bug Finder

I have a feeling that CA is going to be the Ubrowser/ TApir of 2.x version. I also think that the reason workflow_ng/ rules was removed is because rules wasn't ready before starting the port.

Instead of just complaining about it, and trying to show that it's code duplication etc' etc' I'll try to contribute. I'll take latest version and integrate it with Rules module and have it ready for your review. Deal? Smiling

Which part is the most challenging? - I'll start there.

Posts: 4695
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Hmm... I'm not really sure how to address the issue. There are several things involved... first, uBrowser is being taken out b/c it just wasn't helpful. Somewhere along the line I actually made an alternate interface in core. Sticking out tongue TAPIr isn't being taken out, it's being folded in to remove the external dependency. It just isn't something module packages are going to use as is, and we barely use it in Ubercart.

Workflow-ng is being moved to Rules. A name change and reworking doesn't bother me and wouldn't keep me from using it. Mostly it comes down to needing something different, needing it quicker, and needing to remove the external dependency. I don't think anything we'll do would make an Ubercart site incompatible with Rules, but I do think that some things we need to do would be a lot harder just using Rules (insomuch as it is similar to Workflow-ng).

One example is evaluating stand alone condition sets that are setup through a form embedded into the taxes administration. Right now, someone has to create a tax rule then browse away to the Workflow-ng overview page and add rules to a tax to limit its application. This is unnecessarily complex and has caused plenty of headaches for folks setting up shipping. Doing this is already possible w/ our core conditional actions parser, and the UI is well underway.

Refer to point 2 in this post. We really appreciate all the work fago put into Workflow-ng and were to have found it in our early development of Ubercart. I just don't think it's good for Ubercart in the long run to outsource such an important part of the project.

Posts: 85
Joined: 09/08/2007
Bug Finder

10x Ryan for the quick reply - it makes sense what you wrote...
While reading I realized we actually might be able to enjoy both worlds -
1. CA events can trigger Rules.
2. We might be able to automatically create Rule actions/ conditions based on the API of CA - so a user can decide which module to use.

I'll keep my eye on this issue and we'll try to make it happen Smiling

Posts: 4695
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Totally possible. Cool We'll be sure to post documentation with the 2.x release.

Posts: 3
Joined: 03/01/2008

hm, it's sad that you go on and create your own solution instead of relying on a existing one Sad

>We could, as was suggested, help out instead with Rules and make sure folks can port their code from Workflow-ng to Rules...

I think you got something wrong, there will be a straight upgrade path from workflow-ng to rules supporting even changed conditions/actions.
Of course there was also an upgrade from 1.x to 2.x - I don't noted that ubercart has troubles with workflow-ng 2.x - which can't be really serious as workflow-ng 2.x is nothing more than a little improved 1.x version, which is of course compatible with it. If you'd have contacted me, I'm sure we would have been able to fix the issues.

About UI integration:
* Rules comes with a well founded API - so it would be no problem to create your own UI on top of it.
* I think it wouldn't be hard to integrate in another place the existing UI either.

Rules comes also with a new concept: Rule Sets, which could be compared with subroutines.
They can be used for customization, so you don't need to create events when there aren't really one. Instead you could ship with a default rule set, which users then can customize by adding/changing rules.

Anyway it looks like the decision has been made Sad

Posts: 489
Joined: 08/13/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer

Hi,

In understand both opinion of Ryan and Fago

I just would add that, even if the workflow integration brings some unwanted step for configuration (example shipping : You add the shipping quote, and then, you activate the workflow rules and define the conditions). Workflow allowed to define some usefull and complex conditions/actions without coding one single line.

I wonder, if Ubercart get rid of Workflow/rules, if it will be able to provide all the possibilities workflow already provide. Some workflow conditions and actions, not specially related to ubercart are very usefull. For example, get the user role to calculate a tax rate etc...

In addition, a lot of modules began to integrate workflow-ng, they all add some new actions, conditions, without the need for ubercart to add a single line of code. Example the organic group or nodeprofile integration, I don't use them with ubercart ATM, but it could be usefull for people to create a relation between a group and ubercart, and workflow is a good gateway for that.

If ubercart begin to write his own solution, this would involve that these module have to write one more integration to beeing usable with ubercart or ubercart to write extra code to beeing usable with these modules.

EDIT : I would like that, more than workflow, there is another dependencies/integration that it would be judicious to remove, it's the imagefield integration. This module took too much time to go out, and the issue queue for 6.x pratically seems dead. A very good alternative, more more reactive grown up, it's filefield with filefield image.

Posts: 4695
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

@fago: Hey fago, thanks for stopping by. As I mentioned above, we're very grateful for your work and don't want to discourage you from continuing to innovate and improve your system. We just had to decide whether to keep depending on an external module for an essential core feature or roll the necessary functionality into core with a system that is similar but more suited to our needs.

For example, we offer in core a basic product list and a basic catalog. Either one of these is possible in Views with much more flexibility, but we know that new users to Drupal and Ubercart would expect at least some sort of store product listing. To that end, we provided a basic solution so folks aren't overwhelmed.

However, we also provide integration so users wishing to take advantage of Views (who doesn't? Smiling) can still do so. We want people to be able to use the best tools possible in building their Ubercart sites. However, we don't want the core of Ubercart to be restricted by an external dependency. It's just not something we can govern or troubleshoot as easily as we can a core file. (And when I say "restricted", I don't mean the external modules are inferior or incomplete, but rather they have different use cases than what we might need to accomplish in core.)

So, I still think a contributed module can easily integrate UC w/ Rules, especially since it seems we'll both have similar hook structures and requirements. In fact, I'd be quite interested to see it happen.

@zmove: Ideally, the things Ubercart needs in its core will be easier to accomplish with the new system - defining complex taxes, shipping rules, and automated order processing. We'll provide similar conditions for necessary things like checking/modifying user roles. However, for external integration that's twice removed (i,e, UC -> Rules -> OG), there would just have to be an extra step in the form of a CA action that invokes a Rules trigger.

The CA system in core uses a similar enough hook structure that UC modules won't have a problem using the new system with little conversion. I don't expect third party modules to integrate with Ubercart's CA system in their core, though they'd be welcome to do so. Instead, it would seem like a module could function as a lightweight bridge that maps CA into Rules or vice versa. I think we'll just have to see what needs/use cases pop up as the project moves forward.

----

The real clincher here, too, is speed of development. A Drupal 6 version of UC is almost ready for testing, and we simply can't do that with Rules as is. It's hard enough integrating w/ complete, stable modules, much less modules that are still in alpha development.

Posts: 489
Joined: 08/13/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer

Hi,

As I said before, I completely understand your choices, which are completely viable. You never know, maybe fago you will be crunched by a tank tomorrow, if it's the case, who will develop rules module ? Eye-wink

The fact to provide minimum function in ubercart core and provide the possibilities to extend them with third party module is probably the best choice for usability and extensibility, but this is the choice that bring the most work for you Eye-wink

But be carefull, by providing too much out of the box feature, it finally could be more difficult to personalize ubercart than directly provide an integration with a less "out of the box" module, but more powerfull, and the product listing is a good example for that.

Imagine that an user, that was firstly happy with the core listing product now want something that is not possible with it, and it can be a simple thing, like adding the product SKU in the listing or providing an AJAX pagination.

He will have 2 solutions : coding ajax pagination in a custom module for the default product listing, or reproduct the listing with views, that already provide ajax pagination. Using views will be more simple for him but will involve to create the view, theme it as the product listing he had etc.... Finally, it was more simple to directly create the listing with view, and just add the SKU column by adding it under the field section of views.

Posts: 3
Joined: 03/01/2008

thanks for your explanation.

>there would just have to be an extra step in the form of a CA action that invokes a Rules trigger.
I think using "Rule Sets" would perfectly fit here. Just do an action that invokes rule sets and you'll be able to use the whole power of rules.
Perhaps it's easily possible to make your conditionals available as rules condition too.

Posts: 4695
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Quite likely. We aren't planning a great divergence at least for the foreseeable future. Smiling