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
titleIn syntax check modeForms
Code Block
languagegroovy
themeMidnight
linenumbersfalse
def formFieldSet = api.createConfiguratorEntry()

formFieldSet.inputs = [
    api.inputBuilderFactory()
        .createConfiguratorInputBuilder('form', configuratorLogicName, true)
        .getInputbuildContextParameter()
]

return formFieldSet
Expand
titleIn header Logicsinput generation mode (syntax check mode)
Code Block
languagegroovy
themeMidnight
linenumbersfalse
processor.addOrUpdateInput(
        'ROOT',
        api.inputBuilderFactory()
    
           .createConfiguratorInputBuilder('form'),      configuratorLogicName, true)
          .buildMapgetInput()
)
Expand
titleIn forms (Configurators)header Logics
Code Block
languagegroovy
themeMidnight
linenumbersfalse
def formSection = api.createConfiguratorEntry()

formSection.setInputs([processor.addOrUpdateInput(
        'ROOT',
        api.inputBuilderFactory()
                .createConfiguratorInputBuilder('form')
                .buildContextParameterbuildMap()
])

return formSection

Any inputs that are part of the form can be read normally:

Code Block
languagegroovy
themeMidnight
linenumbersfalse
input.nameOfInput as ValueType

...