ITM/IMAS releases of Kepler provide two, built from scratch, actors for record manipulation.
1. 1. Setting values inside Record Token using recordset actor
recordset actor allows you to set/modify values inside Record Token. It works following way:
If there is no field inside Record Token, it will add it into Record Token
{ a = 1 } -> inputRecord -+ | >- { a = 1, b = 2 } | 2 -> b -+ // I am passing value 2 into port with the name b - new // entry inside record will be created
If there is a field with given name inside Record Token, it will be replaced
{ a = 1, b = 1 } -> inputRecord -+ | >- { a = 1, b = 2 } | 2 -> b -+ // I am passing value 2 into port with the name b - old // value will be replaced with new one
If there is a field with given name inside Record Token, the type of field may change if you pass different type in the input
{ a = 1, b = 1 } -> inputRecord -+ | >- { a = 1, b = { c = 2 } } | { c = 2 } -> b -+ // I am passing record { c = 2 } into port b - old value // will be replaced with Record Token element (nested Record Token)
You can modify nested Record Type values by separating names of elements with /. E.g. you can specify "a/b"
{ a = { b = 1} } -> inputRecord -+ | >- { a = 1, b = { c = 2 } } | 2 -> a/b -+ // I am passing value 2 into port a/b - this time, I modify element a.b inside Record Token // note that we have to use "/" in port name due to the fact Kepler // doesn't allow to use "." as name separator
recordget
This actor allows to get values from the RecordToken