jboss-user
[Arriba] [Todas las Listas]

[jboss-Usuario] [jBPM] - Re: jbpm5 RULEFLOW la VARIABLE CAMBIÓ null

To: User development <jboss-user@xxxxxxxxxxxxxxx>
Subject: [jboss-Usuario] [jBPM] - Re: jbpm5 RULEFLOW la VARIABLE CAMBIÓ null
From: Luis Tamayo <do-not-reply@xxxxxxxxx>
Date: Tue, 06 Sep 2011 09:38:14 -0400
Auto-submitted: yes
Delivery-date: Tue, 06 Sep 2011 09:41:54 -0400
Envelope-to: traductor@xxxxxxxxxxx
In-reply-to: <2-624526-3-90030-1314986746123-2-624881-3-84481-1315267672140.jivesbs.jivemailuser@http://community.jboss.org>
List-archive: <http://lists.jboss.org/pipermail/jboss-user>
List-help: <mailto:jboss-user-request@lists.jboss.org?subject=help>
List-id: The JBoss User main mailing list <jboss-user.lists.jboss.org>
List-post: <mailto:jboss-user@lists.jboss.org>
List-subscribe: <https://lists.jboss.org/mailman/listinfo/jboss-user>, <mailto:jboss-user-request@lists.jboss.org?subject=subscribe>
List-unsubscribe: <https://lists.jboss.org/mailman/listinfo/jboss-user>, <mailto:jboss-user-request@lists.jboss.org?subject=unsubscribe>
References: <2-624526-3-90030-1314986746123.jivesbs.jivemailuser@http://community.jboss.org> <2-624526-3-90030-1314986746123-2-624880-3-90030-1315265759182.jivesbs.jivemailuser@http://community.jboss.org> <2-624526-3-90030-1314986746123-2-624881-3-84481-1315267672140.jivesbs.jivemailuser@http://community.jboss.org>
Reply-to: The JBoss User main mailing list <jboss-user@xxxxxxxxxxxxxxx>
Sender: jboss-user-bounces@xxxxxxxxxxxxxxx
Luis *Tamayo [*http://comunidad.*jboss.*org/Personas/*luis.*tamayo] Creó la discusión

"*Re: *jbpm5 *RULEFLOW la VARIABLE CAMBIÓ *null"

para ver la discusión, visita: *http://comunidad.*jboss.*org/Mensaje/625020#625020

--------------------------------------------------------------
*Thanks, cambio a *ksession.*getWorkItemManager().*registerWorkItemHandler("Notificación", nuevo *EmailWorkItemHandler()); y entonces trabajos.

Ahora estoy afrontando otro problema, necesito conseguir información de Persona en *HumanTask 2, estoy utilizando este código:

Objeto público *getTaskContentInput(*TaskSummary *taskSum)
                    #nom.Fuera.*println( "======>*Entra Un *ver *getTaskContentInput" );
                    prueba
                              #unknown{^*BlockingGetTaskResponseHandler *handlerT = nuevo *BlockingGetTaskResponseHandler();
                              cliente.*getTask(*taskSum.*getId(), *handlerT);
                              tarea de Tarea2 = *handlerT.*getTask();
                              *TaskData *taskData = Tarea2.*getTaskData();
                              *BlockingGetContentResponseHandler *handlerC = Nuevo *BlockingGetContentResponseHandler();
                              cliente.*getContent(*taskData.*getDocumentContentId(), *handlerC);
                              contenido de Contenido = *handlerC.*getContent();

                              *ByteArrayInputStream *bais = Nuevo *ByteArrayInputStream(
                                        contenido.*getContent());

                              *ObjectInputStream Es = nuevo *ObjectInputStream(*bais);
                              Objeto *obj = *null;

                              mientras ( (*obj = es.*readObject()) != *null )
                                        #Nom *obj;
                              }

                    } coge (Excepción *e)
                              #nom.*err.Impresión("había una entrada de tarea de lectura de error...");
                              *e.*printStackTrace();

                    }
                    Regreso *null;
          }


          Cadena pública *imprimirTareasConsola( )
                    #unknown{^*HumanTaskClientMina *htk = nuevo *HumanTaskClientMina();
                    Usuario *u= Usuario nuevo("operador");
                    Sistema.Fuera.*println( "======>*Operador" );
                    Lista<*TaskSummary> *t = *htk.*getAssignedTasks( *u );
                    Si( *t!= *null && *t.Medida() >0  )
                              #nom *xx= *htk.*getTaskContentInput(*t.Consigue( 0 ));

                              si(  *xx != *null )
                                        #Nom.Fuera.*println( "===> Nombre de clase *en contenido:   " + *xx.*getClass().*getName());
                                        Si( *xx *instanceof *Persona )
                                                  #nom.Fuera.*println( "==00> *Id *en tipo de contenido " + ((*Persona)*xx).*getId() );
                                        } Más si( *xx *instanceof Cadena )
                                                  #nom.Fuera.*println( "==00> tipo de nombre " + (Cadena)*xx);
                                        }
                                        Sistema.Fuera.*println( "===> *cerrando Nombre de clase *en contenido:   "  );
                              } más
                                        #nom.Fuera.*println( "==> *El Contenido *es *null "  );
                              }
          } 

                    regreso *null;
          }

Siempre el objeto regresado es Cadena,  tienes cualesquier ideas cómo pueden consigo el objeto modificado en *previus tarea.
--------------------------------------------------------------

Respuesta a este mensaje por ir a Comunidad
[*http://comunidad.*jboss.*org/Mensaje/625020#625020]

Empieza una discusión nueva en *jBPM en Comunidad
[*http://comunidad.*jboss.*org/Escoge-contenedor!Entrada.*jspa?*contentType=1&*containerType=14&contenedor=2034]

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]

_______________________________________________
*jboss-Usuario *mailing lista
*jboss-user@xxxxxxxxxxxxxxx
*https://listas.*jboss.*org/*mailman/*listinfo/*jboss-Usuario
_______________________________________________
jboss-user mailing list
jboss-user@xxxxxxxxxxxxxxx
https://lists.jboss.org/mailman/listinfo/jboss-user
<Anterior por Tema] Tema Actual [Siguiente por Tema>