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?

xApps don’t access DU/RU directly they run on the Near-RT RIC and talk to DU/CU through the E2 interface. The Non-RT RIC sends policies/guidance down via the A1 interface, and the RIC handles conflict resolution if multiple xApps touch the same parameter (e.g., handover). So it’s indirect, standardized access, not raw DU control that’s what keeps it vendor-neutral.
Good deep-dive if you want more: O-RAN RIC: xApps