4 Replies Latest reply on May 12, 2011 2:07 AM by Prageeth Jayasinghe

    Pass parameters to user task from java class

    Prageeth Jayasinghe Newbie

      Hi all;

            I am using 'Apache mina' library and I need to pass parameters(variables) to the user task. I am using JBPM 5.1.

      I searched previous posts and found following code. In this code I am using a ContentData object. But I don't know what should I do in my bpmn file.

      How do I map this ContentData object with the variables in bpmn file. Pls help.

       

            TaskClient client =
              new TaskClient(new MinaTaskClientConnector(taskOwner,
                                                         new MinaTaskClientHandler(
                                                           SystemEventListenerFactory.getSystemEventListener())));
            .......................
            .......................
            .......................
            .......................      
      
            ContentData cData = null;
            Map<String, Object> map = new HashMap<String, Object>();
            map.put("mobileNo", "123456");
            if (map != null) {
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            ObjectOutputStream out;
            out = new ObjectOutputStream(bos);
            out.writeObject(map);
            out.close();
            cData = new ContentData();
            cData.setContent(bos.toByteArray());
            cData.setAccessType(AccessType.Inline);
            client.complete(taskId, taskOwner, cData, responseHandler);