-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to get affiliatedGroups for Individual #48
Comments
This reverts commit a052426.
This reverts commit e3d5fe4.
This reverts commit 7ef69cf.
…nstead of as temp variable on individual
…ationView.js from Person and Subject Register views
This code change would require change in rules for following FormElements across multiple organisations: select o.name, form_element.name, form_element.uuid
Old Rule snippet
New Rule snippet
##Support ticket |
@himeshr added to release card - avniproject/avni-client#1021 |
… getAffiliatedGroups()
Background info
In Jss Phulwari programs, "Child enrolment" form, ..
Issue
During EnrolmentId FormElement rule execution, we fail to fetch affiliatedGroups, resulting in "Enrolment ID" not being set.
Rule snippet
Root Cause
After ReactNative upgrade, we are not able to access temp property affiliatedGroups in Individual from enrolment during ProgramEnrolment Create / edit. This is due to the fact that, individual returned for enrolment.individual is the realmDb object, which is fetched fresh from db.
Therefore the rule fails to fetch affiliatedGroups on individual of an enrolment, and therefore "Enrolment ID" generation fails.
Possible fix
We cannot convert temp property affiliatedGroups to persistent value of individual, as the individual does not get saved duing enrolment form filling. Therefore the only solution is to switch to using Enrolment to store the temp property affiliatedGroups and modify the Rules suitably. This has already been tested to work in dev environment.Final solution after pairing with Vinay
We do not like the approach of using temporary variables for storing the affiliatedGroups information. All such details should be passed to the ruleEvaluationService as part of the entityContext object.
Also, in the Subject/ Person summary view, pass the required affiliatedGroups separately from state during invocation and dont expect it to be a temp variable in Individual.
Code changes impact following scenarios, which should be verified during testing:
Post release steps
After the release, Support team would need to modify all rules that refer to "individual.affiliatedGroups" to instead use "params.entityContext.affiliatedGroups".
Old Rule snippet
New Rule snippet
##Support ticket
https://avni.freshdesk.com/a/tickets/2925
The text was updated successfully, but these errors were encountered: