10 Replies Latest reply on Dec 13, 2008 3:03 PM by Ronald van Kuijk

    how do I use reminders ?

    Shantanu Upadhyaya Newbie

      I'm trying to get reminder emails to work. Here's my process definition :

      <swimlane name="SL_2">
       <assignment pooled-actors="pA2" />
       </swimlane>
      
       <task-node name="aTaskNode" end-tasks="true">
       <event type="node-enter">
       <mail name="mailIt" to="someone@somecompany.com" template="someTemplate" />
       </event>
       <task name="approvalTask" description="Description" swimlane="SL_2" notify="yes">
       <reminder duedate="2 business days" repeat="10 seconds"/>
       </task>
       <transition name="tran1" to="to1"/>
       <transition name="tran2" to="to2"/>
       </task-node>
      


      My email sending works when node-enter event occurs. What I want to know is :

      1. When I add notify="yes", I assume the pooled actors (pA2) are notified. If so, how to I specify their email ids ? Do I need an address resolver ?

      2. If 1 is true, I guess also uses pA2 email ids . Is that true ?

      3. If I use inplace of , when the due date is passed, can I transition my task back to the pooled state by specifying a transition ?

      4. Can I use reminder and timer together ?

      I've been exposed to JBPM in just few days. Implementing more functionality by reading http://docs.jboss.org/jbpm/v3/userguide/mail.html is tough. According to me, the docs are disconnected and don't offer the complete picture. But JBPM rocks !



        • 1. Re: how do I use reminders ?
          Shantanu Upadhyaya Newbie

          Still can't get this to work !
          I'd like to notify a group of users ( pooled actors ) that a task is created. I can achieve this by sending mail to a group.

          Then one actor acquires a lock on a task. This task needs a due date and the actor should be sent reminders. That's it. Has someone implemented this ? Is there any doc that spells this out clearly.

          • 2. Re: how do I use reminders ?
            Ronald van Kuijk Master

            1: Sending mail to pooled actors is not supported (has been discussed in the forum I even think) You might file a jira issue for this if there is none already
            2: N/A
            3: No, but you can create an actionhandler that is executed that reassigns the task afaik. But not sure if the timer goes off again... (unless it is on repeat)
            4: yes

            • 3. Re: how do I use reminders ?
              Shantanu Upadhyaya Newbie

              I have workaround for notifying pooled actors. In fact, the node-enter event is doing that for me.

              5. If I remove notify, does the reminder work ?
              6. 'Who' is the reminder reminding ? Is it using the swimlane from the parent tag (task) ?
              7. Does 6 mean that I should not use swimlane at all because of 1.

              I introduced swimlane only to emulate the examples. Earlier I just had pooled actors, and one user would start to work on a task. I just want to remind that user.

              • 4. Re: how do I use reminders ?
                Ronald van Kuijk Master

                5: notify and reminder are two different things. Notify is 'there is a task for you', reminders are 'You still have a task'
                6: I think it is the actor and if that is deduced from the swimlane... it is that user. If you want to be sure, create a unittest.
                7: depends on your solution, but yes it might be the case.

                Question from my side:
                Why are you trying to work around things? You seem like a knowledgable person, so why not make a patch for jBPM that does what you want. That part of the source is not that difficult to understand.


                • 5. Re: how do I use reminders ?
                  Shantanu Upadhyaya Newbie

                  I'm writing the test class now. Couldn't keep myself from asking you this :

                  "6: I think it is the actor and if that is deduced from the swimlane... it is that user...."

                  From what I see working in my code :
                  8. 'pooledTaskInstanceList' will pick up pooled tasks.
                  Task 'approvalTask' but with NO user id attached.

                  9. taskInstanceListForType['approvalTask'] will pick up tasks assigned to current/LOGGED in actor.
                  Task 'approvalTask' + user id attached.

                  10. Going by logic in 8 and 9, and the fact that reminder is for one user id :

                  This definition :

                  <task name="approvalTask" description="Description" swimlane="SL_2">
                   <reminder duedate="2 business days" repeat="10 seconds"/>
                  </task>
                  

                  should remind one user.

                  Am I understanding correctly ? If so, where do I specify the email id for THAT one user ?
                  10a) Do I need to specify that in JBPM identity - I started using that yesterday.
                  OR
                  10b) Do I need to use a custom address resolver ?

                  Either way, is you could tell me a little more ( with whatever attributes I'm missing ),
                  that would help.

                  I'm keep checking JBPM tables for possible clues.

                  I've removed the node-enter and notify in my xml cos the eclipse debug is getting confusing - I don't know what was causing
                  some parts of the code to execute.

                  I can only work on a patch if I know what is supported/not supported. I'd love to make enhancements
                  and contribute back...right now I'm in a time pressure situation....another lame excuse.

                  Appreciate your help. Thanks.

                  Sorry about the long messages.


                  • 6. Re: how do I use reminders ?
                    Ronald van Kuijk Master

                     

                    should remind one user.

                    That is what I meant with user... and not pooled actor


                    Am I understanding correctly ? If so, where do I specify the email id for THAT one user ?
                    10a) Do I need to specify that in JBPM identity - I started using that yesterday.
                    OR
                    10b) Do I need to use a custom address resolver ?


                    Either is possible. Whatever you choose. Most of the time the build in jBPM identity is not wanted because there already is an identity management system. A custom adresresolver is often sufficient then if assignments are not done via expresseions but directly as strings or via assignmenthandlers

                    If there is something I hate it is lame excuses ;-)... but you know... in the end it always turns out to be less complicated to do it right initially ;-)


                    • 7. Re: how do I use reminders ?
                      Shantanu Upadhyaya Newbie

                      Custom address resolver is not working.

                      I have this in my jbpm.cfg.xml .

                      <bean name="jbpm.mail.address.resolver" class="com.comcast.epc.jbpm.EpcMailAddressRolver" singleton="true" />

                      resolveAddress() is not getting invoked.

                      Btw, I have an EAR deployment on JBoss. My resolver is in the WAR. My guess is that the reminder is just not getting fired. The task is acquired by a user. I checked JBPM_TASKINSTANCE, ACTORID_ is assigned.

                      Any ideas ??




                      • 8. Re: how do I use reminders ?
                        Ronald van Kuijk Master

                        Are you sure your config is used and not the default jbpm config? Turn on debugging to see. Might also be as you state that there is no access to it (classpath) so the default is used.... something for you to use. custom resolvers work for me

                        • 9. Re: how do I use reminders ?
                          Shantanu Upadhyaya Newbie

                          Not possible.

                          My JBPM config has the mail server, from.address, template definition, etc. If this was not in the classpath, email shouldn't even work.

                          • 10. Re: how do I use reminders ?
                            Ronald van Kuijk Master

                            With access to it, I meant the custom resolver. Is that on the classpath?