How do I get the correct Cell Status on a data buffer cell?
I have a process that builds a data buffer using Data Buffer Cell Loop logic. I need to check the cell status on each record and perform certain actions based on the status. Specifically, I want to make sure all 12 Account-Type dimensions are referencing a base member and correct them if they aren't.
However, I'm not getting the correct Cell Status when the cell is in a data buffer. For example this code creates two data cells and logs their status. (In this case, I'm looking at DataCells, but the behavior is identical on DataBufferCell objects). Metadata is from GolfStream.:
Dim baseMemberFilter As String = "A#50200:O#Import:U2#None:U8#Test"
Dim cellPk As DataCellPk = api.Data.ParseDataCellScript(baseMemberFilter)
Dim cell As DataCell = api.Data.CreateDataCellObject(cellPk, True, 100, False, False)
api.LogMessage("Base UD2 GetMemberScript: " & cell.DataCellPk.GetMemberScript(api))
api.LogMessage("Base UD2 CellStatus.UD2HasChildren: " & cell.CellStatus.UD2HasChildren)
Dim parentMemberFilter As String = "A#50200:O#Import:U2#Clubs:U8#Test"
Dim cellPk2 As DataCellPk = api.Data.ParseDataCellScript(parentMemberFilter)
Dim cell2 As DataCell = api.Data.CreateDataCellObject(cellPk2, True, 100, False, False)
api.LogMessage("Parent UD2 GetMemberScript: " & cell2.DataCellPk.GetMemberScript(api))
api.LogMessage("Parent UD2 UD2HasChildren: " & cell2.CellStatus.UD2HasChildren)
Because the first data cell references UD2#None, you would expect .CellStatus.UD2HasChildren to return FALSE (which it does). Because the second data cell references UD2#Clubs (a parent), you would expect .CellStatus.UD2HasChildren to return TRUE, but it doesn't. It also returns FALSE. Below is a screenshot of the log file. Other CellStatus properties (.ReadyOnly, .AreRightHandMembersBase, etc.) are also incorrect, I just chose to highlight the UDXHasChildren because it's the easiest to visualize.
So, two questions:
- How do I get OneStream to return a correct cell status for a DataCell or DataBufferCell?
- If it's not possible to get a correct status, what is the most efficient way to determine if a specific DataCell contains any parent members? I'm sure I could parse the member filter into it's 12 dimensions and check each member individually, but that is likely much too slow for the volumes we have.
Thanks, Phil B