Retrieve Graphname

Good Day,

Is it possible to retrieve the graphname in a Transformation? For our application, we have audit fields to store which object created or last updated a row, and rather than hard coding a graph name that may or not be maintained, I would rather retrieve it from the system.

It appeared getGraph().getGraphProperties().getProperty(“JOB_FILE”) had some promise, but in a transformation it returns a Function ‘getGraph’ is not declared error message.

Any guidance would be appreciated.

Thanks,
Thomas

Hi Thomas

The functions you mentioned are Java methods. If you want to get the graph name by a CTL2 function, please use this expression:

$out.0.field1 = "${JOB_FILE}"

That will return path with file name. In order to get only the file name you can use:

$out.0.field1 = getFileName("${JOB_FILE}")

Hope this helps.

Thank you very much Lukas!

The Job_File parameter worked fine. I received the same Function not declared on the getFileName, however, with a little lastIndexOf and substring, I was able to parse out the graphname from the path.

Should I concern myself with the Function not declared error at this time?

Thanks again,

Hi Thomas

I believe, there is no need to be concerned about the missing function. I assume you are using Designer version 4.0.x or former. That function was added in version 4.1.0, thus it is not available in earlier versions. If you are using version 4.1.0 or higher, please let me know.

Best regards

That is is. I am on 4.0…

Thank you very much!