-
1. Re: Design advice: multi-day scenario
vchmakov Jan 30, 2013 3:30 PM (in response to jhl)Hi,
This process is executed by scheduler periodically, e.g. daily:
Select Customer.ID Customer where Today-Customer.ActivationDay = 10 and Customer.Status <> “No Mail” -> send email A
Select Customer.ID Customer where Today-Customer.ActivationDay = 20 and Customer.Status <> “No Mail” -> send email B
Select Customer.ID Customer where Today-Customer.ActivationDay = 30 and Customer.Status <> “No Mail” -> send email C
Select Customer.ID Customer where Today-Customer.ActivationDay = 45 and Customer.Status <> “No Mail” -> send email D
Select Customer.ID Customer where Today-Customer.ActivationDay = 60 and Customer.Status <> “No Mail” -> update Customer set Customer .status=“No Mail” where Customer.ID=?
This process is triggered by “Unsubscribe” event:
Select * from Customer where Customer.ID = ? -> update customer set status=“No Mail” where Customer.ID=?
In my opinion this use case fits perfectly for the Drools implementation (event/rule driven), but has nothing to do with jBPM. Maybe there is something not mentioned above that can be implemented in jBPM, but it is always easy to do implementing a rule in certain way.
Thanks,
Vladimir
-
2. Re: Design advice: multi-day scenario
jhl Jan 30, 2013 4:15 PM (in response to vchmakov)Thanks for your reply, Vladimir - this is helpful.
I guess this can be done in drools fusion (or drools classic), but does fusion support the persistence of state? For example, on a daily basis the number of days since creation will increment for each customer - there may also be other events that will modify other settings. I want this to be stored. This is also why I wanted to use jbpm.
-
3. Re: Design advice: multi-day scenario
vchmakov Jan 30, 2013 4:47 PM (in response to jhl)Hi,
That’s the point - you do not need to store the number of days since creation, you calculate it: Today-Customer.ActivationDay. Other parameters are also persisted in your data model, e.g. update Customer set Customer .status=“No Mail” where Customer.ID=? etc. Why would you use jBPM persistence to store the values which belong to YOUR business logic? jBPM is about to help you solving other problems. I’m not saying that there is no use of it in your project, but what you have described above in not for jBPM implementation in my opinion. That’s all I’m trying to say.
Thanks,
Vladimir