JBoss Community

Re: Problem with Rest Interface in JBPM 5.2

created by Sachin Chandra in jBPM - View the full discussion

Hi ,

 

I have few questions.Which version of JBPM  are you using ? In my previous discussion I had discussed about error related to time out. I tried to investigate and found few things which I would like to put down.

My JBPM version is 5.2 and the url by which I was trying to authenticate was->         http://localhost:8080/gwt-console-server/rs/process/j_security_check

I checked the list of url available which are exposed by REST interface by using the url ->      http://localhost:8080/gwt-console-server/rs/server/resources/jbpm

The list is as given below:

 

// List of url's ----------------------------------------------------------------------------- //

Server Info

General REST server information

GET    /gwt-console-server/rs/server/status        */*    application/json

GET    /gwt-console-server/rs/server/resources/{project}        */*    text/html

 

Process Management

Process related data.

POST    /gwt-console-server/rs/process/definition/{id}/new_instance        */*    application/json

POST    /gwt-console-server/rs/process/instance/{id}/state/{next}        */*    application/json

GET    /gwt-console-server/rs/process/definition/{id}/image        */*    image/*

GET    /gwt-console-server/rs/process/instance/{id}/activeNodeInfo        */*    application/json

GET    /gwt-console-server/rs/process/definition/history/{id}/nodeInfo        */*    application/json

GET    /gwt-console-server/rs/process/definitions        */*    application/json

POST    /gwt-console-server/rs/process/definition/{id}/remove        */*    application/json

GET    /gwt-console-server/rs/process/definition/{id}/instances        */*    application/json

GET    /gwt-console-server/rs/process/instance/{id}/dataset        */*    text/xml

POST    /gwt-console-server/rs/process/instance/{id}/end/{result}        */*    application/json

POST    /gwt-console-server/rs/process/instance/{id}/delete        */*    application/json

POST    /gwt-console-server/rs/process/tokens/{id}/transition        */*    application/json

POST    /gwt-console-server/rs/process/tokens/{id}/transition/default        */*    application/json

GET    /gwt-console-server/rs/process/definition/{id}/image/{instance}        */*    image/*

 

Task Lists

Access task lists

GET    /gwt-console-server/rs/tasks/{idRef}        */*    application/json

GET    /gwt-console-server/rs/tasks/{idRef}/participation        */*    application/json

 

Task Management

Manage task instances

POST    /gwt-console-server/rs/task/{taskId}/assign/{ifRef}        */*    application/json

POST    /gwt-console-server/rs/task/{taskId}/release        */*    application/json

POST    /gwt-console-server/rs/task/{taskId}/close        */*    application/json

POST    /gwt-console-server/rs/task/{taskId}/close/{outcome}        */*    application/json

 

User management

Manage user and groups

POST    /gwt-console-server/rs/identity/sid/invalidate        */*    text/plain

GET    /gwt-console-server/rs/identity/sid        */*    text/plain

GET    /gwt-console-server/rs/identity/secure/sid        */*    text/plain

GET    /gwt-console-server/rs/identity/user/roles        */*    application/json

GET    /gwt-console-server/rs/identity/user/{actorId}/groups/        */*    application/json

GET    /gwt-console-server/rs/identity/group/{groupName}/members        */*    application/json

GET    /gwt-console-server/rs/identity/user/{actorId}/actors        */*    application/json

 

Process Engine

Process runtime state

GET    /gwt-console-server/rs/engine/deployments        */*    application/json

POST    /gwt-console-server/rs/engine/deployment/{id}/delete        */*    application/json

POST    /gwt-console-server/rs/engine/deployment/{id}/suspend        */*    application/json

GET    /gwt-console-server/rs/engine/jobs        */*    application/json

POST    /gwt-console-server/rs/engine/job/{id}/execute        */*    application/json

POST    /gwt-console-server/rs/engine/deployment/{id}/resume        */*    application/json

 

Form Processing

Web based form processing

GET    /gwt-console-server/rs/form/task/{id}/render        */*    text/html

GET    /gwt-console-server/rs/form/process/{id}/render        */*    text/html

POST    /gwt-console-server/rs/form/task/{id}/complete        multipart/form-data    text/html

POST    /gwt-console-server/rs/form/process/{id}/complete        multipart/form-data    text/html

// End of list -----------------------------------//

 

As per my understanding this list will also include the url for authentication but the  url    http://localhost:8080/gwt-console-server/rs/process/j_security_check

is not in the list given above.Correct me if I am wrong if this url is not listed in the list it is bound to give me a time out error(a url which does not exist).I saw the solution given by Jeff where he had used url some thing like

http://localhost:8080/gwt-console-server/rs/identity/secure/j_security_check".Both are different.

I did a simple thing I replaced my authentication url http://localhost:8080/gwt-console-server/rs/process/j_security_check

with the url ->    http://localhost:8080/gwt-console-server/rs/identity/secure/sid  and it did not gave any time out error ,but the response was a blank string which was the same as in case of the code which Chris showed .

My biggest query is how and from where do I confirm which is the correct url for form authentication and secondly once form authentication is successfull what should be the response string .In Chris code it was a blank string and following was the output---------------------

 

start process1:------><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>

 

authentication2:------>

 

start  process2:------>{"id":"104","definitionId":"yourProcessName","startDate":"2011-06-03  12:43:45","suspended":false,"rootToken":{"id":"1","name":"","currentNodeName":"","children":[],"availableSignals":[],"canBeSignaled":false}}

 

start  process3:------>{"id":"105","definitionId":"yourProcessName","startDate":"2011-06-03  12:43:45","suspended":false,"rootToken":{"id":"2","name":"","currentNodeName":"","children":[],"availableSignals":[],"canBeSignaled":false}}

 

start  process4:------>{"id":"106","definitionId":"yourProcessName","startDate":"2011-06-03  12:43:45","suspended":false,"rootToken":{"id":"3","name":"","currentNodeName":"","children":[],"availableSignals":[],"canBeSignaled":false}}

 

I am struggling which url is the right one and why am I not able to see it in the list of url's in JBPM 5.2. Can you please help me out .

Reply to this message by going to Community

Start a new discussion in jBPM at Community