JBoss Community

Re: taskClient.complete EXCEPTION

created by gigazhang in jBPM Development - View the full discussion

My  code :

 

public void completeProgressTask(long taskId, Map<String, Object> data, String userId) throws InterruptedException {

        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();

        responseHandler.waitTillDone(5000);

        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);

                bos.close();

                bos = null;

            } catch (IOException e) {

                e.printStackTrace();

            }

        }

        taskClient.complete(taskId, userId, contentData, operationHandler);

        operationHandler.waitTillDone(5000);

    }

Reply to this message by going to Community

Start a new discussion in jBPM Development at Community