Forum Stats

  • 3,874,081 Users
  • 2,266,674 Discussions
  • 7,911,721 Comments

Discussions

Procedures and Email Notifications

676859
676859 Member Posts: 35
boldEN*bold*
Hi everyone!!

In my BPM development, i'm trying to automatize the email notifications, based on due process periods. Also, I need to inform, based on the delay, some other participants that escalates the alarm message.
Is it possible to do it using an "E-Mail Notification" component that can be reused during all the process, even that the interval conditions and informed users varies upon each activity.
Is there another way to solve it?


Thanks

boldSP:*bold*
Saludos a todos!

En mi desarrollo BPM requiero automatizar el proceso de envio de email, al caducar ciertas actividades. Basado en ello, el tiempo de caducidad varia de acuerdo a cada actividad y al usuario, ya que varian tanto los intervalos de aviso, como los correos y su escalamiento en caso de demoras mayores a lo solicitado.
Pienso que es posible tomar un procedimiento especializado que permita ser reutilizado en este y otros proyectos, a pesar de que requiera parametrizar tanto los usuarios "base" y "escalados", como los intervalos de alarmas, durante el proceso.

¿ Existe otra forma de realizarlo?
Gracias,

Best Answer

  • Dan Atwood
    Dan Atwood Member Posts: 2,313 Gold Trophy
    edited Aug 13, 2009 6:41PM Answer ✓
    I think I understand what you're after. I think you want to use the same escalation logic for all of your processes and instead of embedding this in every process you want something reusable. If this is not the case, read no further.

    While you can do this, there are still going to be 5 things each process would still need to have inside of them:
    <li> your process would need to set the "deadline" predefined variable to the intial timeout (2 hours in the future in your example)
    <li> your process would need an Exeption Handler needs to be added with an Exception transition set to "Instance Expiration"
    <li> your process would need an Integer instance variable "alertLevel" to keep track of the current level
    <li> your process would need a String instance variable "currentlyAssignedTo" to keep track of who's supervisor you want to notify
    <li> your process would need an Automatic activity with one line of logic inside it.

    You could have the Exception transition leaving the Exception Handler activity go to a subprocess using a Subflow activity. This subprocess would send the emails, determine the new deadline interval, determine the new priority of the instance, look up the currently assigned user, manager and supervisor's email addresses and send the email(s). The subflow would have two input argument variables (alertLevelArg and currentlyAssignedToArg). In the Begin activity, these arguments would be mapped to corresponding instance variables. Inside this subprocess there would be an automatic with the logic to send the email to the user / manager / supervisor based on the alertLevel instance variable. This subprocess would pass back out through its output argument variables the new alertLevelArg, and new deadline (a time argument variable set to some time in the future based on the new alert's level).

    Once the instance in the called subprocess completes, the output arguments need to be mapped to the original process's "alertLevel" and "deadline" variable. From the Subflow activity, you'd have an unconditional activity that flows into an Automatic activity via an unconditional transition. This automatic activity would have the single line of logic "action = BACK" so the instance is sent back from the Exception Hanldler's flow back to the activity inside the process it was in when the Instance Expiration exception occurred.

    Avoid hard coding the values of "2" and "5" and "8" for the number of hours to have elapse inside your logic. Instead make them business parameters capable of being edited by an business owner.

    Dan

Answers

  • Dan Atwood
    Dan Atwood Member Posts: 2,313 Gold Trophy
    edited Aug 12, 2009 6:03PM
    Hi,

    Yes - you're correct.

    There is a standard component you can use to send emails if you set the Engine's SMTP property and use the "send()" method in the Catalog's Fuego.Net.Mail object.

    Suspect you know this, but there are a couple out of the box ways you might want this logic invoked.

    The first is to have a Due transition coming out of an activity. If the work item instance sits in the activity for the time interval specified in the Due transition, then the work item instance automatically flows to the activity at the end of the Due transition. Inside this activity's logic you would invoke your Mail.send() method. From this activity, it's up to you where it goes. You sometimes want it to go back to the originating activity or sent to a Supervisor's role with an activity that expedites the work item instance.

    The second is to set the "deadline" predefined variable (typically in the Begin activity) to some time in the future. You'd add an Exception Handler in your process with and Exception transition coming out of it with an "Instance Expiration" exception caught. This catches the exception thrown when the time in the "deadline" predefined variable is passed. At the end of the Exception transition that caught the exception, you'd have an activity with logic that would send your email (again using the Mail.send() method) and would reset the "deadline" predefined variable to some time in the future (so the exeption is not immediately rethrown) and the logic "action = BACK" that forces the work item instance to go back to the activity where the instance was thrown in the process.

    Dan
    Dan Atwood
  • 676859
    676859 Member Posts: 35
    Hi Daniel!

    thanks about the answer!

    Look, i know about send() and i'm using it according the needs.
    What i'm trying to create is an automatic procedure that would make more "modular" this kind of alerts:

    Alert Level Due Time Send mail to: After mail sent
    1 2 hrs User Back to activity
    2 5 hrs User, supervisor Back to activity
    3 8 hrs-->1 day User, Supervisor, Manager Back to activity

    As you can see, my variables are the due time and the alert level, also with user's OU and direct bosses.

    The message is always the same, but obviously changing the user's and process´s fields.
  • Dan Atwood
    Dan Atwood Member Posts: 2,313 Gold Trophy
    edited Aug 13, 2009 6:41PM Answer ✓
    I think I understand what you're after. I think you want to use the same escalation logic for all of your processes and instead of embedding this in every process you want something reusable. If this is not the case, read no further.

    While you can do this, there are still going to be 5 things each process would still need to have inside of them:
    <li> your process would need to set the "deadline" predefined variable to the intial timeout (2 hours in the future in your example)
    <li> your process would need an Exeption Handler needs to be added with an Exception transition set to "Instance Expiration"
    <li> your process would need an Integer instance variable "alertLevel" to keep track of the current level
    <li> your process would need a String instance variable "currentlyAssignedTo" to keep track of who's supervisor you want to notify
    <li> your process would need an Automatic activity with one line of logic inside it.

    You could have the Exception transition leaving the Exception Handler activity go to a subprocess using a Subflow activity. This subprocess would send the emails, determine the new deadline interval, determine the new priority of the instance, look up the currently assigned user, manager and supervisor's email addresses and send the email(s). The subflow would have two input argument variables (alertLevelArg and currentlyAssignedToArg). In the Begin activity, these arguments would be mapped to corresponding instance variables. Inside this subprocess there would be an automatic with the logic to send the email to the user / manager / supervisor based on the alertLevel instance variable. This subprocess would pass back out through its output argument variables the new alertLevelArg, and new deadline (a time argument variable set to some time in the future based on the new alert's level).

    Once the instance in the called subprocess completes, the output arguments need to be mapped to the original process's "alertLevel" and "deadline" variable. From the Subflow activity, you'd have an unconditional activity that flows into an Automatic activity via an unconditional transition. This automatic activity would have the single line of logic "action = BACK" so the instance is sent back from the Exception Hanldler's flow back to the activity inside the process it was in when the Instance Expiration exception occurred.

    Avoid hard coding the values of "2" and "5" and "8" for the number of hours to have elapse inside your logic. Instead make them business parameters capable of being edited by an business owner.

    Dan
  • 676859
    676859 Member Posts: 35
    Thanks again Daniel!
This discussion has been closed.