kklg
2013-03-21 04:39:03 UTC
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]
"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]