Subscription[] inactiveSubscriptions = dataAccessService.getInactiveSubscriptionsOfCustomer(tenantId);
if(inactiveSubscriptions.length>0){
//I am doing this assuming that there wont be more than one subscription for a tenant
//at the time of activation. Logically it cant be.
subscription = inactiveSubscriptions[0];
boolean activated = dataAccessService.activateSubscription(subscription.getId());
if(activated){
log.debug("Subscription was activated for tenant: " + tenantId);
}
}
}