2 Replies Latest reply on May 14, 2011 8:19 AM by npereira

    JBPM5 Task completion through API

    npereira Newbie

      Hi forum,


      I have an piece of java code that is completing the Tasks through the API.


      But I have facing an issue, the ideia is that on completion of a task I complete it with a new set of parameteres.

      For that matter I have to put the HashMap into the Content Object, and only then, complete the task.


      Here is the problem, whenever I do this, either being throuh client.SetDocumentContent or client.complete, this new data never gets persisted to the following activity.


      This is my code,


      //Creates a new Content to Fit in the Task

      HashMap newMap = new HashMap();

      newMap.put("TFirst", 1234);

      newMap.put("TSecond", "blabla");


      Object newObj = (Object)newMap;


      ByteArrayOutputStream bos = new ByteArrayOutputStream();

      ObjectOutputStream oos = new ObjectOutputStream(bos);






      byte[] newByteContent = bos.toByteArray ();

      Content neWContent = new Content();



      //Sets content on Task

      client.setDocumentContent(task.getId(), neWContent, sresponseHandler);


      //Completes the task               

      BlockingTaskOperationResponseHandler qweresponseHandler = new BlockingTaskOperationResponseHandler();

      ContentData cd = new ContentData();


      client.complete(task.getId(), userID, cd, qweresponseHandler);


      Am I missing something?


      Best regards,