[jboss-user] [jBPM] - Re: CommandBasedWSHumanTaskHandler null: java.io.OptionalDataException

Ouadi BEL do-not-reply at jboss.com
Thu Mar 28 12:16:00 EDT 2013


Ouadi BEL [https://community.jboss.org/people/ouadi_dev] created the discussion

"Re: CommandBasedWSHumanTaskHandler  null: java.io.OptionalDataException"

To view the discussion, visit: https://community.jboss.org/message/805338#805338

--------------------------------------------------------------
I've find the solution of this probelm.

In order to solve this problem, we need to use this version of task complete method:


    BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
 
    Map<String, Object> taskVariables = new HashMap<String, Object>();
    taskVariables.put(new String("o_validationResult"),Boolean.valueOf(true));
 
    ContentData contentData = null;
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    ObjectOutputStream out;
    try {
      out = new ObjectOutputStream(bos);
      out.writeObject(taskVariables);
      out.close();
      contentData = new ContentData();
      contentData.setContent(bos.toByteArray());
      contentData.setAccessType(AccessType.Inline);
    } catch (IOException ioe) {
                 ioe.printStackTrace();
    }
 
    client.complete(aTaskId, aOwnerId, contentData, responseHandler);
 


With this code the task completion with a map of variables must done successfully.
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://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/20130328/6f10264f/attachment.html 


More information about the jboss-user mailing list