Subscription functionality

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Subscription functionality

RamKrishna Swamy
Hello list,

I have gone through link of subscription
http://www.amicontech.com/blog/subscriptions-in-ofbiz-and-opentaps/, in
this link I did not find how subscription expires. I tried to find a
service which should be called on expiration of subscription but I couldn't
find. As per the given link we need to customize a service in order to
serve subscription to the user, so I created a simple java service in order
to see how it's called. It is called once, at the time of placing an order.
So it will create subscription in the system now if I set thruDate to
expire the subscription it expires in the system. Is there any service
which is called to expire the subscription.
If anyone has any idea how it works then please let me know.
--
Thanks,
Ramkrishna
Reply | Threaded
Open this post in threaded view
|

Re: Subscription functionality

Jacques Le Roux
Administrator
You got one possibilty (the simplest one and most used I guess). A little explanation of the data model is at https://cwiki.apache.org/confluence/display/OFBIZ/Subscription

Jacques

Ramkrishna Swamy wrote:

> Hello list,
>
> I have gone through link of subscription
> http://www.amicontech.com/blog/subscriptions-in-ofbiz-and-opentaps/, in
> this link I did not find how subscription expires. I tried to find a
> service which should be called on expiration of subscription but I couldn't
> find. As per the given link we need to customize a service in order to
> serve subscription to the user, so I created a simple java service in order
> to see how it's called. It is called once, at the time of placing an order.
> So it will create subscription in the system now if I set thruDate to
> expire the subscription it expires in the system. Is there any service
> which is called to expire the subscription.
> If anyone has any idea how it works then please let me know.
Reply | Threaded
Open this post in threaded view
|

Re: Subscription functionality

RamKrishna Swamy
Hello Jacques,

The mentioned tables I know but I have not come across any code or service
which would expire the subscription. I have seen one scheduled service
"runSubscriptionAutoReorders" which checks for expiration of the
subscription by comparing current date and subscription's thruDate; but it
doesn't expire the subscription only simple check is there. So has there
been any other code/service already written which performs task of
expiration of the subscription or I will have to write my own custom
service to perform the task. Please suggest.

--
Thanks
Ramkrishna


On Sun, Sep 8, 2013 at 9:30 PM, Jacques Le Roux <
[hidden email]> wrote:

> You got one possibilty (the simplest one and most used I guess). A little
> explanation of the data model is at
> https://cwiki.apache.org/confluence/display/OFBIZ/Subscription
>
> Jacques
>
> Ramkrishna Swamy wrote:
> > Hello list,
> >
> > I have gone through link of subscription
> > http://www.amicontech.com/blog/subscriptions-in-ofbiz-and-opentaps/, in
> > this link I did not find how subscription expires. I tried to find a
> > service which should be called on expiration of subscription but I
> couldn't
> > find. As per the given link we need to customize a service in order to
> > serve subscription to the user, so I created a simple java service in
> order
> > to see how it's called. It is called once, at the time of placing an
> order.
> > So it will create subscription in the system now if I set thruDate to
> > expire the subscription it expires in the system. Is there any service
> > which is called to expire the subscription.
> > If anyone has any idea how it works then please let me know.
>
Reply | Threaded
Open this post in threaded view
|

Re: Subscription functionality

Jacques Le Roux
Administrator
You will have to write your own. Be sure to check what is already in SubscriptionServices.java

Jacques

Ramkrishna Swamy wrote:

> Hello Jacques,
>
> The mentioned tables I know but I have not come across any code or service
> which would expire the subscription. I have seen one scheduled service
> "runSubscriptionAutoReorders" which checks for expiration of the
> subscription by comparing current date and subscription's thruDate; but it
> doesn't expire the subscription only simple check is there. So has there
> been any other code/service already written which performs task of
> expiration of the subscription or I will have to write my own custom
> service to perform the task. Please suggest.
>
>
>> You got one possibilty (the simplest one and most used I guess). A little
>> explanation of the data model is at
>> https://cwiki.apache.org/confluence/display/OFBIZ/Subscription
>>
>> Jacques
>>
>> Ramkrishna Swamy wrote:
>>> Hello list,
>>>
>>> I have gone through link of subscription
>>> http://www.amicontech.com/blog/subscriptions-in-ofbiz-and-opentaps/, in
>>> this link I did not find how subscription expires. I tried to find a
>>> service which should be called on expiration of subscription but I couldn't
>>> find. As per the given link we need to customize a service in order to
>>> serve subscription to the user, so I created a simple java service in order
>>> to see how it's called. It is called once, at the time of placing an order.
>>> So it will create subscription in the system now if I set thruDate to
>>> expire the subscription it expires in the system. Is there any service
>>> which is called to expire the subscription.
>>> If anyone has any idea how it works then please let me know.
Reply | Threaded
Open this post in threaded view
|

