1 2 Previous Next 27 Replies Latest reply on Mar 18, 2009 12:53 PM by toriton Go to original post
      • 15. Re: Need help to fix timer issue

        gchanteb as you requested I have the code

         public void assign(Assignable assignable, ExecutionContext executionContext)
         throws Exception {
         // TODO Auto-generated method stub
         System.out.println("escalation mail to customer");
         assignable.setActorId("arunkumar at mycompany.com");
         }
        

        -Arunkumar

        • 16. Re: Need help to fix timer issue
          littlejc

          Maybe you can try to deploy/check your process and related action/assignment handler files.
          Because ther is an exception in your post:
          Caused by no action handler definition, so jBPM can't invoke it correctly.

          • 17. Re: Need help to fix timer issue

            Even if I try to have the ActionHandler it throws the same exception.
            Is it a issue with the jbpm3.2.3 version

            • 18. Re: Need help to fix timer issue
              toriton

              Solved my problem and understood what was by this thread :)
              http://www.jboss.org/index.html?module=bb&op=viewtopic&t=129225
              So i used a script to leave a node not a state.


              This is the part of my process, i'll need to send a mail instead to use the node specified. I will start now to see how mail nodes work :).

              <state name="stateA">
               <timer duedate="5 seconds" name="MailSender" transition="to testMail">
               </timer>
               <transition to="questionnaire_decision" name="to_questionnaire_decision"></transition>
               <transition to="testMail" name="to testMail"></transition>
               </state>
              
               <node name="testMail">
               <script>
               executionContext.setVariable("pippo","pippo");
               executionContext.leaveNode();
               </script>
               <transition to="stateA" name="backtoStateA"> </transition>
               </node>
              


              In the node i set a variable in the JBPM context, and from JBPM console i remove the variable and it is back after the 5 sec timer.







              • 19. Re: Need help to fix timer issue

                Thanks for the info Toriton
                I also have same kind of requirement. When timer executes on a state node I want it to move to a node where I can send mail.
                If you find any solution plz let me know
                Thanks in advance

                • 20. Re: Need help to fix timer issue

                  Do you have some thing like the one below which works?

                  <state name="tsmactoncr" async="true">
                  <event type="node-leave">
                  <cancel-timer name="timer"></cancel-timer>
                  </event>
                  <timer duedate="7 seconds" name="timer" transition="to escalated">
                  <script>
                  System.out.println("Arunkumar---::"+node.getName());
                  </script>
                  </timer>
                  <transition to="normailflow" name="to normal flow"></transition>
                  <transition to="escalationflow" name="to escalated"></transition>
                  </state>
                  <task-node name="escalationflow">
                  <task name="mail">
                  <assignment class="yourpackage.MailAssignmentHandler"></assignment>
                  </task>
                  <transition to="end-state1"></transition>
                  </task-node>
                  

                  thanks



                  • 21. Re: Need help to fix timer issue

                    Thanks for the code gchanteb.
                    When I integrated the code with my application there are no exceptions thrown but the SOP we have in assignment handler is not prinitng and mail is not send.
                    Do you have any idea what is wrong? Am I missing some configuration. But If I dont have a timer and signal manually it works fine.
                    Thanks.

                    • 22. Re: Need help to fix timer issue
                      kukeltje

                      guys (right?)

                      If you make full unittests, I'm often willing to help out and test something, but make sure then to always embed the processdefinition in the classs as well ass the actionhandlers/assignmenthandlers as inner classses. And start jobexecutors etc...

                      • 23. Re: Need help to fix timer issue

                        My timer works fine, I am able to see the Log in the node-entered event getting printed on the task-node but the assignment handler attached to that task-node is not executed since I am not seeing the Log from that handler class from where I am setting the actorId to send mail.
                        When I looked at JBPM_TASKINSTANCE table the ACTORID_ is null.Is there any work around to fix this issue.
                        Thanks
                        Arunkumar

                        • 24. Re: Need help to fix timer issue

                          Even I tried having mail node instead of task-node to send mail. I am able to see the log in the node-entered event but the mail is not sent.

                          • 25. Re: Need help to fix timer issue
                            toriton

                            Done !! ^_^

                            Timer every 30 sec send the mail to my account.

                            this is the definition:

                            <state name="stateA">
                            
                             <timer duedate="30 seconds" name="MailSender" transition="to mailTest"></timer>
                            
                             <transition to="mailTest" name="to mailTest"></transition>
                             </state>
                            
                            
                            <mail-node name="mailTest" to="pluto@pippo.com">
                             <subject>
                             pippo
                             </subject>
                             <text>
                             TEST
                             </text>
                             <transition to="stateA" name="tostateA"></transition>
                             </mail-node>
                            
                            
                            




                            And on the jbpm.cfg.xml i just specified:

                             <string name="jbpm.mail.smtp.host" value="smtp.server.com" />
                             <string name="jbpm.mail.from.address" value="pluto@paperino.it" />
                            



                            All work fine.



                            • 26. Re: Need help to fix timer issue
                              toriton

                              just because is anyway in time on mail-node there is a way to configure a node like this:

                              <mail-node name="mailTest" to="${mail-advise}">

                              where "mail-advise" is a variable in JBPM context, and JBPM will evaluate the variable automatically?

                              considering the example posted before,
                              stateA set a variable named "mail-advise" in the context that have as value an e-mail address, and when timer will go to send mail, the mail-node will get the "to" parameter directly from context. without any code like jbpmCTX.getVariable("mail-advise").

                              is this possible?


                              • 27. Re: Need help to fix timer issue
                                toriton

                                .... sorry for triple post.. anyway found it using expression...

                                #{variablename}

                                You can configure a mail node :

                                <mail-node name="mailTest" to="#{mailadvise}">
                                




                                NOTE: don't use "-" char in the name -_-' , i'm noob and i know :).

                                1 2 Previous Next