stopping the workflow for X days and then sending a task/email

  • 7 November 2014
  • 6 replies
  • 1 view

Badge +3

Hi folks,

I have a workflow that will be started when a person leaves a company. This wf can be started even 2 months before this person leave.

Alle the workflow tasks can be completed except one task/reminder. The person who gets this task/reminder then has to delete the home directory (not before). This MUST be done 3 days AFTER the last working day.

Workflow:

at the top I do a "calculate date":

    Date:                 workflow data   ->  varLastWorkday

    days                 3

    Store date in: varDeleteOrder

I send out a test email to myself with the variable varDeleteOrder. It seems to work (date is correct).

Then I tried to (I think in english it's called) "stopping until"

    pause until:  workflowdata   ->   varDeleteOrder"

Below I put the task/reminder.

I did a test WF and puted the last varLastWorkgday to November 2.2014 (today Nov.7. minus 3 days).

Unfortunately I don't recieve the task/reminder.

Do I a mistake by trying this?

Thanks in advance.

Kind Regards

Joel


6 replies

Userlevel 7
Badge +17

Everything sounds correct, you should be using the Pause Until the set date of varDeleteOrder. Then run the task.

Is the workflow still running "In Progress" status? Or did it error? I'm looking to see if there is an issue with pause actions in your farm. You can run a quick test on a new workflow, two actions, First one is Pause For 1 minutes, next is Log To History List, and write some data to history. Does a workflow like that finish correctly? This will rule out any issues with the farm if so.

Badge +3

Hi Andrew

Thanks for your answer. That is what I already did (Pause until).

The Action Log says no error:

Anhalten bis...10.11.2014 14:01incomplete
Task Support10.11.2014 13:4210.11.2014 14:0118 minutes

The workflow stops until tomorrow 0:00 .....

10.11.2014 14:44WorkflowkommentarWird bis 11.11.2014 00:00:00 angehalten

That means it should work properly, right?

Let's see what happens tomorrow. If no success I'll make a test WF like you described.

And I'll post more after that.

Userlevel 7
Badge +17

Great! Also, here is some light reading that could help regardless. Workflows not continuing - Timer Service and Delays

Oh and what version of workflow are you running?

Badge +3

Hi Andrew

It is WF 2010.

I'll read the document behind your link.

And the good news is....IT WORKED for another time. SO I'll do some more tests. Will post it here.

Thank you very much for helping me.

asap I'll be back with final results :-)

Badge +3

Hi Andrew

A lot to do... so I needed more time :-)

FInally it works. I had problems but now they're solved.

The WF is a human ressource one and in this case it's started when a person leaves the company. Some times this WF start was started to late (later then the person really leaves....yeap, I know that is awful :-)

I want that the account administrator gets a task a few days AFTER the official date when the contract ends. Now I did an "IF" the "leavingDate" is earlier than TODAY, hen send the task/message immediately. Otherwise "pause until" then send it out....

I only wanted to inform that to bring this task to an end.

BUT unfortunately I have another problem. Calculating a date. I did this and said fn.differenceDate.... Today and leavingDateIt gives me a value (for example 5)....but in this case it should be 4.

Why that does it add a day more? The Code in calculate Date is:

fn-DifferenzTage({WorkflowVariable:varHeute},{WorkflowVariable:varErinnerungsDatumLetzterArbeitstag})

Should I easy peace add a "-1" at the end? Like....

fn-DifferenzTage({WorkflowVariable:varHeute},{WorkflowVariable:varErinnerungsDatumLetzterArbeitstag}-1)

I tried this and now it returns me 4.91888..... instead of 5

Have a good day

Joel

Userlevel 7
Badge +17

The inline function fn-DateDiffDays(start date, end date) determines the number of days between two dates. The result can be a decimal value including partial days. So if the dates are not both at 12 am, then a partial day of 4.91 can occur. Partial days can be ok in your case, in which you just need to know when greater than(or less than?) or equal to 5.

Reply