How to Store Quote Inputs/Outputs in Analytics
Generic Logic
Create a generic feeder logic that emits the Quote objects for use in the Analytics logic:
def quotesRecieved = true
int i = 0
int step = 200
def qs = []
def quotes = []
while (quotesRecieved) {
// lastRunTime - last run time of the Data Load. For the first run, it should be an old date which includes all the quotes.
qs = api.find("Q", i, step, null,
Filter.greaterOrEqual("lastUpdateDate", lastRunTime))
if (qs.size() != 0) {
quotes += qs
i += step
} else {
quotesRecieved = false
}
}
for (q in quotes) {
if (q?.id != null) api.emitPersistedObject("Q", q.id)
}
Analytics Logic
Retrieve the target rowset from the Datamart:
def targetRs = api.getDatamartRowSet("target")
Fetch the Quote from the feeder logic:
def targetRs = api.getDatamartRowSet("target")
Fetch header inputs/output values from the Quote:
Fetch line-level inputs/output values from the Quote (you can use api.getCalculableLineItemResult
to fetch line-level outputs):
Create a map object mapping values to Datamart fields. (Map keys MUST match the Datamart field names). Add the row to the target rowset:
Create global variables for all field values:
Create logic elements for each Datamart field. Return the global variables in each logic element with the Display Mode "Everywhere", so they can be accessed in the Data Load.
Data Load
If the target is a Datamart, create a calculation data load for Datamart that runs incrementally and assign the appropriate Analytics and generic logics as the Formula and Feeder logics respectively. If the target is a Data Source, update the existing 'Flush' type Data Load for the Data Source by configuring the Formula and Feeder logics in the Calculation section.
Found an issue in documentation? Write to us.
Â