Re: Subscription functionality

hans_bakker
Isn't it so that it works the other way around?

all subscriptions have an expiry date, and need to be extended?
When not extended will expire using that date?

i think there was some extending service which is run regularly....

Regards,
Hans

On 09/12/2013 06:54 PM, Jacques Le Roux wrote:

> You will have to write your own. Be sure to check what is already in SubscriptionServices.java
>
> Jacques
>
> Ramkrishna Swamy wrote:
>> Hello Jacques,
>>
>> The mentioned tables I know but I have not come across any code or service
>> which would expire the subscription. I have seen one scheduled service
>> "runSubscriptionAutoReorders" which checks for expiration of the
>> subscription by comparing current date and subscription's thruDate; but it
>> doesn't expire the subscription only simple check is there. So has there
>> been any other code/service already written which performs task of
>> expiration of the subscription or I will have to write my own custom
>> service to perform the task. Please suggest.
>>
>>
>>> You got one possibilty (the simplest one and most used I guess). A little
>>> explanation of the data model is at
>>> https://cwiki.apache.org/confluence/display/OFBIZ/Subscription
>>>
>>> Jacques
>>>
>>> Ramkrishna Swamy wrote:
>>>> Hello list,
>>>>
>>>> I have gone through link of subscription
>>>> http://www.amicontech.com/blog/subscriptions-in-ofbiz-and-opentaps/, in
>>>> this link I did not find how subscription expires. I tried to find a
>>>> service which should be called on expiration of subscription but I couldn't
>>>> find. As per the given link we need to customize a service in order to
>>>> serve subscription to the user, so I created a simple java service in order
>>>> to see how it's called. It is called once, at the time of placing an order.
>>>> So it will create subscription in the system now if I set thruDate to
>>>> expire the subscription it expires in the system. Is there any service
>>>> which is called to expire the subscription.
>>>> If anyone has any idea how it works then please let me know.

Reply | Threaded
Open this post in threaded view
|

Re: Subscription functionality

Jacques Le Roux
Administrator
In reply to this post by RamKrishna Swamy
Hans Bakker wrote:
> Isn't it so that it works the other way around?

I don't know exactly what Ramkrishna  wants to do. Sometimes you need to customise things (I had to so I did not use the std way).

> all subscriptions have an expiry date, and need to be extended?
> When not extended will expire using that date?

I did not check code in SubscriptionServices.java. I thought Ramkrishna  did, and it did not fit his needs.

> i think there was some extending service which is run regularly....

Yes, as said Ramkrishna : runSubscriptionAutoReorders
<description>A service designed to be automatically run by job scheduler to create orders from subscriptions which need to be extended.
This is done by looking for all subscriptions which are active and where the automaticExtend flag is set to "Y"</description>

I see also a SECA for changeOrderStatus which runs processExtendSubscriptionByOrder

Jacques


> Regards,
> Hans
>
> On 09/12/2013 06:54 PM, Jacques Le Roux wrote:
>> You will have to write your own. Be sure to check what is already in SubscriptionServices.java
>>
>> Jacques
>>
>> Ramkrishna Swamy wrote:
>>> Hello Jacques,
>>>
>>> The mentioned tables I know but I have not come across any code or service
>>> which would expire the subscription. I have seen one scheduled service
>>> "runSubscriptionAutoReorders" which checks for expiration of the
>>> subscription by comparing current date and subscription's thruDate; but it
>>> doesn't expire the subscription only simple check is there. So has there
>>> been any other code/service already written which performs task of
>>> expiration of the subscription or I will have to write my own custom
>>> service to perform the task. Please suggest.
>>>
>>>
>>>> You got one possibilty (the simplest one and most used I guess). A little
>>>> explanation of the data model is at
>>>> https://cwiki.apache.org/confluence/display/OFBIZ/Subscription
>>>>
>>>> Jacques
>>>>
>>>> Ramkrishna Swamy wrote:
>>>>> Hello list,
>>>>>
>>>>> I have gone through link of subscription
>>>>> http://www.amicontech.com/blog/subscriptions-in-ofbiz-and-opentaps/, in
>>>>> this link I did not find how subscription expires. I tried to find a
>>>>> service which should be called on expiration of subscription but I couldn't
>>>>> find. As per the given link we need to customize a service in order to
>>>>> serve subscription to the user, so I created a simple java service in order
>>>>> to see how it's called. It is called once, at the time of placing an order.
>>>>> So it will create subscription in the system now if I set thruDate to
>>>>> expire the subscription it expires in the system. Is there any service
>>>>> which is called to expire the subscription.
>>>>> If anyone has any idea how it works then please let me know.
Reply | Threaded
Open this post in threaded view
|

