-
Notifications
You must be signed in to change notification settings - Fork 24
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
vunerability upgrade PR #917
base: master
Are you sure you want to change the base?
Conversation
opensrp-anc/build.gradle
Outdated
implementation 'org.jeasy:easy-rules-core:3.4.0' | ||
implementation 'org.jeasy:easy-rules-mvel:3.4.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bonfaceshisakha pointed out that this needs to be version 4.0.0
…ensrp-client-anc into vunerability-upgrades
- Update jackson-dataformat-yaml to 2.14.0 to fix security vulnerabilities - Update native-form to fix MVEL rules not working for some forms such as registration forms
/** | ||
* Created by Ephraim Kigamba - [email protected] on 22-11-2022. | ||
*/ | ||
public class YamlRuleDefinitionReaderExt extends YamlRuleDefinitionReader { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed and we can use the one on native form
@@ -45,4 +49,36 @@ protected Facts initializeFacts(Facts facts) { | |||
public boolean beforeEvaluate(Rule rule, Facts facts) { | |||
return selectedRuleName != null && selectedRuleName.equals(rule.getName()); | |||
} | |||
|
|||
@Override | |||
public void beforeExecute(Rule rule, Facts facts) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can possibly remove this and use what is on native form
private final YamlRuleDefinitionReaderExt yamlRuleDefinitionReader = new YamlRuleDefinitionReaderExt(); | ||
private final MVELRuleFactory mvelRuleFactory = new MVELRuleFactory(yamlRuleDefinitionReader); | ||
|
||
public AncRulesEngineHelper(Context context) { | ||
this.context = context; | ||
this.inferentialRulesEngine = new InferenceRulesEngine(); | ||
RulesEngineParameters parameters = new RulesEngineParameters().skipOnFirstAppliedRule(true); | ||
this.defaultRulesEngine = new DefaultRulesEngine(parameters); | ||
/* ((DefaultRulesEngine) this.defaultRulesEngine).registerRuleListener(new RuleListener() { | ||
@Override | ||
public void beforeExecute(Rule rule, Facts facts) { | ||
Timber.e("Putting facts in beforeExecute"); | ||
facts.put("facts", facts); | ||
} | ||
|
||
@Override | ||
public void onSuccess(Rule rule, Facts facts) { | ||
Timber.e("Putting facts in onSuccess"); | ||
facts.remove("facts"); | ||
} | ||
|
||
@Override | ||
public void onFailure(Rule rule, Facts facts, Exception exception) { | ||
Timber.e("Putting facts in onFailure"); | ||
facts.remove("facts"); | ||
} | ||
});*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can discard these changes
…showing the overview and previous contacts in the contacts sections
…showing the overview and previous contacts in the contacts sections
No description provided.