[jboss-user] [jBPM] - Problem using REST interface

satish polasi do-not-reply at jboss.com
Mon Apr 18 03:07:14 EDT 2011


satish polasi [http://community.jboss.org/people/satishpolasi] created the discussion

"Problem using REST interface"

To view the discussion, visit: http://community.jboss.org/message/600525#600525

--------------------------------------------------------------
Hi,

I have my jbpm-console application running on one profle jbpm on 9090 port and my application running on another profile default on 8080 port. I run both the consoles on JbossEAP5.1 server.

I have created one bpmn process and deployed on to JBPM engine and I can login to jbpm-cosole application as admin/admin and start the process.

My requirement here is, I need to do the same process from my application running on 8080 port. For that i am making a call to this URL  http://localhost:9090/gwt-console-server/rs/process/definition/ http://localhost:9090/gwt-console-server/rs/process/definition/{id}/new_instance to start the process. Where {id} is the processid(InstallSR) of my bpmn process.

Here is my code


        PostMethod post = new PostMethod( http://localhost:9090/gwt-console-server/rs/process/definition/InstallSR/new_instance); http://localhost:9090/gwt-console-server/rs/process/definition/InstallSR/new_instance);
        try {
            post.addRequestHeader("Accept", "application/json");
            int result = httpClient.executeMethod(post);

            System.out.println("Response status code: " + result);
            System.out.println("Response body: ");
            System.out.println(post.getResponseBodyAsString());
        } catch (HttpException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            post.releaseConnection();
        }

When i call my above codel I see the following output as below and I don't see any thing printed on my human task servie or jbpm application server console.

Response status code: 200
Response body: 
<html>
<head>
  <title>HTTP 401</title> <!-- Do not remove -->
</head>
<body>
<form method="POST" action="j_security_check">

  <center/>
  <br><br>

  <div style="font-family:sans-serif;border:1px solid black; width:270;padding:15px;">
    <h2>BPM Console Server</h2>

    <table with=250>
    <tr>
      <td>Username:</td>
      <td><input type="text" name="j_username"></td>
    </tr>
    <tr>
      <td>Password:</td>
      <td><input type="password" name="j_password"></td>
    </tr>
    <tr>
      <td></td>
      <td align=right><input type="submit"/></td>
    </tr>
  </table>
  </div>
</form>
</body>
</html>

Can any one help me out on this, what I need to do to start a new process instance by calling rest url.
Thanks a lot in advance

Thanks,
Satish.
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/600525#600525]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110418/5728e347/attachment.html 


More information about the jboss-user mailing list