9 Replies Latest reply on Apr 22, 2008 4:09 PM by jalamos

    problem using mail inside timer

    tongz

      It's mentioned in the doc that "Anywhere you are allowed to specify actions in the process, you can specify a mail action". But it seems that mail action doesn't work inside timer.

      I'm using jPDL 3.2.2. Any idea?

      Thanks.

        • 1. Re: problem using mail inside timer
          anuragpaliwal

          How did you defined mail action inside timer?

          • 2. Re: problem using mail inside timer
            tongz

            That's exactly the problem - I can't define mail in timer.

            I tried:

            <state name="resolve-issue">
             <event type="node-enter">
             <mail name="notification"
             to="user1@localhost"
             template="notification">
             </mail>
             </event>
             <timer name="timer-reminder-1" duedate="5 seconds">
             <mail name="reminder-1"
             to="user1@localhost"
             template="reminder">
             </mail>
             </timer>
             <transition to="end"></transition>
             </state>
            


            But it's not valid format - mail not allowed in timer. So in this case, I have to write an action to send email?

            Thanks.


            • 3. Re: problem using mail inside timer
              anuragpaliwal

              Thats the way I have implemented it for now in my application.

              • 4. Re: problem using mail inside timer
                kukeltje

                A mail action (jbpm has a mail action component) is different from a mail node. What you tried is embedding a mail node inside an event. That does not, nor will it work.

                • 5. Re: problem using mail inside timer
                  anuragpaliwal

                  org.jbpm.mail.Mail implements ActionHandler....

                  • 6. Re: problem using mail inside timer
                    tongz

                    Thank you all for the reply.

                    kukeltje, my understanding from the document is that "mail" is an action and "mail-node" is a node? Also, here "mail" does work fine in event, but just not valid in timer.

                    anuragpaliwal, are you saying you implemented this with "mail" or org.jbpm.mail.Mail? I suppose it's the later. The following code works fine using org.jbpm.mail.Mail:

                    <state name="resolve-issue">
                     <event type="node-enter">
                     <mail name="notification"
                     to="user1@localhost"
                     template="notification">
                     </mail>
                     </event>
                     <timer name="timer-reminder-1" duedate="5 seconds">
                     <action class="org.jbpm.mail.Mail">
                     <to>user1@localhost</to>
                     <template>actor-reminder-1</template>
                     </action>
                     </timer>
                     <transition to="end"></transition>
                     </state>


                    • 7. Re: problem using mail inside timer
                      koen.aers

                      Is the xml validation a problem or rather the execution? In the first case it is as simple as correcting the xsd (or throwing out the xsd reference for the validation not to occur). In the second case it could be a bug in the xml parsing. In both cases you can file a JIRA issue, preferably with a testcase producing the problem.

                      Regards,
                      Koen

                      • 8. Re: problem using mail inside timer
                        tongz

                        The exception I got is xml validation problem, which occurs while deploying the process definition. JIRA issue filed.

                        Regards,
                        Tong

                        • 9. Re: problem using mail inside timer
                          jalamos

                          I have the same problem because I need send one mail in a date specified like "#{Date} - 2 business days". How do that???