ExecuteGraph in JobFlow - bringing dictionary items back to JobFlow

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

Bruce
Posts: 2
Joined: Thu Sep 13, 2018 3:25 pm

ExecuteGraph in JobFlow - bringing dictionary items back to JobFlow

Postby Bruce » Tue Sep 18, 2018 3:08 pm

Hi,

I have a jobflow which executes a graph which sets certain dictionary items. From reading the documentation, it seems like I should be able to bring those dictionary items back to the parent by just writing code in the output mapping of the ExecuteGraph like:

dictionary.as_of = $in.2.as_of;

I have found what I feel is a workaround but it seems cumbersome. I also have both dictionary elements set to true for input/output.

What could I be missing (CloverETL 4.8).

Thanks,
Bruce

The documentation reads as follows:


In order to pass a dictionary between two steps in a jobflow, it is necessary to:

Declare the desired dictionary entries in the child’s dictionary

Tag the entry as input (entry value is set by a parent) or output (parent to retrieve value from a child)

Define mapping for each entry in parent’s ExecuteGraph/ExecuteJobflow/ExecuteProfilerJob component’s Input Mapping or Output Mapping properties.

For a child to pass an entry to the parent, a value can be set during child execution using the Success, Fail, or SetJobOutput component, but it is also possible via CTL code.

Parameters declared in the child graph (local or from parametric file) can be set in the Input Mapping of ExecuteGraph/ExecuteJobflow in the parent graph. It is NOT possible for the child to change the parameter value during its runtime or the parent to retrieve parameter value from a child.

Both parameters and any input/output dictionary entries declared in the child graph are automatically displayed in the Input Mapping or Output Mapping of ExecuteGraph/ExecuteJobflow accordingly.

vazquezrosariop
Posts: 151
Joined: Mon Feb 29, 2016 5:33 pm

Re: ExecuteGraph in JobFlow - bringing dictionary items back to JobFlow

Postby vazquezrosariop » Tue Sep 18, 2018 3:51 pm

Hi Bruce,

I would highly recommend using the SetJobOutput to set the dictionary value on the graph level. Then in the ExecuteGraph you can directly map the dictionary in the Output Mapping. I have also, taken the liberty of adding an example Project.

DictionaryExample.zip
(6.16 KiB) Downloaded 193 times
---
Pedro X. Vazquez Rosario
CloverCARE Support
CloverDX

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

Bruce
Posts: 2
Joined: Thu Sep 13, 2018 3:25 pm

Re: ExecuteGraph in JobFlow - bringing dictionary items back to JobFlow

Postby Bruce » Tue Sep 18, 2018 6:12 pm

Thanks.

I follow your logic but want to understand how you're setting the dictionary value in "Reformat". The code is below. In this line $out.0.myList = myList; Is this setting the dictionary value or creating a record to be processed in the next step? I would have expected this line to say Dictionary.myList = myList.

What am I missing?

integer[] myList;
integer i = 0;

// Transforms input record into output record.
function integer transform() {

insert(myList, i, $in.0.myValue);
i++;

$out.0.myList = myList;

return ALL;
}

vazquezrosariop
Posts: 151
Joined: Mon Feb 29, 2016 5:33 pm

Re: ExecuteGraph in JobFlow - bringing dictionary items back to JobFlow

Postby vazquezrosariop » Mon Oct 01, 2018 7:58 pm

The "Reformat" is building the record that will be assigned to the Dictionary in the next step of the flow which in this case would be SetJobOuput. If you have questions I would recommend reading more about SetJobOutput in our documentation.
---
Pedro X. Vazquez Rosario
CloverCARE Support
CloverDX

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


cron