Open topic with navigation

TIBCO Business Studio™ - BPM Edition 5.4.0

# Working with Enumerated Types (ENUMs)

If you want to categorize objects as different types, instead of using a number or a free format string, use an Enumerated Type (ENUM). Enumerated Types provide a better solution because they are restricted, in that they can only take a fixed limited number of values. The names of the values can be made meaningful.

The qualified name of enumerations to be used in script is similar to the Factory names, with the qualified name formatted to replace dot '.' by '_' an underscore character. The qualified name must be wrapped in a `pkg` object. For example, `com.example.shared.ColorEnum` is used as `pkg.com_example_shared_ColorEnum` in script.

An ENUM is created in the BOM editor by selecting the Enumeration type from the Elements section of the Palette. Having selected the Enumeration Element, it can be named, and values can be added to it. The following is an example of an Enumerated type called SpaceType, with PLANET, MOON, ASTEROID, and STAR values:

Having defined the Enumeration type, a class attribute can be set to that type:

A Business Object attribute that is configured to be of a particular Enumeration type can only be assigned with values of that enumeration type. Either constants of that type, such as:

    data.planet.type = pkg.SpaceType.PLANET;

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO Business Studio™ - BPM Edition

Copyright © 2015-2023. Cloud Software Group, Inc. All Rights Reserved.