Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 948874 Details for
Bug 1155049
Unable to get/set global variable via RemoteRuntimeEngine
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[1] rest client
rest client.java (text/plain), 1.98 KB, created by
Anton Giertli
on 2014-10-21 10:25:07 UTC
(
hide
)
Description:
[1] rest client
Filename:
MIME Type:
Creator:
Anton Giertli
Created:
2014-10-21 10:25:07 UTC
Size:
1.98 KB
patch
obsolete
>package org.redhat.gss.remotedrools; > >import java.net.MalformedURLException; >import java.net.URL; >import java.util.LinkedHashMap; > >import org.drools.core.command.runtime.GetGlobalCommand; >import org.drools.core.command.runtime.SetGlobalCommand; >import org.kie.api.runtime.KieSession; >import org.kie.api.runtime.process.ProcessInstance; >import org.kie.services.client.api.RemoteRestRuntimeEngineFactory; >import org.kie.services.client.api.command.RemoteRuntimeEngine; > >/** > * This is a very simple Rest Client to test against a running instance of the KIE Workbench. You can parameterize - the > * Deployment Unit Id - the Application URL - the user/pass to execute operations > */ >public class Main { > > public static void main(String[] args) throws MalformedURLException, InterruptedException { > > /* > * Set the parameters according your installation > */ > > String APP_URL = "http://10.34.27.134:8080/business-central/"; > > URL url = new URL(APP_URL); > String USER = "anton"; > String PASSWORD = "password1!"; > > RemoteRestRuntimeEngineFactory factory = RemoteRestRuntimeEngineFactory.newBuilder() > .addDeploymentId("org.redhat.gss:remote-test-project:3.0").addUrl(url).addUserName(USER) > .addPassword(PASSWORD).build(); > > RemoteRuntimeEngine engine = factory.newRuntimeEngine(); > > > KieSession kSession = engine.getKieSession(); > > > LinkedHashMap<String, Object> pars = new LinkedHashMap<String, Object>(); > pars.put("messaggio", "my-rest-test"); > ProcessInstance p = kSession.startProcess("testDeploy.simpleOrchestrator", pars); > > > SetGlobalCommand setGlobal = new SetGlobalCommand("response","mycustomvalue"); > GetGlobalCommand getGlobal = new GetGlobalCommand("response"); > > Thread.sleep(2000); > > String res = (String) kSession.getGlobal("response"); > System.out.println("RES: " + res); > > kSession.execute(setGlobal); > String cmdRes = (String) kSession.execute(getGlobal); > > System.out.println("cmd res:"+cmdRes); > > > kSession.abortProcessInstance(p.getId()); > System.exit(0); > > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1155049
:
948873
| 948874