DEVCON 2026    |    2-5 November 2026 – QEII Centre – London, UK    |    Register now! 

Blogs

Custom Object Action Executor

Vinoth Kumar
Vinoth Kumar
Lectura de menos de un minuto

We can trigger our custom action while performing operations in Objects by implementing ObjectActionExecutor interface.


Step 1: Create a class anywhere or create a module with service template.
Below code for reference:
@Component
        (
        immediate = true, 
        service = ObjectActionExecutor.class
        )
public class CustomActionExecutor implements ObjectActionExecutor {
    
    @Override
    public void execute(long companyId, UnicodeProperties parametersUnicodeProperties, JSONObject payloadJSONObject,
            long userId) throws Exception {
        logger.info("UnicodeProperties: " + parametersUnicodeProperties);
        logger.info("Payload json: " + payloadJSONObject);
    }

    @Override
    public String getKey() {
        return "myCustomObjectAction";
    }

private static final Log logger = LogFactoryUtil.getLog(CustomActionExecutor.class);
}

Step 2: Now Go to Control Panel > Objects > Any object > Actions > New Action > Action Builder as shown below, Select your action name (myCustomObjectAction in my case).


 

Step 3: Now you can perform POST/GET or read/write operations on the Object as you will get all the entries in payloadJSONObject. Now, you can perform an action using the payloadJSON object as you will get the entry in it.


Basically, Objects is a dynamic entity and a new feature which is available in both EE and CE since Liferay 7.4.

Comentarios de la página

Related Assets...

No se encontraron resultados

More Blog Entries...

David H Nebinger
septiembre 28, 2026
David H Nebinger
septiembre 25, 2026
David H Nebinger
septiembre 23, 2026