JAVA get value from entity

0
Hi all, Can everyone help me to tell about java. If i have entity name, I want to get value by using attribute name and I don't want to send object to the method. Eg. 1) I have the page and it bind with customer model. 2) Create button to call microflow. 3) Create customer object and set some value to it in microflow. 4) I want to get the value in java without send the object to the method in Custom Java. public void executeAction(){ String entityName = "MyModule.Customer"; String attributeName = "FirstName"; getValue(entityName, attributeName); } Additional detail: Due to I need to convert all related models to JSON Object(String) and get the value as field, so I just send only root object. Eg. I will send customer object only. Customer { firstName: "XXXXX", TelObj : { detail: "0857383", type: "Mobile" }, Address: { detail: "xxxxxx" } } thank you very much for your help.
asked
3 answers
0

Surachart, please simply edit/update your original question when providing additional details.

Based on your update, it sounds like you're trying to write a JSON serializer. There's no need to do that, as the REST Services module in the app store already supports JSON serialization. You can follow the steps here, except just use the "Serialize JSON" java action at the end instead of exposing a web service:

https://www.mendix.com/blog/rest-part-ii-publishing-microflows-rest/

answered
0

Hi, this is not the answer but it's just my idea,

Why don't Mendix provide get all values in microflow when I use java compute node? I would like to get other values in microflow by java but I don't want to send many input parameters. If you can make this behavior on your platform, it will be flexibility in the future.

Thank you, sorry for someone.

answered
-1

Hi Bart Tolen,
Additional detail: Due to I need to convert all related models to JSON Object(String) and get the value as field,
so I just send only root object.
Eg.
I will send customer object only.
Customer {
firstName: "XXXXX",
TelObj : {
detail: "0857383",
type: "Mobile"
},
Address: {
detail: "xxxxxx"
}

}
Thanks

answered