Call a CUBA Schedule Task from UI


I created several CUBA Schedule Tasks and I would like to know if these one can be called from a UI component (for example a button).

=> If possible, what is the procedure to follow ?

My Objective is to avoid to duplicate my Java Program in both Middleware and WEB Ui interface.

In advance thank you,

Kind regards,


I found a solution maybe not the smartest one but works fine :slight_smile:

  public void onBeanClick() {
        List<ScheduledTask> stask = dataManager.load(ScheduledTask.class)
                .query("select t from sys$ScheduledTask t where t.methodName = 'launchexportBatch'")
        for (ScheduledTask obj: stask) {
            String a = obj.getBeanName();

        ScheduledTask exe = stask.get(0);

When you need to have a logic that is available from the UI - you need to write a middleware service.

Take a look to guide and documentation:

1 Like

Thank you :slight_smile:

I am OK right now !