/** * Create a new {@link RemoteRestRuntimeEngineBuilder} instance * to configure and buid a remote API client {@link RuntimeEngine} instance. * @return A {@link RemoteRestRuntimeEngineBuilder} instance */ public static RemoteRestRuntimeEngineBuilder newRestBuilder() { return org.kie.services.client.api.RemoteRuntimeEngineFactory.newRestBuilder(); }
/** * Create a new {@link RemoteJmsRuntimeEngineBuilder} instance * to configure and buid a remote API client {@link RuntimeEngine} instance. * @return A {@link RemoteJmsRuntimeEngineBuilder} instance */ public static RemoteJmsRuntimeEngineBuilder newJmsBuilder() { return org.kie.services.client.api.RemoteRuntimeEngineFactory.newJmsBuilder(); }
private void checkAndFinalizeConfig() { RemoteRuntimeEngineFactory.checkAndFinalizeConfig(config, this); }
private RemoteConfiguration buildRemoteConfiguration(RemoteModel remoteModel) { RuntimeEngine engine = null; if (remoteModel instanceof RemoteJmsModel) { RemoteJmsRuntimeEngineBuilder builder = RemoteRuntimeEngineFactory.newJmsBuilder(); InitialContext ctx = configRemoteJms(builder, (RemoteJmsModel)remoteModel); try { engine = builder.build(); } finally { if (ctx != null) { try { ctx.close(); } catch (Exception e) { e.getMessage(); // ignore but keep checkstyle happy } } } } else if (remoteModel instanceof RemoteRestModel) { RemoteRestRuntimeEngineBuilder builder = RemoteRuntimeEngineFactory.newRestBuilder(); configRemoteRest(builder, (RemoteRestModel)remoteModel); engine = builder.build(); } RemoteConfiguration config = null; if (engine instanceof RemoteRuntimeEngine) { Access<RemoteConfiguration> configAccess = new FieldAccess<RemoteConfiguration>(RemoteRuntimeEngine.class, "config"); config = configAccess.isReadable() ? configAccess.read(engine) : null; } return config; }
RemoteRuntimeEngine engine = restSessionFactory.newRuntimeEngine(); KieSession ksession = engine.getKieSession(); TaskService taskService = engine.getTaskService();
/** * Create a new {@link RemoteWebserviceClientBuilder} instance * to configure and buid a remote client for the {@link CommandWebService}. * @return A {@link RemoteWebserviceClientBuilder} instance */ public static RemoteWebserviceClientBuilder<RemoteWebserviceClientBuilder, CommandWebService> newCommandWebServiceClientBuilder() { return org.kie.services.client.api.RemoteRuntimeEngineFactory.newCommandWebServiceClientBuilder(); }
jmsBuilder.remoteInitialContext = getRemoteJbossInitialContext(jmsBuilder.jbossServerHostName, config.getUserName(), config.getPassword());
private RemoteConfiguration buildRemoteConfiguration(RemoteModel remoteModel) { RuntimeEngine engine = null; if (remoteModel instanceof RemoteJmsModel) { RemoteJmsRuntimeEngineBuilder builder = RemoteRuntimeEngineFactory.newJmsBuilder(); InitialContext ctx = configRemoteJms(builder, (RemoteJmsModel)remoteModel); try { engine = builder.build(); } finally { if (ctx != null) { try { ctx.close(); } catch (Exception e) { e.getMessage(); // ignore but keep checkstyle happy } } } } else if (remoteModel instanceof RemoteRestModel) { RemoteRestRuntimeEngineBuilder builder = RemoteRuntimeEngineFactory.newRestBuilder(); configRemoteRest(builder, (RemoteRestModel)remoteModel); engine = builder.build(); } RemoteConfiguration config = null; if (engine instanceof RemoteRuntimeEngine) { Access<RemoteConfiguration> configAccess = new FieldAccess<RemoteConfiguration>(RemoteRuntimeEngine.class, "config"); config = configAccess.isReadable() ? configAccess.read(engine) : null; } return config; }
RemoteRuntimeEngine engine = restSessionFactory.newRuntimeEngine(); KieSession ksession = engine.getKieSession(); TaskService taskService = engine.getTaskService();
/** * @see {@link RemoteRuntimeEngineFactory#newRestBuilder()} */ @Deprecated public static RemoteRestRuntimeEngineBuilder newBuilder() { return RemoteRuntimeEngineFactory.newRestBuilder(); }
/** * @see {@link RemoteRuntimeEngineFactory#newJmsBuilder()} */ @Deprecated public static RemoteJmsRuntimeEngineBuilder newBuilder() { return RemoteRuntimeEngineFactory.newJmsBuilder(); }
protected void checkAndFinalizeConfig() { RemoteRuntimeEngineFactory.checkAndFinalizeConfig(config, this); }
.build(); RemoteRuntimeEngine runtimeEngine = factory.newRuntimeEngine(); try { runtimeEngine.getTaskService().claim(23l, "user"); .build(); runtimeEngine = factory.newRuntimeEngine(); try { runtimeEngine.getTaskService().claim(23l, "user");
protected KieSession initKieSession() throws CoreException { RuntimeEngine restSessionFactory; try { restSessionFactory = RemoteRuntimeEngineFactory.newRestBuilder() .addDeploymentId(bpmConfig.getDeploymentId()) .addUrl(new URL(bpmConfig.getBpmInstanceUrl())) .addUserName(bpmConfig.getUsername()) .addPassword(bpmConfig.getPassword()) .addTimeout(AUTHENTICATION_TIMEOUT_S) .build(); } catch (Exception e) { throw new CoreException("Could not initialize connection to BPM server at '" + bpmConfig.getBpmInstanceUrl() + "' check that the URL is correct.", e); } return restSessionFactory.getKieSession(); }
String taskUserId = userId; RuntimeEngine engine = RemoteRuntimeEngineFactory.newJmsBuilder() .addDeploymentId(deploymentId) .addJbossServerHostName("localhost")
private void checkAndFinalizeConfig() { RemoteRuntimeEngineFactory.checkAndFinalizeConfig(config, this); }
@Test public void notAceptedMethodTest() throws Exception { URL deploymentUrl = new URL( "http://localhost:8080/kie-wb/" ); RemoteRestRuntimeEngineFactory restSessionFactory = RemoteRuntimeEngineFactory.newRestBuilder() .addDeploymentId("deployment") .addUrl(deploymentUrl) .addUserName("mary") .addPassword("pass") .buildFactory(); WorkItemHandler wih = new DoNothingWorkItemHandler(); try { restSessionFactory.newRuntimeEngine().getKieSession().getWorkItemManager().registerWorkItemHandler("test", wih); fail( "The above call should have failed."); } catch( UnsupportedOperationException uoe ) { assertTrue("Incorrect error message: " + uoe.getMessage(), uoe.getMessage().contains("not supported on the Remote Client instance.")); } }
String taskUserId = userId; RuntimeEngine engine = RemoteRuntimeEngineFactory.newRestBuilder() .addDeploymentId(deploymentId) .addUrl(deploymentUrl)