Add-on project in Version 1.4.3

When I created a new add-on project I found the following code in the addon.configuration file in addition to what was created an another add-on project using version 1.4.2:

> @Bean("sf_SfUiActions")
public ActionsConfiguration actions(ApplicationContext applicationContext,
                                    AnnotationScanMetadataReaderFactory metadataReaderFactory) {
    ActionsConfiguration actionsConfiguration =
            new ActionsConfiguration(applicationContext, metadataReaderFactory);
    actionsConfiguration.setBasePackages(Collections.singletonList("com.inteacc.sf"));
    return actionsConfiguration;
}

Can someone please explain what is the use of this and should I copy the code to my existing add-on projects?

Hello!

This bean scans provided packages in order to find custom actions that have ActionType annotation (e.g. CreateAction) . Then it register these actions in Actions factory. After that you can create custom action from your add-on like:

@Autowired
private Actions actions;

@Subscribe
public void onInit(InitEvent event) {
    MyCustomAction myAction = actions.create(MyCustomAction.class);
}

And also can be used from XML descriptor. If your add-on contains custom actions you should add this bean to configuration. Otherwise it is not necessary to add this bean, but you should remember to add it if you add actions in the future.

Thanks for clarifying. I hope the user guide will have some examples in future.