5 Replies Latest reply on May 17, 2011 6:26 AM by $Nith$

    Find Next Task ID

    chalukya Level 2

      Hi All,

       

      Here is a case:

       

      I have to notify a user througt email when his/her request is rejected by XYZ.

      I cannot use the email notification from adminui as the email content requires lots of data from process variables.

       

      So I am using EmailService to send a notification email when his/her request is rejected by XYZ and then assigning the task to him/her, to view from workspace.

       

      Now the email content should have a link which takes him/her to the rejected form.

      Link: http://[servername]:[port]/workspace/Main.html?taskId={here is the problem}

       

      How can I get the task ID before assigning the task to him/her ?

       

      Is there any way to do this?

       

      I tried doing this --

      select (max(id+1)) from tb_task;

      But its not consistent.

       

      Please Suggest.

       

      Regards--

      Chalukya.

        • 1. Re: Find Next Task ID
          $Nith$ Level 4

          @@taskid@@ will replace the Current Task Id assigned to a user. But please note that this will work only when you use this notation within custom email template.

           

           

          The simplest solution for your requirement is here:

           

          No need to send email through seperate Email Service. You can use the task notification facility so that when a task is assigned to a user, an email will be sent automatically from the server. You can leave the default email content which will have a link to the assigned task.

           

          Hope that helps..

           

          Nith

          1 person found this helpful
          • 2. Re: Find Next Task ID
            chalukya Level 2

            Hi Nith,

             

            Thank u for your reply.

             

            But my requirement is when a task is assigned to a user/initiator, I have to send an Email-Notification to all the group members.( sry did not mention in my earlier post)

            So this was the reason I was using seperate Email Service.

             

            Any Suggestions.

             

            Regards--

            Chalukya.

            • 3. Re: Find Next Task ID
              $Nith$ Level 4

              Okay, for this requirement, you can capture the TaskCreated event in another process which inturn delivers the email.

               

              The event details (Source Data Set) will holds the TaskId which can be used in the email template.

               

              Hope that help..

               

              Nith

              1 person found this helpful
              • 4. Re: Find Next Task ID
                chalukya Level 2

                Hi Nith,

                 

                Thanks for your reply.

                 

                As suggested I am using TaskCreated event, but unable to capture the TaskID value.

                 

                I am doing this assignment in TaskCreated Event properties:

                /MapContent/TaskID = /process_data/@task_id

                 

                Anything else i have to do?

                 

                Please Help

                 

                Regards--

                Chalukya.

                • 5. Re: Find Next Task ID
                  $Nith$ Level 4

                  The task_id variable should be of INPUT type. Just make sure that..

                   

                  Nith