The product and customer inputs let the user pick a set of existing products and customers from the master data. The two inputs work in the same way, just use different tables for data selection.
The value of this input is CustomerGroup or ProductGroup object. It is often transported as a Map when value is passed between logics over HTTP, so you may need to convert the input map to the object first.
Product
The product filter allows the user to provide a set of products as an input. The end user can either select products from a list, or provide a filter that will be used to query the product master table.
Image Modified Image Modified Expand |
---|
|
Code Block |
---|
language | groovy |
---|
theme | Midnight |
---|
linenumbers | false |
---|
| def formFieldSet = api.createConfiguratorEntry()
formFieldSet.inputs = [
api.inputBuilderFactory()
.createProductGroupEntry('productGroup')
.buildContextParameter()
]
return formFieldSet |
|
Expand |
---|
title | In input generation mode (input generation mode) |
---|
|
Code Block |
---|
language | groovy |
---|
theme | Midnight |
---|
linenumbers | false |
---|
| api.inputBuilderFactory()
.createProductGroupEntry('productGroup')
.getInput() |
|
Expand |
---|
|
Code Block |
---|
language | groovy |
---|
theme | Midnight |
---|
linenumbers | false |
---|
| processor.addOrUpdateInput( //❶
'ROOT',
api.inputBuilderFactory()
.createProductGroupEntry('productGroup')
.buildMap()
) |
❶ the processor can be one of the quoteProcessor, cProcessor, etc., which references subclasses of the CalculableLineItemCollectionBuilder |
Expand |
---|
|
Code Block |
---|
language | groovy |
---|
theme | Midnight |
---|
title | Reading input value in a line-item logic. |
---|
|
|
...
...
...
def value = input.productGroup as Map |
|
...
title | Converting to a Filter |
---|
Creating a filter out of the ProductGroup object to be used in Price Analyzer. It performs the attribute to datasource field name conversion.
Code Block |
---|
|
def filter = api.datamartFilter(productGroup) |
Creating a filter out of the ProductGroup object to be used in other modules except Price Analyzer.
...
...
def filter = productGroup.asFilter()
Customer
The customer filter allows the user to provide a set of customers as an input. The end user can either select customers from a list, or provide a filter that will be used to query the customer master table.
Image Modified Image Modified Expand |
---|
|
Code Block |
---|
language | groovy |
---|
theme | Midnight |
---|
linenumbers | false |
---|
| def formFieldSet = api.createConfiguratorEntry()
formFieldSet.inputs = [
api.inputBuilderFactory()
.createCustomerGroupEntry('customerGroup')
.buildContextParameter()
]
return formFieldSet |
|
Expand |
---|
title | In input generation mode (input generation mode) |
---|
|
Code Block |
---|
language | groovy |
---|
theme | Midnight |
---|
linenumbers | false |
---|
| api.inputBuilderFactory()
.createCustomerGroupEntry('customerGroup', )
.getInput() |
|
Expand |
---|
|
Code Block |
---|
language | groovy |
---|
theme | Midnight |
---|
linenumbers | false |
---|
| processor.addOrUpdateInput( //❶
'ROOT',
api.inputBuilderFactory()
.createCustomerGroupEntry('customerGroup')
.buildMap()
) |
❶ the processor can be one of the quoteProcessor, cProcessor, etc., which references subclasses of the CalculableLineItemCollectionBuilder |
Expand |
---|
|
Code Block |
---|
language | groovy |
---|
theme | Midnight |
---|
title | Reading input value in a line-item logic. |
---|
|
|
...
...
...
def value = input.customerGroup as Map |
|
...
Expand |
---|
title | Converting to a Filter |
---|
|
Code Block |
---|
| def filter = api.datamartFilter(customerGroup) |
Creating a filter out of the CustomerGroup object to be used in other modules except Price Analyzer. Code Block |
---|
| def filter = customerGroup.asFilter() |
|
...