I want to write a generic parameterized when rule which should accept the parameters from Data Transfrom and check whether the date is in valid format or not. if the Date is not in valid format then it should not set the date field(Generally if the date field is blank pega will take the default date as 01011970).
Can you please let me know how can this be achieved?
You can use a WHEN rule when there is an OOTB function to validate if the string value contains a date/time in correct format.
I could not find one; not sure if such function really exists.
In my opinion, you can create a custom function to take string param that holds the date/time value and validate that with a code similar to the following (I grabbed it from one of the OOTB rule), and use that in your data transform.