RAN Optimization xApp: How does it work with O-RAN?

What challenges and use cases are associated with designing an optimization xApp for O-RAN?

As far as I am concerned, xApp should have access to both DU and RU. Suppose xApp imposes the policy on RIC and RIC applies to DU. xApp must therefore be able to read and access DU activities? What is the workflow?