Cannot run a data transform from a different class in a data table
Situation (see also attachements):
I have a data transform (called: Btw21Berekenen) rule under my work class.
In my work class I have a section whit a table layout in it which shows a page list from my data class
I want to call the data transform whenever a certain field in my table changes (screenshot 1). I've set up an action set with 'change' event which runs a data transform. Since the page context of my table layout is my data class, i've added my work class in Pages & Classes (called WorkPage) of my section and within the action set I've specified this page (see screenshot 2) to call the data transform. The data transform is visible within the action set and I can save my section without any error.
But once I run the section and I change the value of the field I get an error to contact the system administrator. In the tracer I see the following java error (see screenshot 3):
Failed to find a 'RULE-OBJ-MODEL' with the name 'BTW21BEREKENEN' that applies to '@baseclass'. There were 1 rules with this name in the rulebase, but none matched this request. The 1 rules named 'BTW21BEREKENEN' defined in the rulebase are:
1 related to applies-to class '@baseclass', but were defined on subclasses: 'TAXON-Cons-Declareren-Work-MedewerkerDeclaratie'.
What is causing this issue? It seems that in the runtime Pega searches for the data transform in the baseclass instead of the specified WorkClass (WorkPage). Is this a bug?
Even I encountered this error when I was trying to call a data transform(which belongs to work class) when the context is in data class. I think its a pega bug that context is lost at run time and is trying to search in baseclass(where the rule is not present).
I have tried to set the context by calling the Apply Data transform from an activity. You can also try the same to overcome this error.
Thanks. I created an activity and used method 'Apply Data transform' and called my data transform from the activity. When I look in the trace I can see that the data transform is triggered. In my clipboard page I also see the calculated value is correct, however, on the UI the field is empty??
Please see the attachment. The UI field is the same field as you can see in the clipboard page.