[jboss-user] [jBPM] - Re: How to set a process variable from java code ?

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

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

"Re: How to set a process variable from java code ?"

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

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);
      contentData = new ContentData();
    } catch (IOException ioe) {
    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

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130328/34110290/attachment.html 

More information about the jboss-user mailing list