Re: Subscription functionality

Pierre Smits
In reply to this post by hans_bakker
That depends on the legal setup of each country regarding protection of
customers.

In a country it might be so that subscriptions must automatically end when
the period reaches the thru date and no confirmation has been given, and in
others it can be so that subscriptions automatically extend unless a
cancelation has been received.

The solution should cater for both.


Pierre Smits

*ORRTIZ.COM <http://www.orrtiz.com>*
Services & Solutions for Cloud-
Based Manufacturing, Professional
Services and Retail & Trade
http://www.orrtiz.com


On Fri, Sep 13, 2013 at 4:07 AM, Hans Bakker
<[hidden email]>wrote:

> Isn't it so that it works the other way around?
>
> all subscriptions have an expiry date, and need to be extended?
> When not extended will expire using that date?
>
> i think there was some extending service which is run regularly....
>
> Regards,
> Hans
>
>
> On 09/12/2013 06:54 PM, Jacques Le Roux wrote:
>
>> You will have to write your own. Be sure to check what is already in
>> SubscriptionServices.java
>>
>> Jacques
>>
>> Ramkrishna Swamy wrote:
>>
>>> Hello Jacques,
>>>
>>> The mentioned tables I know but I have not come across any code or
>>> service
>>> which would expire the subscription. I have seen one scheduled service
>>> "runSubscriptionAutoReorders" which checks for expiration of the
>>> subscription by comparing current date and subscription's thruDate; but
>>> it
>>> doesn't expire the subscription only simple check is there. So has there
>>> been any other code/service already written which performs task of
>>> expiration of the subscription or I will have to write my own custom
>>> service to perform the task. Please suggest.
>>>
>>>
>>>  You got one possibilty (the simplest one and most used I guess). A
>>>> little
>>>> explanation of the data model is at
>>>> https://cwiki.apache.org/**confluence/display/OFBIZ/**Subscription<https://cwiki.apache.org/confluence/display/OFBIZ/Subscription>
>>>>
>>>> Jacques
>>>>
>>>> Ramkrishna Swamy wrote:
>>>>
>>>>> Hello list,
>>>>>
>>>>> I have gone through link of subscription
>>>>> http://www.amicontech.com/**blog/subscriptions-in-ofbiz-**
>>>>> and-opentaps/<http://www.amicontech.com/blog/subscriptions-in-ofbiz-and-opentaps/>,
>>>>> in
>>>>> this link I did not find how subscription expires. I tried to find a
>>>>> service which should be called on expiration of subscription but I
>>>>> couldn't
>>>>> find. As per the given link we need to customize a service in order to
>>>>> serve subscription to the user, so I created a simple java service in
>>>>> order
>>>>> to see how it's called. It is called once, at the time of placing an
>>>>> order.
>>>>> So it will create subscription in the system now if I set thruDate to
>>>>> expire the subscription it expires in the system. Is there any service
>>>>> which is called to expire the subscription.
>>>>> If anyone has any idea how it works then please let me know.
>>>>>
>>>>
>
Reply | Threaded
Open this post in threaded view
|

Re: Subscription functionality

Ted Byers
On Fri, Sep 13, 2013 at 3:16 AM, Pierre Smits <[hidden email]> wrote:

> That depends on the legal setup of each country regarding protection of
> customers.
>
> In a country it might be so that subscriptions must automatically end when
> the period reaches the thru date and no confirmation has been given, and in
> others it can be so that subscriptions automatically extend unless a
> cancelation has been received.
>
> The solution should cater for both.
>
>
> Pierre Smits
>
> *ORRTIZ.COM <http://www.orrtiz.com>*
> Services & Solutions for Cloud-
> Based Manufacturing, Professional
> Services and Retail & Trade
> http://www.orrtiz.com
>
>
What should that solution look like?

