[jboss-user] [jBPM] - I want use variable in my process, but it not work

kklg do-not-reply at jboss.com
Thu Mar 21 00:39:03 EDT 2013


kklg [https://community.jboss.org/people/kklg] created the discussion

"I want use variable in my process,but it not work"

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

--------------------------------------------------------------
hi !


 *when i put variable in map(data), my variableinstancelog table is nothing,*

    public void completeTask(long taskId, Map<?, ?> data, String userId, Map<String, Object> results )
            throws InterruptedException {
        connect();

        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
        client.start(taskId, userId, responseHandler);
        responseHandler.waitTillDone(2000);


        responseHandler = new BlockingTaskOperationResponseHandler();
        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, responseHandler);

       }


*but  i add this code  ,*

 *when i put variable in map(+results+) ,it work,*


+        BlockingGetTaskResponseHandler responseHandlerGetTask = new BlockingGetTaskResponseHandler();+
+        client.getTask(taskId, responseHandlerGetTask);+
+        responseHandlerGetTask.waitTillDone(1000);+
+        Task task = responseHandlerGetTask.getTask();+
+        ksession.getWorkItemManager().completeWorkItem(+
+                task.getTaskData().getWorkItemId(), *results*);+


*I  I do not understand, I see other people are like  first code. I used jBPM5.4.  Thanks  For any help in adcance.*
*
*
*
*

*
*


h4.
--------------------------------------------------------------

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

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/20130321/8686e6fe/attachment.html 


More information about the jboss-user mailing list