12 Replies Latest reply on Aug 2, 2006 3:41 PM by Ronald van Kuijk

    a fast solution

    jainer eduardo quiceno Newbie

      please, somebody could tell me, when TaskBean shows the next message: "New tasks has been assign to"??. How i do to show this message?

      any solution will be very appreciated

      thanx

      Regards
      jainer e.

        • 1. Re: a fast solution
          New Bie Newbie

          Look at the following code and you should be able to understand what is going on:

          LoggingInstance loggingInstance = processInstance.getLoggingInstance();
           List assignmentLogs = loggingInstance.getLogs(TaskAssignLog.class);
          
           log.debug("assignmentlogs: " + assignmentLogs);
          
           if (assignmentLogs.size() == 1) {
           TaskAssignLog taskAssignLog = (TaskAssignLog) assignmentLogs.get(0);
           JsfHelper.addMessage("A new task has been assigned to '" + taskAssignLog.getTaskNewActorId() + "'");
          
           } else if (assignmentLogs.size() > 1) {
           String msg = "New tasks have been assigned to: ";
           Iterator iter = assignmentLogs.iterator();
           while (iter.hasNext()) {
           TaskAssignLog taskAssignLog = (TaskAssignLog) iter.next();
           msg += taskAssignLog.getActorId();
           if (iter.hasNext())
           msg += ", ";
           }
           msg += ".";
           JsfHelper.addMessage(msg);
          }
          
           jbpmContext.save(taskInstance);
          
           return "home";
           }


          When it returns, it uses faces config xml to figure where to go (mapping for "home").

          Thanks.

          • 2. Re: a fast solution
            jainer eduardo quiceno Newbie

            Hi newbie, i knew this code (TaskBean), maybe i don't make myself to understand ... sorry. I need to know what is necessary in the process definition to show that message, that is, with respect to the assignment, how to assign???


            thank you anyway!

            Regards!
            jainer e.

            • 3. Re: a fast solution
              Ronald van Kuijk Master

              Learn JSF, jBPM, play with it, look at the source, find out things yourself, bang your had sometimes because we do not respond, look some furter and find the solution.

              • 4. Re: a fast solution
                jainer eduardo quiceno Newbie

                Hi ronald, you do not believe that it is by laziness, i understand that when a task ends, the next task is assigned to the next actor and shows the message: "A new task has been assigned to", and using code in the process definition like this one:

                <task-node name="proyecto">
                 <task name="revision proyecto" swimlane="revisor">
                 <controller>
                 <variable name="numero" access="read"></variable>
                 <variable name="fecha" access="read"></variable>
                 <variable name="aceptado-almacen" access="read"></variable>
                 <variable name="aceptado-proyecto" access="read,write,required"></variable>
                 </controller>
                 </task>
                 <transition name="enviar a contabilidad" to="contabilidad"></transition>
                 </task-node>
                


                Or Using assignments like these:
                <task name="revision proyecto">
                 <assignment actor-id="luis mantilla"/>
                
                <task name="revision proyecto">
                 <assignment class="com.factura.handler.Asigna"/>
                


                i want to know if using:
                 <assigment pooled-actors="faber aritizabal, luis mantilla"/>
                

                i can do that show the message "New tasks has been assigned to".

                Please, tell me if i'm wrong, i just need a little step to contine my work. I think that i had to have been more explicit in the past.

                Sorry!!

                jainer e.

                • 5. Re: a fast solution
                  Ronald van Kuijk Master

                  ahhh... now you are indeed more explicit. And yes, it helps to be explicit upfront. Saves a lot of time and sometimes frustration (on both sides, but you will surely find some examples on that in this forum ;-))

                  AFAIK, it is a 'bug' in the jBPM 3.1 webapp, not showing the pooled actors. The 3.1 webapp will however not be fixed/changed, since it was a kind of exercise. The 3.2 webapp will be more robust.

                  • 6. Re: a fast solution
                    jainer eduardo quiceno Newbie

                    ahhh ya entendí!!!!... then it wasn't a fast solution
                    Thank you very much, Ronald!!!!

                    • 7. Re: a fast solution
                      Scott Wyatt Newbie

                      Actually, it has nothing to do with the webapp. This is because setPooledActors in TaskInstance does not call TaskAssignLog in 3.1. What that means for the webapp in case of pooled-actors assignment is that assignmentLogs.size() = 0.

                      • 8. Re: a fast solution
                        Ronald van Kuijk Master

                        Then it is imo still (also) a bug in the webapp since it should (again imo) not use the taskAssignLog, but the taskinstance info itself. Agreed?

                        • 9. Re: a fast solution
                          falazar Novice

                          Do we have a status for this one in the current CVS build?

                          Or has a Jira issue been posted? I briefly searched through the roadmap and did not see anything mentioned.

                          James

                          • 10. Re: a fast solution
                            Ronald van Kuijk Master

                            The 3.2 webapp will report this fine if the generic solution for callback info is in place. This will take approx 2-3 weeks

                            • 11. Re: a fast solution
                              Scott Wyatt Newbie

                               

                              "kukeltje" wrote:
                              Then it is imo still (also) a bug in the webapp since it should (again imo) not use the taskAssignLog, but the taskinstance info itself. Agreed?

                              IMO, the webapp is doing the right thing. In other words, I would not fix this issue by changing the webapp. I would fix it by modifying the jBPM engine to call TaskAssignLog on setPooledActors in TaskInstance. I would also have the engine fire the task-assign event on setPooledActors in TaskInstance as well. task-assign is task-assign whether its actor-id or pooled-actors IMO.

                              • 12. Re: a fast solution
                                Ronald van Kuijk Master

                                Yes, it should indeed be fixed that the engine calls the TaskAssignLog (regardless what is used for displaying it ;-) )

                                I also agree that task-assign event should be called at the moment a task is assigned to pooled actors. But since you might want different behavior between assignment to an individual actor or to (a) pooledactor(s) it should be able to detect that.