deploy the created java action to eclipse, when run locally, the java code is overwritten

when calling the java action in microflow, deploy the created java action to eclipse, and then modify the java code. when run locally, the java code is overwritten. The overwritten code is as follows @java.lang.Override public IMendixObject executeAction() throws Exception { this.MoveNotificationList = java.util.Optional.ofNullable(this.__MoveNotificationList) .orElse(java.util.Collections.emptyList()) .stream() .map(__MoveNotificationListElement -> reservationmanager.proxies.MoveNotification.initialize(getContext(), __MoveNotificationListElement)) .collect(; // BEGIN USER CODE throw new com.mendix.systemwideinterfaces.MendixRuntimeException("Java action was not implemented"); // END USER CODE } Please tell me how to set not to be overwritten. Thanks.
2 answers

When you have imported the model in Eclipse and you commit your Java in Eclipse it should just work. You could double check it if after the commit in Eclipse you open up your model directory and check the code in the javasource directory (find the module open the sub dir and open the actions dir and the the action you have changed in a text editor. It should be the same as in Eclipse. You could also check the changed date status of the file. If it is not changed you did something weird in Eclipse and you need to make sure that you imported the Mendix model in the correct way.





You need to put your changes between the blocks marked BEGIN USER CODE and END USER CODE. If you change anything outside these blocks (with the exception of import statements) then your code will be overwritten next time you build your application. 

In your example, I can see you are making changes outside these blocks, so Mendix would overwrite these when you run the application locally.

Hope this helps.