<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Problem using REST interface
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/satishpolasi">satish polasi</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/600525#600525">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hi,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>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.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>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.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span>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 </span><a class="jive-link-external-small" href="http://localhost:9090/gwt-console-server/rs/process/definition/" target="_blank">http://localhost:9090/gwt-console-server/rs/process/definition/</a><span>{id}/new_instance to start the process. Where {id} is the processid(InstallSR) of my bpmn process.</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Here is my code</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span>        PostMethod post = new PostMethod(</span><a class="jive-link-external-small" href="http://localhost:9090/gwt-console-server/rs/process/definition/InstallSR/new_instance);" target="_blank">http://localhost:9090/gwt-console-server/rs/process/definition/InstallSR/new_instance);</a></p><p>        try {</p><p>            post.addRequestHeader("Accept", "application/json");</p><p>            int result = httpClient.executeMethod(post);</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>            System.out.println("Response status code: " + result);</p><p>            System.out.println("Response body: ");</p><p>            System.out.println(post.getResponseBodyAsString());</p><p>        } catch (HttpException e) {</p><p>            e.printStackTrace();</p><p>        } catch (IOException e) {</p><p>            e.printStackTrace();</p><p>        } finally {</p><p>            post.releaseConnection();</p><p>        }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>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.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Response status code: 200</p><p>Response body: </p><p><html></p><p><head></p><p>  <title>HTTP 401</title> <!-- Do not remove --></p><p></head></p><p><body></p><p><form method="POST" action="j_security_check"></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>  <center/></p><p>  <br><br></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>  <div style="font-family:sans-serif;border:1px solid black; width:270;padding:15px;"></p><p>    <h2>BPM Console Server</h2></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    <table with=250></p><p>    <tr></p><p>      <td>Username:</td></p><p>      <td><input type="text" name="j_username"></td></p><p>    </tr></p><p>    <tr></p><p>      <td>Password:</td></p><p>      <td><input type="password" name="j_password"></td></p><p>    </tr></p><p>    <tr></p><p>      <td></td></p><p>      <td align=right><input type="submit"/></td></p><p>    </tr></p><p>  </table></p><p>  </div></p><p></form></p><p></body></p><p></html></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Can any one help me out on this, what I need to do to start a new process instance by calling rest url.</p><p>Thanks a lot in advance</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Thanks,</p><p>Satish.</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/600525#600525">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>