[jboss-dev-forums] [jBPM Development] - Why complete the human task with contentdata, however the process variable is null

Krisv W do-not-reply at jboss.com
Wed May 1 11:46:54 EDT 2013


Krisv W [https://community.jboss.org/people/gang2007] created the discussion

"Why complete the human task with contentdata, however the process variable is null"

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

--------------------------------------------------------------
Hi!
I'm using the local task service with jBPM5.3 version. Question is when I complete the task with contentdata with the following code, the process variable is null. Through kcontext.getVariable("quantity"), I get null.
I'm confused about the relationship between the process variables and contentdata.

   TaskService client = LocalHumanTaskService.getTaskService(ksession);
 
    Map<String,Object> data = new HashMap<String,Object>();
    data.put("priority", request.getParameter("priority"));
    data.put("modelNumber", request.getParameter("modelNumber"));
    data.put("quantity", request.getParameter("quantity"));
 
    ContentData contentData = null;
    if (data != null) {
       ByteArrayOutputStream bos = new ByteArrayOutputStream();
       ObjectOutputStream out;
       try {
           out = new ObjectOutputStream(bos);
           out.writeObject(data);
           out.close();
           contentData = new ContentData();
           contentData.setContent(bos.toByteArray());
           contentData.setAccessType(AccessType.Inline);
        } catch (IOException e) {
           e.printStackTrace();
        }
     }
    
     client.complete(taskId, userId, contentData); 
 


Could anyone help me, please?
Any help is appreciated. Thank you!
Best Regards
--------------------------------------------------------------

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

Start a new discussion in jBPM Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2035]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20130501/e2752e02/attachment.html 


More information about the jboss-dev-forums mailing list