Retrieve object over association before committing

0
I’m working on a use case where I need to retrieve an associated object within a Java action. The object in question is created in a microflow, and the Java action is called later in the same flow. However, I’m facing an issue where the Java action cannot retrieve the associated object unless I pass it directly as a parameter. Even committing the object in the microflow before calling the Java action hasn't resolved the problem. Question: Is there a specific reason why the committed object isn't accessible in the Java action?
asked
2 answers
0

Hi Sanyogita,

Java action indeed can retrieve the associated object created in same microflow without any issue

below is my domain model and java action I am retrieving Single_Or_Multiple_Quesion entity from Questios entity which is created in same microflow , module name is fillablePDF

 

image.png

singleSelectOptions = Core.retrieveByPath(getContext(), question.getMendixObject(), fillablepdf.proxies.Single_Or_MultiSelect_Question.MemberNames.Single_Or_MultiSelect_Question_Questions.toString());

 

Hope it helps!

answered
0

3 questions

  1. Are source and object to be retrieved created before executing the microflow?
    1. Associated object must be created
  2. Is the association between the object set?
    1. If association isn't set and thus empty, objects might exist, but retrieve over association will fail 
  3. Is the java action executed in the same transaction?
    1. Database retrieve will return nothing as the commit transaction isn't finished yet.
  4. Is the java action executed in the same session?
    1. By association retrieve won't be able to access the questioned session data

 

answered