[jboss-user] [jBPM] - Re: jbpm5 RULEFLOW VARIABLE CHANGED null

Luis Tamayo do-not-reply at jboss.com
Tue Sep 6 09:38:14 EDT 2011


Luis Tamayo [http://community.jboss.org/people/luis.tamayo] created the discussion

"Re: jbpm5 RULEFLOW VARIABLE CHANGED null"

To view the discussion, visit: http://community.jboss.org/message/625020#625020

--------------------------------------------------------------
Thanks, I change to ksession.getWorkItemManager().registerWorkItemHandler("Notification", new EmailWorkItemHandler()); and then works.

Now I am facing another problem, I need to get information of Person in HumanTask 2, I am using this code:

public Object getTaskContentInput(TaskSummary taskSum) {
                    System.out.println( "======>Entra a ver getTaskContentInput" );
                    try {
                              BlockingGetTaskResponseHandler handlerT = new BlockingGetTaskResponseHandler();
                              client.getTask(taskSum.getId(), handlerT);
                              Task task2 = handlerT.getTask();
                              TaskData taskData = task2.getTaskData();
                              BlockingGetContentResponseHandler handlerC = new BlockingGetContentResponseHandler();
                              client.getContent(taskData.getDocumentContentId(), handlerC);
                              Content content = handlerC.getContent();

                              ByteArrayInputStream bais = new ByteArrayInputStream(
                                        content.getContent());

                              ObjectInputStream is = new ObjectInputStream(bais);
                              Object obj = null;

                              while ( (obj = is.readObject()) != null ) {
                                        return obj;
                              }

                    } catch (Exception e) {
                              System.err.print("There was an error reading task input...");
                              e.printStackTrace();

                    }
                    return null;
          }


          public String imprimirTareasConsola( ){
                    HumanTaskClientMina htk = new HumanTaskClientMina();
                    User u= new User("operator");
                    System.out.println( "======>Operador" );
                    List<TaskSummary> t = htk.getAssignedTasks( u );
                    if( t!= null && t.size() >0  ){
                              Object xx= htk.getTaskContentInput(t.get( 0 ));

                              if(  xx != null ){
                                        System.out.println( "===> Class name en content:   " + xx.getClass().getName());
                                        if( xx instanceof Persona ){
                                                  System.out.println( "==00> Id en content type " + ((Persona)xx).getId() );
                                        } else if( xx instanceof String ){
                                                  System.out.println( "==00> name type " + (String)xx);
                                        }
                                        System.out.println( "===> cerrando Class name en content:   "  );
                              } else {
                                        System.out.println( "==> El content es null "  );
                              }
          } 

                    return null;
          }

Always the object returned is String, do you have any ideas how can I get the object modified in previus task.
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[http://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/20110906/40309602/attachment.html 


More information about the jboss-user mailing list