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

org.kie.services.client.api.command.RemoteRuntimeEngine Maven / Gradle / Ivy

There is a newer version: 6.1.0.Final
Show newest version
package org.kie.services.client.api.command;

import org.drools.core.command.CommandService;
import org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession;
import org.jbpm.services.task.impl.command.CommandBasedTaskService;
import org.kie.api.runtime.CommandExecutor;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.manager.RuntimeEngine;
import org.kie.api.task.TaskService;

public class RemoteRuntimeEngine implements RuntimeEngine {

    private final RemoteConfiguration config;

    public RemoteRuntimeEngine(RemoteConfiguration configuration) {
        this.config = configuration;
    }

    public KieSession getKieSession() {
        CommandService commandService = new RemoteSessionCommandService(config);
        return new CommandBasedStatefulKnowledgeSession(commandService);
    }

    public TaskService getTaskService() {
        CommandExecutor executor = new RemoteTaskCommandExecutor(config);
        return new CommandBasedTaskService(executor);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy