0
votes

I have jBPM 6.1.0.Final set up on WildFly 8.1. I am able to perform functions successfully.

Now I am trying to integrate the workflow engine into another application.

I have the following piece of code to test if it works or not

//Complete a task
        private void completeTask(String taskId) {
               restCall = url + "/rest/task/" + taskId + "/complete";

          try {
          httppost = new HttpPost(restCall);
          authorizationHeader = scheme.authenticate(credentials, httppost);
          httppost.addHeader(authorizationHeader);
          HttpParams params = new BasicHttpParams();
          params.setParameter("map_vLobHeadComments", "Approved");
          httppost.setParams(params);
          response = httpclient.execute(httppost);

          if (response != null) {
              System.out.println("Task complete Response status line: "+ response.getStatusLine());
               if (response.getStatusLine() != null) {
                   System.out.println("Task complete Response status code: "+ response.getStatusLine().getStatusCode());
               }
          }
          } catch (ClientProtocolException ex) {
               ex.printStackTrace();
          } catch (Exception ex) {
               ex.printStackTrace();
          } finally {
               closeHttpClient();
          }
          }

Unfortunately the parameters are not getting passed to the jBPM engine. Please help me

Thanks

2
Please help!!! still have he same issueVVS

2 Answers

0
votes

Trying to do the rest calls yourself does not seem like a reliable way to accomplish this. You may want to look at the Remoting API. I have not used the Remoting API yet, but I think this is the route you will want to take.

0
votes

Replace these lines :

 HttpParams params = new BasicHttpParams();
 params.setParameter("map_vLobHeadComments", "Approved");
 httppost.setParams(params);

with these :

URIBuilder uri = new URIBuilder(httpPostCall.getURI());
uri.addParameter("map_vLobHeadComments", "Approved");
((HttpRequestBase) httppost ).setURI(uri.build());

This is applicable to all the POST calls to JBPM REST API.