More importantly, which rule applies when the vendor is in one country
and the client is in another and the two countries in question have
such different rules?  A vendor can reasonably be expected to be aware
of extant law in his own country, but it is hardly reasonable to
expect him to be aware of extant laws in any or all of the other 195
countries on the planet.  And it gets worse, as in Canada, consumer
protection rules are generally defined at the provincial level (I have
no idea if there are such rules defined at the federal level in Canada
also - the feds and provinces occasionally, albeit rarely, work
together), and if other countries, such as the US, assign such
responsibility to member states, the number of relevant jurisdictions
grows considerably.

Do you know if the credit card networks (such as VISA and Mastercard)
have rules governing this, and, if so, what they are?

Cheers

Ted
Reply | Threaded
Open this post in threaded view
|

Re: Subscription functionality

Pierre Smits
Hi Ted,

First of all, in general companies have a document called Terms of Sale and
Delivery and in most cases these documents contain a paragraph stating
which law and court is deemed to be applicable when conflicts regarding the
terms of sale and delivery arise. The companies better make sure that they
don't have terms that are in violation of that law.

Now,regarding cross-border selling, it all has to do with the revenue
gained from cross-border sales and the risk it involves. If the revenue is
marginal the company might decide that it is cheaper not to create to much
fuss when a customer says that some parts aren't applicable according to
domestic or even regional law, and just terminate the contract.

But, when the revenue gained is significant, the company better make sure
to what extend he runs risks.

Af for how Mastercard and VISA are doing this, these companies have such a
customer base in each country to enable them to have a presence in those
countries. Just to ease these risks. In the countries they don't have a
presence the customer base is so small compared to the total that they can
accept those risks.

As for the solution regarding the component, I would envision that a
subscription either has
- the  'automatically terminate' option, or
- the 'automatically extend' option.

You could even think of a configuration per country/region of the
underlying product to determine which option is mandatory.

Regards,


Pierre Smits

*ORRTIZ.COM <http://www.orrtiz.com>*
Services & Solutions for Cloud-
Based Manufacturing, Professional
Services and Retail & Trade
http://www.orrtiz.com


What should that solution look like?
>
> More importantly, which rule applies when the vendor is in one country
> and the client is in another and the two countries in question have
> such different rules?



> A vendor can reasonably be expected to be aware
> of extant law in his own country, but it is hardly reasonable to
> expect him to be aware of extant laws in any or all of the other 195
> countries on the planet.



> And it gets worse, as in Canada, consumer
> protection rules are generally defined at the provincial level (I have
> no idea if there are such rules defined at the federal level in Canada
> also - the feds and provinces occasionally, albeit rarely, work
> together), and if other countries, such as the US, assign such
> responsibility to member states, the number of relevant jurisdictions
> grows considerably.
>
> Do you know if the credit card networks (such as VISA and Mastercard)
> have rules governing this, and, if so, what they are?
>
> Cheers
>
> Ted
>
Reply | Threaded
Open this post in threaded view
|

Re: Subscription functionality

Jacques Le Roux
Administrator
Pierre Smits wrote:

> Hi Ted,
>
> First of all, in general companies have a document called Terms of Sale and
> Delivery and in most cases these documents contain a paragraph stating
> which law and court is deemed to be applicable when conflicts regarding the
> terms of sale and delivery arise. The companies better make sure that they
> don't have terms that are in violation of that law.
>
> Now,regarding cross-border selling, it all has to do with the revenue
> gained from cross-border sales and the risk it involves. If the revenue is
> marginal the company might decide that it is cheaper not to create to much
> fuss when a customer says that some parts aren't applicable according to
> domestic or even regional law, and just terminate the contract.
>
> But, when the revenue gained is significant, the company better make sure
> to what extend he runs risks.
>
> Af for how Mastercard and VISA are doing this, these companies have such a
> customer base in each country to enable them to have a presence in those
> countries. Just to ease these risks. In the countries they don't have a
> presence the customer base is so small compared to the total that they can
> accept those risks.
>
> As for the solution regarding the component, I would envision that a
> subscription either has
> - the  'automatically terminate' option, or
> - the 'automatically extend' option.

This is what Subscription.automaticExtend is all about. It's clearly explained at
http://www.amicontech.com/blog/subscriptions-in-ofbiz-and-opentaps/

The data model is good and extendable, you only have to think how to use it in peculiar cases
The subscription services are also a good basis for that.

Jacques
 

