I have below table structure:
User(UserID, Name, Address, Phone, CustomFieldValue)
Group(GroupID, GroupName, ApplyGroupRuleString)
UserGroup(UserID, GroupID)
Example of data:
User(210111, 'Mohit', 'Delhi', '99999999', '(Email=mohit@gmail.com)(Designation:Software Engineer)(CurrentLocation=Delhi)')
- Here CustomFieldValue field contains the list of key/value pairs.
Group(10001, 'Delhi User', '//User[(Address=Delhi) and (CurrentLocation=Delhi)]')
- Here ApplyGroupRuleString means that this group should be assigned to those users whose Address is 'Delhi' and also whose CurrentLocation is 'Delhi'. However important thing here is that CurrentLocation key is part of field CustomFieldValue. We have requirement that the Key/Value pair will be decided at run time.
Expected Result from above data : UserGroup(210111,10001)
So can someone please help me to find out a solution so that I can match the Users against Group's ApplyGroupRuleString and assign the group to user accordingly.
Thanks for help in advance.