Build a Pause into Your Flow

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;
do
{
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

Get the latest thought leadership from Avaap delivered to your inbox weekly!

* indicates required

Expert Insights

Trending resources

The Complete Guide to ACA Setup and Configuration (PDF)

This presentation takes a deep dive into setup and configuration for the Affordable Care Act (ACA) inside Infor Benefits Administration.…
Leveraging Change Management When Moving to the Cloud

Leveraging Change Management When Moving to the Cloud

Start with the end in mind: Optimize your future state by leveraging the current state…
Spilling the Tea: Three Things You Should Know Before an ERP Implementation

Spilling the Tea: Three Things You Should Know Before an ERP Implementation

Have you implemented ERP in the cloud? There are many people who are first-timers to…

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;
do
{
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