> You could even think of a configuration per country/region of the
> underlying product to determine which option is mandatory.
>
> Regards,
>
>
> Pierre Smits
>
> *ORRTIZ.COM <http://www.orrtiz.com>*
> Services & Solutions for Cloud-
> Based Manufacturing, Professional
> Services and Retail & Trade
> http://www.orrtiz.com
>
>
> What should that solution look like?
>>
>> More importantly, which rule applies when the vendor is in one country
>> and the client is in another and the two countries in question have
>> such different rules?
>
>
>
>> A vendor can reasonably be expected to be aware
>> of extant law in his own country, but it is hardly reasonable to
>> expect him to be aware of extant laws in any or all of the other 195
>> countries on the planet.
>
>
>
>> And it gets worse, as in Canada, consumer
>> protection rules are generally defined at the provincial level (I have
>> no idea if there are such rules defined at the federal level in Canada
>> also - the feds and provinces occasionally, albeit rarely, work
>> together), and if other countries, such as the US, assign such
>> responsibility to member states, the number of relevant jurisdictions
>> grows considerably.
>>
>> Do you know if the credit card networks (such as VISA and Mastercard)
>> have rules governing this, and, if so, what they are?
>>
>> Cheers
>>
>> Ted
Reply | Threaded
Open this post in threaded view
|

Re: Subscription functionality

RamKrishna Swamy
In reply to this post by Jacques Le Roux
Hello Jacques/Hans,

Please find my response inline.


On Fri, Sep 13, 2013 at 11:55 AM, Jacques Le Roux <
[hidden email]> wrote:

> Hans Bakker wrote:
> > Isn't it so that it works the other way around?
>
> I don't know exactly what Ramkrishna  wants to do. Sometimes you need to
> customise things (I had to so I did not use the std way).
>

What I want to do is I have to trigger one customize service when
subscription is expired.


>
> > all subscriptions have an expiry date, and need to be extended?
> > When not extended will expire using that date?
>
> I did not check code in SubscriptionServices.java. I thought Ramkrishna
>  did, and it did not fit his needs.
>

I have checked code in SubscriptionServices.java but no single method is
expiring the subscription, while extending it.


>
> > i think there was some extending service which is run regularly....
>
> Yes, as said Ramkrishna : runSubscriptionAutoReorders
> <description>A service designed to be automatically run by job scheduler
> to create orders from subscriptions which need to be extended.
> This is done by looking for all subscriptions which are active and where
> the automaticExtend flag is set to "Y"</description>
>
> I see also a SECA for changeOrderStatus which runs
> processExtendSubscriptionByOrder
>
> Jacques
>
>
> > Regards,
> > Hans
> >
> > On 09/12/2013 06:54 PM, Jacques Le Roux wrote:
> >> You will have to write your own. Be sure to check what is already in
> SubscriptionServices.java
> >>
> >> Jacques
> >>
> >> Ramkrishna Swamy wrote:
> >>> Hello Jacques,
> >>>
> >>> The mentioned tables I know but I have not come across any code or
> service
> >>> which would expire the subscription. I have seen one scheduled service
> >>> "runSubscriptionAutoReorders" which checks for expiration of the
> >>> subscription by comparing current date and subscription's thruDate;
> but it
> >>> doesn't expire the subscription only simple check is there. So has
> there
> >>> been any other code/service already written which performs task of
> >>> expiration of the subscription or I will have to write my own custom
> >>> service to perform the task. Please suggest.
> >>>
> >>>
> >>>> You got one possibilty (the simplest one and most used I guess). A
> little
> >>>> explanation of the data model is at
> >>>> https://cwiki.apache.org/confluence/display/OFBIZ/Subscription
> >>>>
> >>>> Jacques
> >>>>
> >>>> Ramkrishna Swamy wrote:
> >>>>> Hello list,
> >>>>>
> >>>>> I have gone through link of subscription
> >>>>> http://www.amicontech.com/blog/subscriptions-in-ofbiz-and-opentaps/,
> in
> >>>>> this link I did not find how subscription expires. I tried to find a
> >>>>> service which should be called on expiration of subscription but I
> couldn't
> >>>>> find. As per the given link we need to customize a service in order
> to
> >>>>> serve subscription to the user, so I created a simple java service
> in order
> >>>>> to see how it's called. It is called once, at the time of placing an
> order.
> >>>>> So it will create subscription in the system now if I set thruDate to
> >>>>> expire the subscription it expires in the system. Is there any
> service
> >>>>> which is called to expire the subscription.
> >>>>> If anyone has any idea how it works then please let me know.
>



--
Thanks
Ramkrishna