Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Question

What will be the value of the "resultType" parameter to display a chart (i.e., waterfall, scatter, time series created using the chart builder API) from the quote Quote header? For example, to display a data table in the quote Quote header, the "resultType" parameter value is "MATRIX", for gauge it is "GAUGE". What will be the value for charts? The output field is created using the addOrUpdateOutput method.

update
Code Block
qp.addOrUpdateOutput(folderId, ["resultName": "Deal Performance", 
"resultLabel": "Deal Performance", 
"resultType": ??
"result" : waterfallChart])
Page Properties
hiddentrue
Author
Contributors
limit1
showLastTimetrue
reversetrue
order

Answer

Check out this sample:

Code Block
languagegroovy
def customerId = quoteProcessor.getHelper().getRoot().getInputByName("Customer")?.value

if (quoteProcessor.isPostPhase() && customerId){
  quoteProcessor.addOrUpdateOutput("ROOT", ["resultName": "RevenueMargin",
                                            "resultLabel": "Revenue vs Margin",
                                            "result": lib.charts.generateRevenueMargin(customerId, null),
                                            "formatType": "COMPLEX",
                                            "userGroup" : "KeyUsers",
                                            "resultType":"BAR",
                                            "resultGroup":"Customer Sales History"
                                           ]
                                  )
   quoteProcessor.addOrUpdateOutput("ROOT", ["resultName": "SalesHistory",
                                            "resultLabel": "Aggregated Sales History",
                                            "result": lib.charts.generateSalesHistory(customerId, null),
                                            "formatType": "COMPLEX",
                                            "userGroup" : "KeyUsers",
                                            "resultType":"DATATABLE",
                                            "resultGroup":"Customer Sales History"
                                           ]
                                  )
}

These are some of the other resultTypes available for use:

Code Block
languagegroovy
package net.pricefx.common.api;
public enum CalculationResultType {
	SIMPLE, 
	MATRIX, 
	GAUGE, 
	QUOTE, 
	CONTRACT, 
	REBATEAGREEMENT, 
	WORKFLOW, 
	CONFIGURATORENTRY, 
	FLEXCHART, 
	DASHBOARD, 
	REBATERECORD, 
	DASHBOARDCONTROLLER, 
	CONFIGURATORENTRYARRAY, 
	COMPOSITEFLEXCHART,
	COMPOSITEOFSIMPLE,
	PAQUERY
}

Values such as "Waterfall" work too, if you specify "formatType": "Complex".