Hi all,
The following transform works:
{
"name": "Angelo test transform",
"type": "dateFormat",
"attributes": {
"inputFormat": "yyyy-MM-dd",
"input": "2023-04-23"
}
}
But the following transform does not work (replace the string by a static transform that outputs the same string):
{
"name": "Angelo test transform",
"type": "dateFormat",
"attributes": {
"inputFormat": {
"type": "static",
"attributes": {
"value": "yyyy-MM-dd"
}
},
"input": "2023-04-23"
}
}
We then get the following error: “There was an exception while calculating the value for this attribute. class com.sailpoint.seaspray.transform.StaticTransform cannot be cast to class java.lang.String (com.sailpoint.seaspray.transform.StaticTransform is in unnamed module of loader ‘app’; java.lang.String is in module java.base of loader ‘bootstrap’)”
We also tried this (inserting Apache Velocity in the string):
{
"name": "Angelo test transform",
"type": "dateFormat",
"attributes": {
"inputFormat": "yyyy-MM-dd#if(1 eq 2) HH-mm-ss#end",
"input": "2023-04-23"
},
"internal": false
}
This transforms returns nothing when we map the transform to an identity attribute.
A usecase for this would be when we need to assign the inputFormat dynamically, maybe because we want to transform an identity attribute that has values in different date formats depending on the country of the identity. Or maybe we want to reference a transform, and pass the inputFormat from the transform that calls the reference.
According to Transforms | SailPoint Developer Community, every string value in a Seaspray transform can contain templated text and will run through the template engine. It looks like this is not the case.
We also noticed the following transform failing:
"name": "Angelo test static transform",
"type": "static",
"attributes": {
"value": "#if(2 eq 2)Hi#end$foo.$bar",
"foo": "#if(1 eq 1)ONE#{else}TWO#end",
"bar": "#if('a' eq 'b')A#{else}B#end"
},
It gives as output: Hi#if(1 eq 1)ONE#{else}TWO#end.#if('a' eq 'b')A#{else}B#end
, instead of evaluating the velocity code.
Kind regards,
Angelo