Build a Pause into Your Flow

By: Octavio Rivera
Date: September 16, 2013

There are times when you need your flow to just pause and wait for a minute – either to allow something to finish or just so you can go get a cup of coffee.

If you add this function into your pflow.js file you can then call for a pause for the number many seconds you pass to the function.

Function: sleep

Purpose: Runs for a specific number of seconds
Simulates a pause.
function sleep(nSecs)
var initDate= today();
var currDate;
currDate = today();
while( currDate – initDate < nSecs * 1000);
return nSecs

Then use this call from an Assign node in the flow: sleep(120)

By adding the function to pflow.js, it is available as a function within your Assign node. If you don’t want to edit Infor’s delivered pflow.js file then you can create a pflow_user.js file with your function. The system will recognize both the standard file and this additional one. Be sure to update both your local copy and the copy on the server.

Octavio Rivera, Senior Technology Consultant

Our Headquarters

Avaap USA, LLC
510 Thornall Street, Suite 250, Edison, NJ 08837

Phone: 732.710.3425
Fax: 732.243.9550

Avaap Midwest 
6 West Fifth Street, 8th Floor, St Paul, MN 55102

Avaap EHR 
70 Madison Street, Suite 2610, Chicago, IL 60602

Global Center of Excellence 
Chennai ONE, IT SEZ, Upper Stilt, Pallavarm-Thoraipakkam, 200 ft Road, Thoraipakkam, Chennai 600096. INDIA

Avaap UK
Stanmore House 64-68 Blackburn Street Radcliffe, Manchester M26 2JS. England

Avaap Spain
Antonio Machado 78, Australia Building 1-A3, Viladecans, Barcelona 08840 Spain

Avaap Amsterdam
Keizersgracht 62-64 Amsterdam, Netherlands 1015CS

Technical assistance for Avaap Managed Services and Product customers: