1 2 Previous Next 18 Replies Latest reply on Sep 6, 2011 9:44 AM by Demian Calcaprina Go to original post
      • 15. Re: jbpm5 RULEFLOW VARIABLE CHANGED null
        Esteban Aliverti Master

        If you have fixed the original problem, please mark this post as ANSWERED.

        If you have new problems please start a new Discussion.

        • 16. Re: jbpm5 RULEFLOW VARIABLE CHANGED null
          Mauricio Salatino Master

          Yeah.. Demian nail it:

          you should change this line to make it work

          ksession.getWorkItemManager().registerWorkItemHandler("Email", new EmailWorkItemHandler());

          To match with your process definition

          <task id="_7" name="envio email" tns:taskName="Email" >

           

          Cheers

          • 17. Re: jbpm5 RULEFLOW VARIABLE CHANGED null
            Luis Tamayo Newbie

            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.

            • 18. Re: jbpm5 RULEFLOW VARIABLE CHANGED null
              Demian Calcaprina Master

              As Esteban suggested, could you please put this question as anwered and open a new one? Then it is easier for other people to find solutions to problems.

              1 2 Previous Next