-
1. Re: Start a process remotely by using Java
eaa Sep 2, 2011 9:49 AM (in response to pierx83)If your processes are deployed in jbpm-gwt-console, then you can use its REST API to interacto with them.
-
2. Re: Start a process remotely by using Java
pierx83 Sep 2, 2011 9:51 AM (in response to eaa)I supposed to use something like the TaskClient I use to manage the task. Is there such a thing?
Thanks,
Pierpaolo
-
3. Re: Start a process remotely by using Java
eaa Sep 2, 2011 9:53 AM (in response to pierx83)Are you using jbpm-gwt-console to deploy/run your processes?
-
4. Re: Start a process remotely by using Java
pierx83 Sep 2, 2011 10:05 AM (in response to eaa)Actually I'm using the jbpm-gwt-console so I have the REST interface as you suggested me before.
Therefore, my goal is to develop a different GUI for the task management (task list, start task and so on) so probably I will put the jbpm jars inside the project I'm developing but in this case:
- I don't need the RESt interface (but of course it is not available without the jpm-gwt-console)
- I cannot use the advantages of jbpm-gtw-console and guvnor integration
What do you suggested me? To use the gwt console or not?
Thanks,
Pierpaolo
-
5. Re: Start a process remotely by using Java
pierx83 Sep 2, 2011 10:44 AM (in response to pierx83)Anyway, I'm trying using the REST interface to start a process but I have a problem cause the answer I get is the html source of the login form
How can I sove this?
The code I use is:
URL url = new URL("http://localhost:8080/gwt-console-server/rs/process/definition/HelloHT/new_instance");
HttpURLConnection conn =
(HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setDoOutput(true);
conn.setDoInput(true);
conn.setUseCaches(false);
conn.setAllowUserInteraction(false);
conn.setRequestProperty("Content-Type",
"application/x-www-form-urlencoded");
if (conn.getResponseCode() != 200) {
throw new IOException(conn.getResponseMessage());
}
// Buffer the result into a string
BufferedReader rd = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
StringBuilder sb = new StringBuilder();
String line;
while ((line = rd.readLine()) != null) {
sb.append(line);
}
rd.close();
System.out.println(sb.toString());
-
6. Re: Start a process remotely by using Java
npereira Sep 3, 2011 12:26 PM (in response to pierx83)Hi Pierpaolo,
There was a similar discussion in the forum just this week.
You can follow the following link, http://community.jboss.org/thread/166755
I hope it helps.
Regards
-
7. Re: Start a process remotely by using Java
pierx83 Sep 5, 2011 10:33 AM (in response to npereira)Thanks for your reply!
Yes, I found that link and it helped me. it works now but actually I'm facing a new problem: how to fire an event remotely? The REST interface doen't allow me do that...
Do you have an idea?
Thanks,
Pierpaolo