can you put the peice of code which you are using for commiting the changes in java action here.
Here is the code of executeAction method in Java action
@java.lang.Override
public java.lang.Void executeAction() throws Exception
{
this.issueToChange = this.__issueToChange == null ? null : issue.proxies.Issue.initialize(getContext(), __issueToChange);
// BEGIN USER CODE
final boolean isSomethingBoolean = issueToChange.getSomethingBoolean();
issueToChange.setSomethingBoolean(!isSomethingBoolean);
issueToChange.commit(getContext());
//issueToChange.commit();
return null;
// END USER CODE
}
There's an undocumented method MendixObject.updateSystemAttributes(IContext)
It is the only method that updates the system attributes and it is only called from the microflow action "Change object". The most legal way to achieve the desired result is to call a microflow from your java code and in that microflow to change the object. However, you would have to create a microflow for each object type you want to change from java.
The not so legal way is to create your own implementation of updateSystemAttributes
in your java code and set the system members by their name:
obj.getMember(iContext, "changedDate")).setValue .. . new Date
obj.getMember(iContext, "System.changedBy")).setValue ... context.getSession().getUserId()
You can call obj.isChanged
to check whether you want to update the system members.
The least legal way is to get access to the method updateSystemAttributes
with obj.getClass().getMethod
because the method is public.