I'm working on a project that collects information about a corporate client and then based on the information provided, connects that client with other companies that can help them with a specific need.
I have worked through the first half of the project to collect data conditionally based on the type of industry/operations the company is involved with using rules. Now i need to use the information collected and filter a view to find matching companies.
Essentially once a client submits their finalized application (a collection of different fields within a handful of content types), behind the scenes I need to figure out a way to filter a view of other companies with matching characteristics, then for each company that matches the filtered view, add a new node within a separate content type and then entity reference that node back to the finalized application for further input/editing. Here is a simplified visual:
Most of the fields being filtered are taxonomy references; however, some would be numeric inputs filtered by a less than, greater than, or equal to filter.
Financials Taxonomy: good financials; so so financials; challenged financials
Industry Taxonomy: technology, manufacturing, real estate, etc...
"Client A" node field answers in Clients content type:
- good financials (financials taxonomy reference)
- focused on technology (industry taxonomy reference)
- 50 employees (numerical field)
Companies content type contains the following nodes:
- Company A: likes only challenged financials; focused on manufacturing; works with companies <100 employees
- Company B: likes only good financials; focused on technology; works with companies <500 employees
- Company C: likes only challenged financials; focused on manufacturing; works with companies <25 employees
- Company D: likes only good or challenged financials; focused on manufacturing; works with companies <100 employees
Once client A selects a field indicating the answers are finalized and the content type Clients is saved, I need to find a way to have the matching companies filtered based on client A's answers, and a new node for a different content type (content type called Partner Details) should be created for each matching company.
That content type would be called Partner Details and would consist of the following fields for each matching company:
- entity references the client content type
- entity references the matching company to the client
- custom blah blah blah entered by rules that indicates why the match makes sense
- contact information from the company content type
- etc., etc...
So to sum up, client A answers the questions noted above within the client content type, then based on that information, the data within the Companies content type would be filtered - and for this example - two new nodes of Partner Detail content type would be created because nodes in the Companies content type matched the fields that Client A answered in Clients content type. Company B and Company D matched the criteria so they would be entity referenced by the two new Partner Details nodes created. This way, Client A could log in and see their matches and edit the matching partner details and view information about Company B or D based on their entity referenced nodes.
I have an intermediate understanding of views, panels and rules, but can't seem to figure out how i would do this behind the scenes once a user indicates the application is finalized. I also have an understanding of how to use rules to create new nodes and entity reference them. Hoping for a step by step example as detailed as you can provide. Any help is greatly appreciated. Thanks for bearing with my long winded explanation, hopefully that makes some sense.
(Finally, I had no idea what to title this question so if anyone has a better suggestion, let me know and I'll change it.)