Use the Zuora Query Objects activity to query for objects
such as Product, Account, or RatePlan from the Zuora application.
The query string that you specify for this operation must adhere to
the Zuora Object Query Language standard.
About this task
Use this task to query objects from the Zuora application.
The call to this activity is a synchronous call where the input data
is sent to the activity for processing and the response is sent back
to the orchestration.
To configure the Zuora Query Objects activity,
complete the following steps:
Procedure
- In an active orchestration, open the Activities tab
and expand the Zuora folder contents.
- Drag the Query Objects activity
icon onto the orchestration. The Zuora Query Objects Checklist is
displayed.
- In the Checklist, click Summary.
- Review the contents of the Activity Name field,
and make required changes if necessary.
- In the Checklist, click Pick
Endpoint.
- Click Browse and use the Project
Explorer dialog box to select the relevant Zuora endpoint.
- Optional: You can create the endpoint by clicking New and
specifying the required connection details. Click Test
Connection to test that you have connected successfully
to the Zuora application. Click OK to save
and use the endpoint for this configuration.
- To make required changes to the selected endpoint configuration,
click Edit to access the options in a separate
window. Any changes that you make globally affects all uses of the
endpoint in active orchestrations.
- Select the Map Inputs in the Checklist.
The XML schemas generated from the selected object of the Query
Objects activity are displayed as nodes under the request
input parameter in the To Activity panel.
- Create a map between the orchestration variables and the
input parameter of the activity.
Note: Values must be provided
at run time for any mandatory elements of the input structure. A value
can be provided by specifying a default value for element or by linking
the element with an input node. During run time, if no value is provided
for a mandatory element, the activity is completed and the result
of queryResponse is populated with an error message. By reviewing
the response of the activity, you can know if the request had failed
or was successful.
- Select the Map Outputs in the Checklist.
The XML schema generated to hold the response of the activity is displayed
as nodes under the response output parameter in the From
Activity panel.
- Create a map between the output parameters and orchestration
variables.
Note: The output of the Query Objects activity
is queryResponse, which has a generic structure.
If the output of the Query Objects activity must be used in a later
activity, direct mapping cannot be done. The data must be extracted
from the queryResponse with the help of the Apply
XSLT activity.
Sample XSLT that can be used to extract specific
data:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns1="http://api.zuora.com/" xmlns:ns2="http://object.api.zuora.com/">
<xsl:template match="/ns1:queryResponse/ns1:result">
<xsl:element name="Products">
<xsl:apply-templates select="ns1:records" />
</xsl:element>
</xsl:template>
<xsl:template match="ns1:records">
<xsl:element name="Product">
<xsl:element name="Id">
<xsl:value-of select="ns2:Id"/>
</xsl:element >
<xsl:element name="Name">
<xsl:value-of select="ns2:Name"/>
</xsl:element >
<xsl:element name="SKU">
<xsl:value-of select="ns2:SKU"/>
</xsl:element >
<xsl:element name="EffectiveStartDate">
<xsl:value-of select="ns2:EffectiveStartDate"/>
</xsl:element >
<xsl:element name="EffectiveEndDate">
<xsl:value-of select="ns2:EffectiveEndDate"/>
</xsl:element >
<xsl:element name="Description">
<xsl:value-of select="ns2:Description"/>
</xsl:element >
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Results
You have configured the Zuora Query Objects activity.