Stephen Gilmore

🧪 Test mode in Workday Studio

Workday October 18th, 2022 2 minute read.

Sometimes it's helpful to have a 'Test Mode' on a Studio integration to create a 'dry run' type of behavior. For example, I recently built an integration to create referral bonus one time payments and I wanted run the integration end-to-end without actually submitting the payment in Workday. Here's how I did it–

Step 1: Create a 'Test Mode' launch parameter

On the workday-in component at the beginning of the integration, add a new launch parameter:

Type: Simple
Name: Test Mode
Type: boolean
Default Value: true (optional)

Step 2: Create an integration message to communicate the Test Mode setting

This is for your future self and anyone else who runs the integration. Directly or shortly after the workday-in component, add a new PutIntegrationMessage component configured with the following parameters:

is.message.severity: 'INFO'
is.message.description: 'Integration is running in Test Mode. No ____ will occur.'

Step 3: Add 'Execute When' conditions as needed

Let's start with the PutIntegrationMessage we just created. On the 'Common' tab, add (boolean)lp.getSimpleData('Test Mode') to the 'Execute When' field.

Now the integration will only generate that message when it's in 'Test Mode'. This condition can be added throughout the integration as needed.

Recap

Add a test mode launch parameter on the workday-in component.
    Type: Simple
    Name: Test Mode
    Type: boolean
    Default Value: true (optional)

To execute a step only when Test Mode is ON:
    (boolean)lp.getSimpleData('Test Mode')

To execute a step only when Test Mode is OFF:
    !((boolean)lp.getSimpleData('Test Mode'))

These conditions don't have to be added to every component. Just add them to the ones you want to behave differently based on 'Test Mode'.