Skip to end of metadata
Go to start of metadata

The Model Gateway provides two different mechanisms for importing / exporting variant options:

  • Single option (which corresponds to the SingleOptionValue# contentType): allow to import / export the value of a specific option.
  • All options (which corresponds to the joint use of AllOptionsName and AllOptionsValue contentTypes): allow to import all options values for an object. This mechanisms requires the use of two columns: one which contains the name of the option, the other with its value.

Single Option Mechanism

To use the single option mechanism you need to:

  • set the contentType of the column to SingleOptionValue#
  • set the contentId of the column to a string identifying the option in the option tree. This string is similar to a file path with the character / as a separator.

The value which is imported / exported depends on the type of the selected option:

  • For a terminal option (option without child option) the exported value is either "X" if the option is checked or an empty string if not. For import in addition to "X" and "" values, the Model Gateway also accepts "true" and "false".
  • For a non terminal option the value for export and import is a comma separated list of its checked children options (it only concerns direct children, not grandchildren and other descendants).

Example

To import / export the value of the option type moteur below, you need to set the contentId to rep/type moteur. For an arKItect object which has both diesel and elec checked and essence unchecked, the exported value for the type moteur option will be "diesel, elec" (not necesseraly in that order).

All Options Mechanism

To use the all options mechanism you need to create two columns in the Rule Model, one with the AllOptionsName contentType and the other with AllOptionsValue contentType. In the Excel file the AllOptionsName column contains the name of the option and the AllOptionsValue the corresponding value, which is a comma separated list of terminal children options which are checked.

Remarks:

  • It is not necessary to specify the value for options which do not have any children option checked (in which case the value would simply be an empty string).
  • The options listed in the AllOptionsName column need to be non terminal options which have one or more terminal child options.
  • This mechanism requires options name to be unique in the option tree.

Warning

Icon

Be careful when using this mechanism in import as where the single option mechanism which affects only one option, the all options mechanism will overwrite all options of the target object, even those which are not specified the Excel file

Example

Let's consider the following Excel file and option tree:

Object Name

AllOptionsName

AllOptionsValue

ElectricCar

type moteur

elec

ElectricCar

type clim

manuelle

HybridCar

type moteur

elec, diesel

HybridCar

auto

commande centrale

The import of the Excel file will set the options of the objects ElectricCar and HybridCar to:

  • ElectricCar
    • (X) rep
      • (X) type clim
        • ( ) auto
          • ( ) commande centrale
          • ( ) deux commandes
        • (X) manuelle
      • (X) type moteur
        • ( ) diesel
        • (X) elec
        • ( ) essence
  • HybridCar
    • (X) rep
      • (X) type clim
        • (X) auto
          • (X) commande centrale
          • ( ) deux commandes
        • ( ) manuelle
      • (X) type moteur
        • (X) diesel
        • (X) elec
        • ( ) essence
  • No labels