...
Now use these methods for accessing the inputs/outputs:
Tip |
---|
Do thisRecommended: |
Code Block |
---|
def items = quoteProcessor.quoteView.lineItems.findAll { !it.folder } def totalInvoicePrice = items .sum { item -> Map itemOut = getItemOutputs(item) return itemOut.InvoicePrice * itemOut.Quantity } |
Warning |
---|
Avoid thisTo be avoided: |
Code Block | ||
---|---|---|
| ||
def items = quoteProcessor.quoteView.lineItems.findAll { !it.folder } def totalInvoicePrice = items .sum { item -> BigDecimal invoicePrice = item.outputs.find { it.resultName == "InvoicePrice" }?.result BigDecimal quantity = item.outputs.find { it.resultName == "Quantity" }?.result return invoicePrice * quantity } |
...