Package org.kie.services.client.api

Examples of org.kie.services.client.api.RemoteRuntimeEngineFactory


        KnowledgeDisposal loggersDisposal = Loggers.registerLoggersForDisposal(getModel(), getLoader(), stateful);
        return new KnowledgeSession(stateful, true, true, loggersDisposal);
    }

    private RemoteRuntimeEngineFactory buildRemoteRuntimeEngineFactory() {
        RemoteRuntimeEngineFactory factory = null;
        ClassLoader loader = getLoader();
        RemoteModel remoteModel = getModel().getManifest().getRemote();
        if (remoteModel instanceof RemoteJmsModel) {
            RemoteJmsRuntimeEngineFactoryBuilder builder = RemoteJmsRuntimeEngineFactory.newBuilder();
            InitialContext ctx = configRemoteJms(builder, (RemoteJmsModel)remoteModel, loader);
View Full Code Here


    public void startProcessAndHandleTaskViaRestRemoteJavaAPI(URL instanceUrl, String deploymentId, String user, String password) {
        // the serverRestUrl should contain a URL similar to "http://localhost:8080/jbpm-console/"
       
        // Setup the factory class with the necessarry information to communicate with the REST services
        RemoteRuntimeEngineFactory restSessionFactory
            = RemoteRuntimeEngineFactory.newRestBuilder()
            .addUrl(instanceUrl)
            .addDeploymentId(deploymentId)
            .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
View Full Code Here

                .addUserName(user)
                .addPassword(password)
                .build();
       
        // If you still want to use the factory to create multiple instances, you can always still do this:
        RemoteRuntimeEngineFactory jmsRuntimeFactory = RemoteRuntimeEngineFactory.newJmsBuilder()
                .addDeploymentId(deploymentId)
                .addJbossServerUrl(serverUrl)
                .addUserName(user)
                .addPassword(password)
                .buildFactory();
      
        engine = jmsRuntimeFactory.newRuntimeEngine();
    }
View Full Code Here

            fail(msg);
        }

        String krisUser = "kris";
        String krisPassword = "kris123@";
        RemoteRuntimeEngineFactory krisRemoteEngineFactory = runtimeEngineBuilder
                .addUserName(krisUser)
                .addPassword(krisPassword)
                .buildFactory();

        String maryUser = "mary";
        String maryPass = "mary123@";
        RemoteRuntimeEngineFactory maryRemoteEngineFactory = runtimeEngineBuilder
                .addUserName(maryUser)
                .addPassword(maryPass)
                .buildFactory();

        String johnUser = "john";
        String johnPassword = "john123@";
        RemoteRuntimeEngineFactory johnRemoteEngineFactory = runtimeEngineBuilder
                .addUserName(johnUser)
                .addPassword(johnPassword)
                .buildFactory();
       
        RemoteConfiguration maryConfig = getConfig((RemoteJmsRuntimeEngineFactory)maryRemoteEngineFactory);
View Full Code Here

       field.set(obj, val);
    }
   
    @Test
    public void missingDeploymentIdTest() throws Exception {
        RemoteRuntimeEngineFactory factory =
                RemoteRestRuntimeEngineFactory.newBuilder()
                .addUserName("user")
                .addPassword("pass")
                .addUrl(new URL("http://localhost:8080/business-central"))
                .buildFactory();
       
        RuntimeEngine runtimeEngine = factory.newRuntimeEngine();
        try {
            runtimeEngine.getTaskService().claim(23l, "user");
        } catch( RemoteCommunicationException rce ) {
            // expected
        }
       
        try {
            runtimeEngine.getAuditLogService().clear();
            fail( "This should have failed because there's no server running... ");
        } catch( RemoteCommunicationException rce ) {
            // expected
        }
       
        // This will throw a MissingRequiredInfoException because the deployment id is required here
        try {
            runtimeEngine.getKieSession().startProcess("org.test.process");
            fail( "This should have failed because no deployment id has been provided. ");
        } catch( MissingRequiredInfoException mrie ) {
            // expected
        }
      
        factory =
                RemoteJmsRuntimeEngineFactory.newBuilder()
                .addUserName("user")
                .addPassword("pass")
                .addRemoteInitialContext(remoteInitialContext)
                .addHostName("localhost")
                .addJmsConnectorPort(5446)
                .addKeystorePassword("R")
                .addKeystoreLocation("ssl/client_keystore.jks")
                .useKeystoreAsTruststore()
                .useSsl(true)
                .buildFactory();
       
        runtimeEngine = factory.newRuntimeEngine();
        try {
            runtimeEngine.getTaskService().claim(23l, "user");
            fail( "This should have failed because there's no server running... ");
        } catch( RemoteCommunicationException rce ) {
            logger.info("The " + NoSuchAlgorithmException.class.getSimpleName() + " above is expected, nothing is wrong.");
View Full Code Here

TOP

Related Classes of org.kie.services.client.api.RemoteRuntimeEngineFactory

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.