Skip to main content
Administrator Guide
Last Updated: 2023-06-23
Reference: Studio Helper Objects

Reference: Studio Helper Objects

Studio provides a number of helper objects that enable you to access an integration's runtime properties using MVEL. You can use the helper objects to make simple changes to runtime values, or to extract them and pass them to components in the assembly.
Helper Object
Purpose
context
Provides access to the
MediationContext
object - that is, to the dynamic state of the integration at runtime. The
MediationContext
object links to the current message, mediation properties, mediation variables, and current error information.
Example: This expression retrieves the value of the property
myProperty
from the
MediationContext
:
context.getProperty('myProperty')
Example: This expression retrieves the property
someProperty
from the
MediationContext
if the property value is set to
someValue
:
context.getProperty('someProperty').equals('someValue')
da
The Document Accessor helper object. Provides access to the list of documents that were attached to the integration event before this integration ran. Effectively combines a Get Event Documents web service call with the retrieval of the documents referenced in the web service response.
The
da
helper object has some limitations:
  • It must explicitly include logic to handle cases where an unexpected number of attachments is available.
  • It can't access the filetype of the attachment.
  • It can't access the character encoding of the attachment.
The
doc-iterator
router strategy handles unexpected numbers of attachments automatically and it can access both MIME type and character encoding. It's often more appropriate for an integration to use that strategy to retrieve input documents, rather than this helper object.
Example: This expression retrieves a document from an integration event with filename
eib_transform_output.txt
and adds a variable named
var1
:
da.toVar('eib_transform_output.txt', 'var1')
Example: This expression retrieves a document with the given label:
da.getDocsMatching('label')
ftp
Provides access to the list of files returned when issuing the LIST request to an ftp, ftps, or sftp server.
Example: This expression retrieves a list of files for a URL:
ftp.list('URL')
intsys
Provides convenient and high-performance access to the integration system configuration as returned by the Get Integration Systems web service call.
Example: This expression retrieves an integration attribute named
username
:
intsys.getAttribute('username')
Example: This expression displays as true if an integration service with the given name exists:
intsys.isServiceEnabled('name')
If you use
intsys
to access an attribute, you must first define a service on the
workday-in
transport for the integration system.
lp
Provides access to launch parameters and other information in the integration launch event.
Example: This expression retrieves the value of a launch parameter with the given name:
lp.getSimpleData('name')
Example: This expression displays as true if a parameter with the given label exists:
lp.exists('label') == true
Before using the
lp
variable, you need to assign the launch parameters XML to the variable
wd.launchparameters
.
message
Provides access to the current message and its header information. Use this object to assign new content to the message.
Example: This expression retrieves the root part of a message as text from the
MediationMessage
interface:
message.rootPartAsText
Example: This expression retrieves
MediationContext
variables:
message.variables
mtable
Provides access to the
MTableAdapter
interface, which defines the operations on an
mtable
instance.
Example: This expression sets data in an
mtable
:
mtable['my_property'].set(0, 'Data_Column', 'my_test_data')
parts
Provides access to the individual parts of the current message. Most messages in Workday integrations have a single part, the root part. Use
parts[0]
to access the root part.
Example: This expression retrieves the header
someHeader
from the root part:
parts[0].getHeader('someHeader')
Example: This expression implements the
xpathB
method to evaluate an XPath Boolean expression:
parts[0].xpathB('/a/b')
props
Provides access to
MediationContext
properties.
Example: This expression retrieves the value of the property
myProperty
from the
MediationContext
:
props.myProperty
Example: This expression retrieves the value of the property
bean.property
from the
MediationContext
:
props['bean.property']
spring
Provides access to the creation and retrieval beans defined in an assembly's Spring configuration.
Example: This expression retrieves the
name
attribute of the bean called
Fred
in the Spring context:
spring.getBean('fred').name
Example: This expression accesses the Spring application context:
spring.parent ApplicationContext
util
A set of utility functions for performing common operations such as escaping values for insertion into XML or creating an HTTPS URL.
Example: This expression checks whether the current message in the
MediationContext
is the last message that the splitter component will generate:
props['is.last.record'] = util.isLastMessageInBatch()
Some
util
functions have crucial limitations. Example: the
xpathToCommaDelimString
function produces a comma-separated list from the string values of the node sequence returned by an XPath expression operating on a given XML string. You can then split and manipulate the comma-separated list using Java string manipulation functions in MVEL. However, the function has these limitations:
  • It only supports XPath 1.
  • It can't produce CSV files since it doesn't correctly escape newlines, commas, and quotation characters.
  • It can't reliably separate data containing commas.
  • Its requirement for XML as a string encourages nonscalable practices such as converting the current context message or variable to a string.
Workday strongly recommends the use of explicit, versioned, web service requests for stability and backward compatibility. Using
MVELUtilHelper.getLatestWWSVersion()
in integrations isn’t best practice, and can lead to integrations with unexpected failures or results.
vars
Provides access to
MediationContext
variables.
Example: This expression retrieves the length of the variable
myVariable
:
vars['myVariable'].length
Example: This expression retrieves the length of the variable
myVariable
:
vars['myVariable'].length
xmldiff
Provides programmatic access to the results of document comparison with the
xmldiff
component.
Example: This expression checks whether there are differences between 2 documents:
xmldiff.isDifferent() == true
Example: This expression retrieves a list of differences between 2 documents:
xmldiff.changes