Package org.kie.services.client.api.command

Examples of org.kie.services.client.api.command.RemoteRuntimeEngine


            throw new RemoteCommunicationException("Unable to create " + InitialContext.class.getSimpleName(), e);
        }
    }
   
    public RemoteRuntimeEngine newRuntimeEngine() {
      return new RemoteRuntimeEngine(config);
    }
View Full Code Here


    }
  
    @Override
    public RemoteRuntimeEngine build() {
        checkAndFinalizeConfig();
        return new RemoteRuntimeEngine(config.clone());
    }
View Full Code Here

    RemoteRestRuntimeEngineFactory(RemoteConfiguration config) {
        this.config = config;
    }
 
    public RemoteRuntimeEngine newRuntimeEngine() {
      return new RemoteRuntimeEngine(config);
    }
View Full Code Here

     * @see org.kie.services.client.api.builder.RemoteRuntimeEngineFactoryBuilder#buildRuntimeEngine()
     */
    @Override
    public RemoteRuntimeEngine build() {
       checkAndFinalizeConfig();
       return new RemoteRuntimeEngine(config.clone());
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    public KnowledgeSession newStatelessSession() {
        RemoteRuntimeEngine remoteRuntimeEngine = _remoteRuntimeEngineFactory.newRuntimeEngine();
        StatelessKieSession stateless = new KnowledgeRemoteStatelessKieSession(remoteRuntimeEngine);
        KnowledgeDisposal loggersDisposal = Loggers.registerLoggersForDisposal(getModel(), getLoader(), stateless);
        return new KnowledgeSession(stateless, true, loggersDisposal);
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    public KnowledgeSession newStatefulSession(Map<String, Object> environmentOverrides) {
        RemoteRuntimeEngine remoteRuntimeEngine = _remoteRuntimeEngineFactory.newRuntimeEngine();
        KieSession stateful = remoteRuntimeEngine.getKieSession();
        KnowledgeDisposal loggersDisposal = Loggers.registerLoggersForDisposal(getModel(), getLoader(), stateful);
        return new KnowledgeSession(stateful, true, false, loggersDisposal);
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    public KnowledgeSession getPersistentSession(Map<String, Object> environmentOverrides, Integer sessionId) {
        RemoteRuntimeEngine remoteRuntimeEngine = _remoteRuntimeEngineFactory.newRuntimeEngine();
        KieSession stateful = remoteRuntimeEngine.getKieSession();
        KnowledgeDisposal loggersDisposal = Loggers.registerLoggersForDisposal(getModel(), getLoader(), stateful);
        return new KnowledgeSession(stateful, true, true, loggersDisposal);
    }
View Full Code Here

            .addUserName(user)
            .addPassword(password)
            .buildFactory();

        // Create KieSession and TaskService instances and use them
        RemoteRuntimeEngine engine = restSessionFactory.newRuntimeEngine();
        KieSession ksession = engine.getKieSession();
        TaskService taskService = engine.getTaskService();

        // Each opertion on a KieSession, TaskService or AuditLogService (client) instance
        // sends a request for the operation to the server side and waits for the response
        // If something goes wrong on the server side, the client will throw an exception.
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("paramName", new MyType("name", 23));
        ProcessInstance processInstance
            = ksession.startProcess("com.burns.reactor.maintenance.cycle", params);
        long procId = processInstance.getId();

        String taskUserId = user;
        taskService = engine.getTaskService();
        List<TaskSummary> tasks = taskService.getTasksAssignedAsPotentialOwner(user, "en-UK");

        long taskId = -1;
        for (TaskSummary task : tasks) {
            if (task.getProcessInstanceId() == procId) {
View Full Code Here

public class DocumentationRestExamples {

    public void javaRemoteApiRestExample(String deploymentId, URL baseUrl, String user, String password) {
        // Configure the RuntimeEngine instance with the necessarry information to communicate with the REST services, and build it
        RemoteRuntimeEngine engine = RemoteRuntimeEngineFactory.newRestBuilder()
                .addDeploymentId(deploymentId)
                .addUrl(baseUrl)
                .addUserName(user)
                .addPassword(password)
                .build();

        // Create KieSession and TaskService instances and use them
        KieSession ksession = engine.getKieSession();
        TaskService taskService = engine.getTaskService();

        // Each opertion on a KieSession, TaskService or AuditLogService (client) instance
        // sends a request for the operation to the server side and waits for the response
        // If something goes wrong on the server side, the client will throw an exception.
        ProcessInstance processInstance
            = ksession.startProcess("com.burns.reactor.maintenance.cycle");
        long procId = processInstance.getId();

        String taskUserId = user;
        taskService = engine.getTaskService();
        List<TaskSummary> tasks = taskService.getTasksAssignedAsPotentialOwner(user, "en-UK");

        long taskId = -1;
        for (TaskSummary task : tasks) {
            if (task.getProcessInstanceId() == procId) {
View Full Code Here

     // Create runtime engine
     *  RuntimeEngine engine = remoteJmsFactory.newRuntimeEngine();
     */
    public void createJmsRuntimeEngine(String deploymentId, URL serverUrl, String user, String password) {
        // Now we just do this:
        RemoteRuntimeEngine engine = RemoteRuntimeEngineFactory.newJmsBuilder()
                .addDeploymentId(deploymentId)
                .addJbossServerUrl(serverUrl)
                .addUserName(user)
                .addPassword(password)
                .build();
View Full Code Here

TOP

Related Classes of org.kie.services.client.api.command.RemoteRuntimeEngine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.