// This file was generated by Mendix Modeler. // // WARNING: Only the following code will be retained when actions are regenerated: // - the import list // - the code between BEGIN USER CODE and END USER CODE // - the code between BEGIN EXTRA CODE and END EXTRA CODE // Other code you write will be lost the next time you deploy the project. // Special characters, e.g., é, ö, à, etc. are supported in comments. package communitycommons.actions; import com.mendix.systemwideinterfaces.core.IMendixObject; import communitycommons.ORM; import com.mendix.systemwideinterfaces.core.IContext; import com.mendix.webui.CustomJavaAction; /** * Releases a lock. * If force is true, the object will be released, even if the current user is not the owner of the lock. * The result of this action has no meaning. * * Force mode should be avoided, but can be used to clear old locks. * * Every lock should be released when it is no longer required. * * Note that items should be released when exceptions occur in your microflows! * * Locks will be released automatically if another session request a lock on the same object, and the session is not active anymore. */ public class releaseLock extends CustomJavaAction<java.lang.Boolean> { private IMendixObject item; private java.lang.Boolean force; public releaseLock(IContext context, IMendixObject item, java.lang.Boolean force) { super(context); this.item = item; this.force = force; } @Override public java.lang.Boolean executeAction() throws Exception { // BEGIN USER CODE return ORM.releaseLock(this.getContext(), item, force); // END USER CODE } /** * Returns a string representation of this action */ @Override public java.lang.String toString() { return "releaseLock"; } // BEGIN EXTRA CODE // END EXTRA CODE }