Hello,
Thank you all for replies. Let me give some examples.

Suppose that we are coding an ecommerce site. In this site, we need
some rules should apply on specific points as follows;

1. Action triggered events, example;
Site manager can prepare himself campaigns about products. It means;
  a) Site manager can define discount percentage for one product, for
one category, or some products together,
  b) Site manager can prepare and put campaign data (image +
description) to the specific page on prepared elements defined by
actions.
  It means campaign data should be shown  when customer goes to
specific categories. Elements could be clickable, image only or routed
  to another product page.
  b) There should be smart rule engine (which is becoming workflow
engine) that sits under all operations and do necessary modifications
on url routes, other pages, storage data, sends email etc. Example,
when customer adds discounted product to the shopping cart, calculate
the price, give another offer (1 free x product) to the customer, show
this on shopping cart and e-mail at the same time another 20 points
gift coupons to the customers email address.

2. Some specific action triggers some other actions and all actions
should be controlled, example;
1. Supplier inserts new record to available products, example;
 a) Engine should check supplier location data, shipment data and
reject or accept that this product could be served by this supplier,
 b) Customer already bought one product and we want to show "%25 off
on duplicate" notice to her at shopping cart,
 c) When customer newly register to our site, give her extra 30 bucks
gift coupons, show her tell a friend campaign, show %5 discount on
every products she visit.

2. Sequential operations, (typical workflow mimic) example;
 a) Customer bought 4 different products,
 b) Site operator passes this order to the specific supplier,
 c) Site admin approves or rejects this order to send to selected
supplier,
 d) Then this order takes place to selected supplier

3. Time related events, example;
 a) Every 1 hour, look orders table and find top 5 customer and give a
free offer already prepared on the rule (like 1 free mug)
 b) Check shopping cart and if any left items found send a notice to
customer to attract her purchase in a short time.

I know, i know, we have cron and it's a good timer but what about
logic i have drive inside of the application? What about sequential
operations which needs access out of cron job?

Here is the pure real life examples. I've came to solve my problems
with this structure, but this is quite weak and
seems not a good solution to me;

DROP TABLE IF EXISTS rules;
CREATE TABLE rules (
  id int(11) NOT NULL auto_increment,
        action_name varchar(100) NOT NULL default '', /* Flow events */
        action_type tinyint(1) NOT NULL default '0', /* 0=Before Action,
1=After Action */
        rule_name varchar(255) NOT NULL default '',
       rule_code text NOT NULL default '',
       multi_process  tinyint(1) NOT NULL default '0',
        start_date datetime default NULL,
        end_date datetime default NULL,
        status tinyint(1) NOT NULL default '0',
        required_power tinyint(1) NOT NULL default '0', /* admin_power. */
        created datetime default NULL,
        modified datetime default NULL,
  PRIMARY KEY  (id)
);


DROP TABLE IF EXISTS actions;
CREATE TABLE actions (
        action_name varchar(100) NOT NULL default '', /* Flow events */
        action_description varchar(255) NOT NULL default ''
  PRIMARY KEY (action_name)
);


I have some other related tables to hold some data but i need OO way
to solve real life problems.
That's why i started to check workflow engines.

Cheers,
Gokhan

On Jul 21, 2:13 am, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On 7/20/07, francky06l <[EMAIL PROTECTED]> wrote:
>
>
>
> > I like the idea of workflow engine or "rules" engine. Actually, Cake
> > is a framework to design application, but having the user (or
> > parameters) designing is own "flow" once the application is done is a
> > step further.
>
> I still don't get it.  Got a good example?
>
> --
> Chris Hartjes
> Senior Developer
> Cake Development Corporation
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheBallpark -http://www.littlehart.net/attheballpark
> @TheKeyboard -http://www.littlehart.net/atthekeyboard


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to