Forum Discussion

FICO's avatar
FICO
Community Manager
2 years ago

Creating dynamic array in Business termset in Decision modeler

 Whenever I create a Business Termset from BOM, arrays are always showing as fixed array. How to create dynamic arrays or a list in BTS in Decision modeler. or Is there a way in SRL to convert the created fixed array to a dynamic one? My requirement is to add elements to the list of objects in a dynamic array in BTS based on some condition, so I don't want fixed arrays. bts scrshot

1 Reply

  • FICO's avatar
    FICO
    Community Manager

    What I typically have done is write a helper function for arrays I want to be able to add to, but need to be stored in a fixed array. I create a temporary variable of type array and then cast the fixed array to it, using the command as an array, and afterwards cast it back using the cast as a fixed array. For example:

    myTempArray is some array of configData;

    myTempArray = configDataArr as an array of configData;

    myTempArray.append(a configData);

    configDataArr = myTempArray as a fixed array of configData;

    This is not necessarily the most performant way of doing it, just the easiest. Creating dynamic arrays in a business term set is on the roadmap.