Yes, You can reference this from Java code. You can refer this thread - https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/custom-workflow-publishes-page-with-selected-referenced-assets/m-p/556773 for more details. There is also a KB article which might be relevant to what you...