use of org.hisp.dhis.rules.models.RuleVariableCurrentEvent in project dhis2-android-sdk by dhis2.
the class RuleVariableValueMapBuilder method buildRuleVariableValues.
private void buildRuleVariableValues(@Nonnull Map<String, RuleVariableValue> valueMap) {
for (RuleVariable ruleVariable : ruleVariables) {
if (ruleVariable instanceof RuleVariableAttribute) {
RuleVariableAttribute ruleVariableAttribute = (RuleVariableAttribute) ruleVariable;
createAttributeVariableValue(valueMap, ruleVariableAttribute);
} else if (ruleVariable instanceof RuleVariableCurrentEvent) {
RuleVariableCurrentEvent currentEventVariable = (RuleVariableCurrentEvent) ruleVariable;
createCurrentEventVariableValue(valueMap, currentEventVariable);
} else if (ruleVariable instanceof RuleVariablePreviousEvent) {
RuleVariablePreviousEvent ruleVariablePreviousEvent = (RuleVariablePreviousEvent) ruleVariable;
createPreviousEventVariableValue(valueMap, ruleVariablePreviousEvent);
} else if (ruleVariable instanceof RuleVariableNewestEvent) {
RuleVariableNewestEvent ruleVariableNewestEvent = (RuleVariableNewestEvent) ruleVariable;
createNewestEventVariableValue(valueMap, ruleVariableNewestEvent);
} else if (ruleVariable instanceof RuleVariableNewestStageEvent) {
RuleVariableNewestStageEvent ruleVariableNewestEvent = (RuleVariableNewestStageEvent) ruleVariable;
createNewestStageEventVariableValue(valueMap, ruleVariableNewestEvent);
} else {
throw new IllegalArgumentException("Unsupported RuleVariable type: " + ruleVariable.getClass());
}
}
}
Aggregations