[ https://issues.apache.org/jira/browse/OFBIZ-5333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13796440#comment-13796440 ] Ivan Cauchi commented on OFBIZ-5333: ------------------------------------ Thanks Jacques for your comments. Yes we are proposing to add SubscriptionServices.runServiceOnSubscriptionExpiry. I've gone over the discussion on customMethod. I'm not sure I understand it fully, but it seems to be a way to call a method directly without needing a service. If that's the case, my understanding is that serviceName is more flexible, as a method is Java specific, whereas a service can be written in any language. In any case, since the conclusion of Ofbiz-5020 was that both patterns will be retained, so serviceName will not be deprecated, the latter is what we will go with. > Trigger for service to run upon subscription expiry > --------------------------------------------------- > > Key: OFBIZ-5333 > URL: https://issues.apache.org/jira/browse/OFBIZ-5333 > Project: OFBiz > Issue Type: Improvement > Components: content, order, product > Affects Versions: SVN trunk > Reporter: Ivan Cauchi > Labels: entity, expiry, patch, product, service, subscription > Fix For: SVN trunk > > > This issue is a follow up of a discussion on the Ofbiz user and dev fora, titled 'Subscription Functionality'. > The main characteristics of the Ofbiz subscriptions are: > a) the access control of the subscribed internal content is missing, and can be provided by custom means. As well, subscription to content on external systems needs a trigger, which can be provided through Content.serviceName. > b) the subscription model has an inbuilt assumption that access to the resource is terminated outside of the default Ofbiz, such as by a custom Ofbiz process or an external process. > The generic use case I'm thinking of is external systems providing content to which a client desires to subscribe which don't have an inbuilt expiry. These systems require a trigger to enable provisioning, and another trigger to enable deprovisioning. > Ofbiz can be used to manage the provision of access to such external content, triggering the provisioning process through a service in Content.serviceName. What's missing is an (optional) trigger for the deprovisioning process. > One way which we're thinking of resolving this is: > a) to add another column to the SubscriptionResource entity, called serviceNameOnExpiry (note to people that had followed the discussion on the Ofbiz mailing lists: the field name has been shortened to fit the 30 character limit). This would contain the service to run to trigger the deprovisioning process. If containing null, nothing would be run, and Ofbiz exhibits the current default behaviour. > b) create a new service runServiceOnSubscriptionExpiry within SubscriptionServices.java, that is scheduled to run regularly, similar to the existing runSubscriptionAutoReorder. This code would check whether a subscription has expired. If so, and a service exists within SubscriptionResource.serviceNameOnExpiry, and Subscription.automaticExtend=N, this code runs that service. > This approach has the advantage of complete separation of the default and new functionality with the cost of some additional database lookups. > We will be submitting patches for this new functionality shortly. -- This message was sent by Atlassian JIRA (v6.1#6144) |
Free forum by Nabble | Edit this page |