All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.kie.kogito.app.Application Maven / Gradle / Ivy

There is a newer version: 1.7.0.Final
Show newest version
package org.kie.kogito.app;

import org.kie.kogito.Config;
import org.kie.kogito.uow.UnitOfWorkManager;

@org.springframework.stereotype.Component()
public class Application implements org.kie.kogito.Application {

    @org.springframework.beans.factory.annotation.Autowired(required = false)
    java.util.Collection eventPublishers;

    @org.springframework.beans.factory.annotation.Value("${kogito.service.url:#{null}}")
    java.util.Optional kogitoService;

    @org.springframework.beans.factory.annotation.Autowired()
    org.kie.kogito.Config config;

    Processes processes = new Processes(this);

    public Config config() {
        return config;
    }

    public UnitOfWorkManager unitOfWorkManager() {
        return config().process().unitOfWorkManager();
    }

    @javax.annotation.PostConstruct()
    public void setup() {
        if (config().process() != null) {
            if (eventPublishers != null) {
                eventPublishers.forEach(publisher -> unitOfWorkManager().eventManager().addPublisher(publisher));
            }
            unitOfWorkManager().eventManager().setService(kogitoService.orElse(""));
            unitOfWorkManager().eventManager().setAddons(config().addons());
        }
    }

    public Processes processes() {
        return processes;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy