@@ -193,7 +193,7 @@ internal class RuleConditionEvaluator {
193193 supplementaryData : Map <String , List <String >>,
194194 ): RuleEffect {
195195 if (ruleAction.type == " ASSIGN" ) {
196- val data = process( ruleAction.data , valueMap, supplementaryData, ExpressionMode . RULE_ENGINE_ACTION )
196+ val data = processRuleAction(rule, ruleAction, valueMap, supplementaryData)
197197 updateValueMap(ruleAction.field()!! , RuleVariableValue (RuleValueType .TEXT , data, listOf (), null ), valueMap)
198198 return if (data.isNullOrEmpty()) {
199199 RuleEffect (rule.uid, ruleAction, null )
@@ -203,11 +203,11 @@ internal class RuleConditionEvaluator {
203203 }
204204 val data =
205205 if (! ruleAction.data.isNullOrEmpty()) {
206- process(
207- ruleAction.data,
206+ processRuleAction(
207+ rule,
208+ ruleAction,
208209 valueMap,
209210 supplementaryData,
210- ExpressionMode .RULE_ENGINE_ACTION ,
211211 )
212212 } else {
213213 " "
@@ -219,6 +219,27 @@ internal class RuleConditionEvaluator {
219219 )
220220 }
221221
222+ private fun processRuleAction (
223+ rule : Rule ,
224+ ruleAction : RuleAction ,
225+ valueMap : MutableMap <String , RuleVariableValue >,
226+ supplementaryData : Map <String , List <String >>,
227+ ): String? {
228+ val data = process(
229+ ruleAction.data,
230+ valueMap,
231+ supplementaryData,
232+ ExpressionMode .RULE_ENGINE_ACTION ,
233+ )
234+ log.fine(
235+ " Action " + ruleAction.type +
236+ " from rule " + rule.name + " with id " + rule.uid +
237+ " with expression (" + ruleAction.data + " )" +
238+ " was evaluated " + data
239+ )
240+ return data
241+ }
242+
222243 companion object {
223244 private val log = createLogger(" org.hisp.dhis.rules.engine.RuleConditionEvaluator" )
224245 }
0 commit comments