AD0-E330 practice question 5 of 10

A developer wants to retrieve data from multiple schemas and insert data into the temp table within a workflow. Which two methods should be used to perform this operation? (Choose 2)

Full set: 50 questions
Answer options
A: Xtk.queryDef.create() Correct answer
B: Xtk.workflow.execute()
C: Xtk.queryDef.Update()
D: Xtk.session.write() Correct answer
Correct Answer:
A. Xtk.queryDef.create(); D. Xtk.session.write()
Explanation

To retrieve data from multiple schemas and insert it into a temporary table within a workflow's JavaScript activity, a two-step process is required. First, Xtk.queryDef.create() is used to instantiate a query definition object. This object allows the developer to define the target schema, select columns (including those from linked schemas via joins), and specify filtering conditions. After executing the query, the developer iterates through the result set. For each record retrieved, the xtk.session.write() method is called to perform an INSERT or UPDATE operation, writing the data into the designated temporary table.

Why Incorrect

B. Xtk.workflow.execute() This function is used to programmatically start another workflow; it does not manipulate data within the current workflow's context.
C. Xtk.queryDef.Update() This is not a valid method for the queryDef object in the Adobe Campaign Classic JavaScript API. Data writing is handled by session methods.

References

1. Adobe Campaign Classic v7 Documentation, JSAPI Reference, queryDef class: This document details the create(queryDef) static method for creating a query definition instance. It is the standard starting point for building and executing queries in server-side JavaScript. The examples show its use for data selection. (See section: queryDef class description and create(queryDef) method).

2. Adobe Campaign Classic v7 Documentation, JSAPI Reference, xtk.session static class: This documentation outlines the write(entity) method. It explicitly states the method "Writes an entity in the database (INSERT or UPDATE)." This is the correct function for persisting the data retrieved by the queryDef into the temporary table. (See section: xtk.session class, write(entity) method).

3. Adobe Campaign Classic v7 Documentation, JSAPI Reference, xtk.workflow static class: This source describes the execute(workflowId) method, confirming its purpose is to execute a workflow identified by its ID, which is irrelevant to the data manipulation task described in the question. (See section: xtk.workflow class, execute(workflowId) method).

Scroll to Top