From 4d48a98e622ba9e070cafb76264ba6d9971d5374 Mon Sep 17 00:00:00 2001 From: Yeser Amer Date: Wed, 17 Jul 2024 16:05:59 +0200 Subject: [PATCH] Fix ActionFieldValue clone (#5991) (#65) * [private-bamoe-issues#2091] Fix ActionFieldValue clone * Fix template test * [private-bamoe-issues#2091] Fix ActionFieldValue clone --------- Co-authored-by: Gabriele Cardosi Co-authored-by: Gabriele-Cardosi Co-authored-by: rikkola --- .../guided/dtable/backend/util/GuidedDTBRDRLPersistence.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drools-workbench-models/drools-workbench-models-guided-dtable/src/main/java/org/drools/workbench/models/guided/dtable/backend/util/GuidedDTBRDRLPersistence.java b/drools-workbench-models/drools-workbench-models-guided-dtable/src/main/java/org/drools/workbench/models/guided/dtable/backend/util/GuidedDTBRDRLPersistence.java index fbd2210618a..a3bef7bc250 100644 --- a/drools-workbench-models/drools-workbench-models-guided-dtable/src/main/java/org/drools/workbench/models/guided/dtable/backend/util/GuidedDTBRDRLPersistence.java +++ b/drools-workbench-models/drools-workbench-models-guided-dtable/src/main/java/org/drools/workbench/models/guided/dtable/backend/util/GuidedDTBRDRLPersistence.java @@ -337,13 +337,14 @@ public void visitActionCallMethod(final ActionCallMethod action) { final ActionFieldFunction afvClone = new ActionFieldFunction(); afvClone.setMethod(((ActionFieldFunction) fieldValue).getMethod()); afvClone.setField(fieldValue.getField()); - afvClone.setNature(BaseSingleFieldConstraint.TYPE_LITERAL); afvClone.setType(fieldValue.getType()); String value = fieldValue.getValue(); String templateKeyValue = rowDataProvider.getTemplateKeyValue(value); if (Objects.equals("", templateKeyValue)) { + afvClone.setNature(fieldValue.getNature()); afvClone.setValue(value); } else { + afvClone.setNature(BaseSingleFieldConstraint.TYPE_LITERAL); afvClone.setValue(templateKeyValue); }