use of org.hisp.dhis.rules.models.RuleAction in project dhis2-core by dhis2.
the class ShowErrorWarningImplementerTest method getRuleEffects.
private List<RuleEffect> getRuleEffects() {
RuleAction actionShowWarning = RuleActionShowWarning.create(IssueType.WARNING.name() + CONTENT, DATA, "", UNKNOWN);
RuleAction actionShowWarningOnComplete = RuleActionWarningOnCompletion.create(IssueType.WARNING.name() + CONTENT, DATA, "", UNKNOWN);
RuleAction actionShowError = RuleActionShowError.create(IssueType.ERROR.name() + CONTENT, DATA, "", UNKNOWN);
RuleAction actionShowErrorOnCompletion = RuleActionErrorOnCompletion.create(IssueType.ERROR.name() + CONTENT, DATA, "", UNKNOWN);
return Lists.newArrayList(RuleEffect.create("", actionShowWarning, EVALUATED_DATA), RuleEffect.create("", actionShowWarningOnComplete, EVALUATED_DATA), RuleEffect.create("", actionShowError, EVALUATED_DATA), RuleEffect.create("", actionShowErrorOnCompletion, EVALUATED_DATA));
}
use of org.hisp.dhis.rules.models.RuleAction in project dhis2-core by dhis2.
the class ShowErrorWarningImplementerTest method getRuleEffectsLinkedToDataAnotherElement.
private List<RuleEffect> getRuleEffectsLinkedToDataAnotherElement() {
RuleAction actionShowWarning = RuleActionShowWarning.create(IssueType.WARNING.name() + CONTENT, DATA, ANOTHER_DATA_ELEMENT_ID, DATA_ELEMENT);
RuleAction actionShowWarningOnComplete = RuleActionWarningOnCompletion.create(IssueType.WARNING.name() + CONTENT, DATA, ANOTHER_DATA_ELEMENT_ID, DATA_ELEMENT);
RuleAction actionShowError = RuleActionShowError.create(IssueType.ERROR.name() + CONTENT, DATA, ANOTHER_DATA_ELEMENT_ID, DATA_ELEMENT);
RuleAction actionShowErrorOnCompletion = RuleActionErrorOnCompletion.create(IssueType.ERROR.name() + CONTENT, DATA, ANOTHER_DATA_ELEMENT_ID, DATA_ELEMENT);
return Lists.newArrayList(RuleEffect.create("", actionShowWarning, EVALUATED_DATA), RuleEffect.create("", actionShowWarningOnComplete, EVALUATED_DATA), RuleEffect.create("", actionShowError, EVALUATED_DATA), RuleEffect.create("", actionShowErrorOnCompletion, EVALUATED_DATA));
}
use of org.hisp.dhis.rules.models.RuleAction in project dhis2-core by dhis2.
the class SetMandatoryFieldValidatorTest method getRuleEffects.
private List<RuleEffect> getRuleEffects() {
RuleAction ruleActionSetMandatoryDataValue = RuleActionSetMandatoryField.create(DATA_ELEMENT_ID, DATA_ELEMENT);
RuleAction ruleActionSetMandatoryAttribute = RuleActionSetMandatoryField.create(ATTRIBUTE_ID, TRACKED_ENTITY_ATTRIBUTE);
return Lists.newArrayList(RuleEffect.create("RULE_ATTRIBUTE", ruleActionSetMandatoryAttribute), RuleEffect.create("RULE_DATA_VALUE", ruleActionSetMandatoryDataValue));
}
Aggregations