Graph name as Parameter in Designer

Support/help with CloverETL (4.9) and CloverDX (5.0 or newer) implementation problems

pfield
Posts: 13
Joined: Thu Mar 19, 2020 3:46 pm

Graph name as Parameter in Designer

Postby pfield » Thu Sep 10, 2020 11:08 am

Hi,

Is it possible to have the name of the graph that is currently executing available as a parameter available in CTL?

My use case is that I have many graphs running synchronously (via RunGraph) doing various data checks. If an issue is found the graph will write this to a log and I'd like to include (as part of that log) what graph picked up the error. Currently i'm hard coding the values in each graph but it's cumbersome to maintain and would be great if I could just have the value dynamically populated.

I know this can be done when using the Server license but that's not available to me so wondering if behavior can achieved in Designer.

Thanks,
Paul

jandikovae
Posts: 50
Joined: Fri Nov 04, 2016 8:51 am

Re: Graph name as Parameter in Designer

Postby jandikovae » Sat Oct 03, 2020 7:35 pm

Hi Paul,

As I understand it, you would like to use a graph name and write it to a field using CTL transformation. To do that, you might find the following code useful:

Code: Select all

string GraphFile = getParamValue("GRAPH_FILE");
$out.0.field1 = GraphFile;


This piece of code will write graph file identification to the output in the following form:
graph/graphname.grf
The "graph" states for Graph directory in the project path. If you don't want that extra part to be there, you might want to use some string functions such as split. Example:

Code: Select all

string GraphFile = getParamValue("GRAPH_FILE");
string [] GraphName = split(GraphFile, "/");
$out.0.field1 = GraphName[1];


For more information about the function itself or other options, please see the documentation page String Functions.

Please let me know if this doesn't answer your question or if any follow-up question arises. Thanks, Eva
---
Eva Jandikova
CloverCARE Support
CloverDX

Visit us online at http://www.cloverdx.com

pfield
Posts: 13
Joined: Thu Mar 19, 2020 3:46 pm

Re: Graph name as Parameter in Designer

Postby pfield » Thu Oct 08, 2020 1:54 pm

Thanks Eva!

That's exactly what I needed. I did not see the GRAPH_FILE parameter listed in workspace.prm - is there a place all the parameters available are documented?

Kind Regards,
Paul

jandikovae
Posts: 50
Joined: Fri Nov 04, 2016 8:51 am

Re: Graph name as Parameter in Designer

Postby jandikovae » Fri Oct 23, 2020 1:24 pm

Hi Paul,

The parameters available are indeed listed in the documentation (https://doc.cloverdx.com/latest/server/graph-parameters.html). However, please don't get confused that the link is from Server-related documentation. These parameters are used in the Designer runtime as well.

You might have also noticed, that the previously mentioned parameter GRAPH_FILE is not listed on the above-mentioned page. Recently I have been informed that this parameter is about to be deprecated soon and we should be using JOB_FILE parameter instead. Doing so in a graph (.grf design) will behave the same way as the GRAPH_FILE parameter.

Thanks for understanding. Have a nice day, Eva
---
Eva Jandikova
CloverCARE Support
CloverDX

Visit us online at http://www.cloverdx.com


cron