Versions Compared

Key

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

...

Including Forms in Other Logics

To include a form in your logic, build an input that references the form by its name:

Expand
titleForms
Code Block
languagegroovy
themeMidnight
linenumbersfalse
def formFieldSet = api.createConfiguratorEntry()

formFieldSet.inputs = [
    api.inputBuilderFactory()
        .createConfiguratorInputBuilder('userInput')
        .buildContextParameter()
]

return formFieldSet
Expand
titleIn input generation mode (syntax check mode)
Code Block
languagegroovy
themeMidnight
linenumbersfalse
api.inputBuilderFactory()
        .createConfiguratorInputBuilder('userInput', configuratorLogicName, true)
        .getInput()
Expand
titleIn header Logics
Code Block
languagegroovy
themeMidnight
linenumbersfalse
processor.addOrUpdateInput(                 //❶
        'ROOT',
        api.inputBuilderFactory()
                .createConfiguratorInputBuilder('userInput')
                .buildMap()
)

❶ the processor can be one of the quoteProcessor, cProcessor, etc., which references subclasses of the CalculableLineItemCollectionBuilder

You need to give each form an input name. The inputs from that form will be accessible via that name on the input binding variable:

Code Block
languagegroovy
themeMidnight
linenumbersfalse
input.userInput.nameOfInput as ValueType

...