转 Sending recursive mails upon reaching the deadline until the task is completed

Sending recursive mails upon reaching the deadline until the task is completed

Recently, we encountered a scenario where-in we need to send recursive mails for every xx hours, when the deadline is reached, until the task is completed. I am presenting the same here, with a simple example, hoping that this would be useful to you all. 

Start a new workflow and define a "User Decision" step. For steps on how to define a User Decision step, click here.

In the step "User Decision", switch to tab "Latest End" and provide the details as shown below:

In the action, select "Modeled" from the list. Enter the name of the outcome.

转 Sending recursive mails upon reaching the deadline until the task is completed 

Click on "Transfer and to Graphic" (Green tick button).

转 Sending recursive mails upon reaching the deadline until the task is completed

You can notice that there are 3 branches now. Two belong to the User Decision Step (YES/NO) and the other one is of Modeled deadline. So whenever a deadline is reached, this branch executes. When the user completes his task, it would either take YES or NO branch accordingly.

Now assume that we need to send repetitive mails to the agent for every 3 minutes, until he completes the task (in this case, acting on User Decision step).

Double-click on "Undefined step" in the "Modeled" branch and select LOOP(Until)

转 Sending recursive mails upon reaching the deadline until the task is completed

Using "Loop (Until)",  we would be sending emails repetitively for every 3 minutes. To keep the loop open continuously, lets define a condition which would never be met.

Enter a step name and then click on "Click here to create a new condition".

转 Sending recursive mails upon reaching the deadline until the task is completed

Since we intend to make this Loop indefinite, create a condition similar to the following one.

转 Sending recursive mails upon reaching the deadline until the task is completed

Now go back to the main screen.

转 Sending recursive mails upon reaching the deadline until the task is completed

The above screenshot is of the step "Loop (Until)". Now double-click on the "Undefined" step above and create an email step.

Enter the recipient name and other details as shown above.

Now we need to send mails once every three minutes until the task is finished. To achieve this, we would need to create a business object (or use an existing one) and create a dummy method (with no code in it). Ensure that the check box "dialog" is unchecked in the properties of this method.

转 Sending recursive mails upon reaching the deadline until the task is completed

Now create a step "Activity" by double-clicking on undefined step after the email step in the Modeled branch.

转 Sending recursive mails upon reaching the deadline until the task is completed

Click on "Create new task"

转 Sending recursive mails upon reaching the deadline until the task is completed

Provide the details as shown below:

转 Sending recursive mails upon reaching the deadline until the task is completed

Don't forget to check the checkbox "Background processing".

SAVE and click on Back button.

In the activity step, switch to "Requested start" tab and provide details as shown below:

转 Sending recursive mails upon reaching the deadline until the task is completed

Using the above step, we are restricting the LOOP to send mails for every 3 minutes only.

Save and activate your workflow.

Test run the workflow. Do NOT execute the work item and wait for the alert mails.

Work item in inbox:

转 Sending recursive mails upon reaching the deadline until the task is completed

Work item along with the alert mails (after the deadline is reached):

转 Sending recursive mails upon reaching the deadline until the task is completed

你可能感兴趣的:(mail)