Hi Ashish,
The custom attributes need to populated with appropriate data in the getter method.
Remove the logic from DO_PREPARE_OUTPUT.
In the getter method, use the logic to determine the value and pass it to the exporting parameter VALUE.
Hope it helps. Let me know if you need any more inputs.
Regards,
Sayan