Transform in TSDecl using fillMissing()

I have a metric using TSDecl as follows:

{
    "id": "PreviousCuSumValue_SRCTYPE",
    "name": "PreviousCuSumValue",
    "srcType": "SRCTYPE",
    "path": "cuSumMapping",
    "tsDecl": {
      "data": "cuSumValueHistory",
      "treatment": "PREVIOUS", 
      "start": "timestamp",
      "value": "value",
      "transform": "fillMissing(this, 0)" 
    }
}

This works fine. However, instead of filling missing with hard-coded 0, I 'd like to use a parameter stored in an enum type. I create:

{
    "id": "PreviousCuSumValue_SRCTYPE",
    "name": "PreviousCuSumValue",
    "srcType": "SRCTYPE",
    "path": "cuSumMapping",
    "tsDecl": {
      "data": "cuSumValueHistory",
      "treatment": "PREVIOUS", 
      "start": "timestamp",
      "value": "value",
      "transform": "fillMissing(this, parseInt(MyConfig.DEFAULT_CUSUM_VALUE))" 
    }
}

But I get the following error:

severity:"ERROR",message:"Invalid transform argument 'fillMissing(this, parseInt(MyConfig.DEFAULT_CUSUM_VALUE))' in metric 'PreviousCuSumValue' with source type 'SRCTYPE' : java.lang.NullPointerException.",targetType:"SimpleMetric",targetId:"PreviousCuSumValue_SRCTYPE"}

Is there another way to do this?

parseInt is not an expression engine function, try with number instead.

@bachr, thanks that worked.

1 Like