License Renewal
From LeonWiki!
License Renewal Original Algorithm
The algorithm to process the renewal inputs is as follows
- From doTask: Gather each record and place in a list
- Call compileCompany and create a list that looks like this:
- [companyName, [complete company input record]] (called nlist)
- then generate a list of each company name (called uniqueList)
- Invoke the type of task (email/text)
- Task instance takes each unique company name in for loop and calls getCompanyGroup, sending nlist and the company name
- getCompanyGroup goes through each item in nlist and performs these tests
- tests if the company name passed in matches the company name in nlist
- tests if the company product matches a product from the list of products
- tests if the serial number of the company product is not on the exclude list
- if all tests are true, the record is added to the company group data structure
- It then returns the company group which are all the records of one company that contain the products in the product list (nlist item so the structure is [company name, [complete company record]]
- If this is an email/text generation createEmail/generateTextFile is called
- createEmail and generateTestFile then
- call retrieveEmailAddress sending in the company name
- checks to see if this company is a manual email
- it next generates admin heading
- then it calls generateBody
- generateBody calls generateProductListing which organizes network core products and standard products into separate lists
- finally generates the email or text file
- Handle Network Products
- In gatherData -- determine if there is a core record
