Remove Subscription Service
- g_sakkas (Unlicensed)
- Former user (Deleted)
Owned by g_sakkas (Unlicensed)
The following example shows how to remove a list of services from a subscription.
Â
removeService.java Expand source
@EJB private CRMProcessSubscriptionServiceRemoveBean processSubscriptionServiceRemoveBean; public CRMDOSubscriptionAction removeService(CRMDOSubscription subscription,ArrayList<CRMDOProduct> products){ //create the subscription service remove data object SubscriptionServiceRemove subscriptionServiceRemove = processSubscriptionServiceRemoveBean.constructSubscriptionServiceRemove(subscription); //The applicable classification for that action are:REGRET_SERVICE,CANCEL_SERVICE,UNDO_ADD_SERVICE //the list of the products that will be removed from the subscription Set<SubscriptionActionProduct> servicesToBeProcessed = new HashSet<SubscriptionActionProduct>(); for (int i=0;i<products.size();i++) { CRMDOProduct product =(CRMDOProduct)products.get(i); //create a new subscription action product data object where you will define the product that will be removed by the action SubscriptionActionProduct subscriptionActionProduct =new SubscriptionActionProduct(); //load the related subscription service CRMDOSubscriptionService subscriptionService = subscriptionServiceBean.load(subscription, product); subscriptionActionProduct.setIsDeleted(new Integer(0)); subscriptionActionProduct.setProduct(product); subscriptionActionProduct.setSubService(subscriptionService); subscriptionActionProduct.setIsSelected(new Integer(1)); servicesToBeProcessed.add(subscriptionActionProduct); } subscriptionServiceRemove.setServicesToBeProcessed(servicesToBeProcessed); //submit the subscription service remove data object in order to remove the product from subscription //the subscription action data object is the object which contains all the information about the action you perform on the subscription CRMDOSubscriptionAction subscriptionAction = processSubscriptionServiceRemoveBean.submit(subscriptionServiceRemove); return subscriptionAction; }