Using External Enumerations

Hello everyone

We are currently trying to solve the following problem. There are various enumerations in our form. However, the underlying catalogs are context-dependent, too large or change dynamically. The selected value of an enumeration determines the selection options for the 2nd enumeration. Their selection in turn determines the selection options in the 3rd enumeration. In our opinion, maintenance in the model is not very suitable for this. Our idea is to deliver the values of the enumerations via an API of our backend. The retrieval of the enumeration values must be parameterizable, as they may result from the value of another enumeration. At least we need access to the values in the form in order to be able to branch backend calls. While looking for a possible solution, we came across the External Enumerations in A12. However, their documentation is quite lacking in detail. If the External Enumerations are the solution to our problem, an example implementation would be very helpful.

We use an outdated A12 version (2019.02) with XML-based models in the affected application. However, migration is already pending. If significant changes have been made to the external enumerations in newer versions, this would be valuable information. In this case we would precede an A12 update.

Hi Mathias,

External enumeration is designed as an “escape hatch” when model driven does not work. That’s why it is so simple.

I am not sure but maybe you can achieve your desired behavior in the following way:

  • fetch your enum values yourself and store them in the store
  • listen to changes in the document to update the lists

Hi @mathias-early-ravine, did the response from bjaghoori help solve your issue? If so, could you, please, mark the response as solved using a check icon below the helpful response? If not - do you have some additional questions?

Hi @baschir-loud-bluff,
is this the official recommendation, to not use external enumerations (as it will be phased out eventually)?
How would we go about your proposed solution?
Thank you, Alex

Hi Alexander,

Maybe my above statement was a bit misleading. Or maybe the name “external enum” is misleading. It is basically just a way to pass a callback to a dropdown React component.

And, no, we do not plan to remove it.

Maybe it helps to see it that way:

Normally for customizing, you need to implement your own React component, including fetching /storing the enum values and any filtering / “dependency” logic between multiple fields. But with using “external enum”, you can skip the part of actually rendering the dropdown yourself.

hope that helps a bit,
Baschir

Hi Baschir, thanks for the clarification, this does help me indeed. Alex

@dmytro-clear-peat @alexander-grey-cluster fyi