I am currently trying call one (or more) data transforms based on a decision table. Currently I am using a utility function i have created to call the data transform in the return actions. The data transform is executing properly, however when the data transform is finished, there is a java null pointer error when rejoining to the first data transform that executed the decision table.
Step Status Info
LegacyDecisionAspectInvokableRuleContainer.invoke-Exception Encountered a :java.lang.NullPointerException
Exception Trace
com.pega.pegarules.pub.PRRuntimeException: LegacyDecisionAspectInvokableRuleContainer.invoke-Exception Encountered a :java.lang.NullPointerException
Any way to do this OOTB or even with some custom functions?
Hi @ThomasL17158130 you could use preset properties to call either a data transform(applyModel) or activity (pxExecuteAnActivity) through a function. This will be executed first before decision table starts it execution. Based on the comparison you can call subsequent data transform in your return action.
@RusselK1 This is the function I am using to run DT, it is modified version of pzRunDataTransform that grabs the parameter page itself rather than passing it.
In Pega, you cannot directly run a Data Transform inside a Decision Table as it is meant only to return values, not to perform actions. If you try to call a Data Transform using a custom function inside a Decision Table, it may lead to errors like a null pointer exception. The best way to handle this is to return the name of the required Data Transform as a string from the Decision Table. Then, in a separate Data Transform or Activity, you can use the Apply-DataTransform method or @pxApplyDataTransform() to run the actual Data Transform. This method is safe, supported by Pega, and avoids any unexpected errors. It also keeps your rule logic clean and easy to manage
@Sairohith I ended up using this method as I was unable to call the Data Transform from the Decision table without getting a null pointer error. However I do not see pxApplyDataTransform as an option. Thank you.